ScummVM API documentation
MM::XeenFont Class Reference

#include <xeen_font.h>

Inheritance diagram for MM::XeenFont:
Graphics::Font

Public Member Functions

void load (Common::SeekableReadStream *src, size_t charsOffset, size_t charWidthsOffset)
 
int getFontHeight () const override
 
int getMaxCharWidth () const override
 
int getCharWidth (uint32 chr) const override
 
int getStringWidth (const Common::String &str) const
 
void drawChar (Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const override
 
void drawChar (Graphics::ManagedSurface *dst, uint32 chr, int x, int y, uint32 color) const override
 
- Public Member Functions inherited from Graphics::Font
virtual Common::String getFontName () const
 
virtual int getFontAscent () const
 
virtual int getFontDescent () const
 
virtual int getFontLeading () const
 
virtual int getKerningOffset (uint32 left, uint32 right) const
 
virtual Common::Rect getBoundingBox (uint32 chr) const
 
Common::Rect getBoundingBox (const Common::String &str, int x=0, int y=0, const int w=0, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false) const
 
Common::Rect getBoundingBox (const Common::U32String &str, int x=0, int _y=0, const int w=0, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false) const
 
void drawString (Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false) const
 
void drawString (Surface *dst, const Common::U32String &str, int x, int y, int w, uint32 color, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false) const
 
void drawString (ManagedSurface *dst, const Common::String &str, int x, int _y, int w, uint32 color, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false) const
 
void drawString (ManagedSurface *dst, const Common::U32String &str, int x, int y, int w, uint32 color, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false) const
 
int getStringWidth (const Common::String &str) const
 
int getStringWidth (const Common::U32String &str) const
 
int wordWrapText (const Common::String &str, int maxWidth, Common::Array< Common::String > &lines, int initWidth=0, uint32 mode=kWordWrapOnExplicitNewLines) const
 
int wordWrapText (const Common::U32String &str, int maxWidth, Common::Array< Common::U32String > &lines, int initWidth=0, uint32 mode=kWordWrapOnExplicitNewLines) const
 
int wordWrapText (const Common::U32String &str, int maxWidth, Common::Array< Common::U32String > &lines, Common::Array< bool > &lineContinuation, int initWidth=0, uint32 mode=kWordWrapOnExplicitNewLines) const
 
void scaleSingleGlyph (Surface *scaleSurface, int *grayScaleMap, int grayScaleMapSize, int width, int height, int xOffset, int yOffset, int grayLevel, int chr, int srcheight, int srcwidth, float scale) const
 

Static Public Member Functions

static void loadColors (Common::SeekableReadStream *src)
 
static void setColors (uint index)
 

Detailed Description

Implements a font stored as a grid on a passed surface

Member Function Documentation

◆ setColors()

static void MM::XeenFont::setColors ( uint  index)
static

Set the text colors set index

◆ load()

void MM::XeenFont::load ( Common::SeekableReadStream src,
size_t  charsOffset,
size_t  charWidthsOffset 
)

Loads the font

◆ getFontHeight()

int MM::XeenFont::getFontHeight ( ) const
inlineoverridevirtual

Get the font height

Implements Graphics::Font.

◆ getMaxCharWidth()

int MM::XeenFont::getMaxCharWidth ( ) const
inlineoverridevirtual

Get the maximum character width

Implements Graphics::Font.

◆ getCharWidth()

int MM::XeenFont::getCharWidth ( uint32  chr) const
overridevirtual

Get the width of the given character

Implements Graphics::Font.

◆ getStringWidth()

int MM::XeenFont::getStringWidth ( const Common::String str) const

Get the string width

◆ drawChar()

void MM::XeenFont::drawChar ( Graphics::Surface dst,
uint32  chr,
int  x,
int  y,
uint32  color 
) const
overridevirtual

Draw a character

Implements Graphics::Font.


The documentation for this class was generated from the following file: