ScummVM API documentation
Dgds::DgdsFont Class Referenceabstract
Inheritance diagram for Dgds::DgdsFont:
Graphics::Font Dgds::FFont Dgds::PFont

Public Member Functions

 DgdsFont (byte w, byte h, byte start, byte count, const byte *glyphs)
 
virtual int getFontHeight () const override
 
virtual int getMaxCharWidth () const override
 
virtual int getCharWidth (uint32 chr) const override=0
 
- 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
 
virtual void drawChar (Surface *dst, uint32 chr, int x, int y, uint32 color) const =0
 
virtual void drawChar (ManagedSurface *dst, uint32 chr, int x, int y, uint32 color) 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 DgdsFontload (const Common::String &filename, ResourceManager *resourceManager, Decompressor *decompressor)
 

Protected Member Functions

void drawDgdsChar (Graphics::Surface *dst, int pos, int x, int y, int w, uint32 color) const
 
bool hasChar (byte chr) const
 
virtual int charOffset (byte chr) const =0
 

Protected Attributes

byte _w
 
byte _h
 
byte _start
 
byte _count
 
const byte * _glyphs
 

Member Function Documentation

◆ getFontHeight()

virtual int Dgds::DgdsFont::getFontHeight ( ) const
inlineoverridevirtual

Return the height of the font.

Returns
Font height in pixels.

Implements Graphics::Font.

◆ getMaxCharWidth()

virtual int Dgds::DgdsFont::getMaxCharWidth ( ) const
inlineoverridevirtual

Return the maximum width of the font.

Returns
Maximum font width in pixels.

Implements Graphics::Font.

◆ getCharWidth()

virtual int Dgds::DgdsFont::getCharWidth ( uint32  chr) const
overridepure virtual

Return the width of a specific character.

Parameters
chrThe character to query the width of.
Returns
The width of the character in pixels.

Implements Graphics::Font.

Implemented in Dgds::FFont, and Dgds::PFont.


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