ScummVM API documentation
Access::Font Class Reference
Inheritance diagram for Access::Font:
Access::AmazonFont Access::MartianBitFont Access::MartianFont

Public Types

enum  LINE_WIDTH_TYPE { kWidthInPixels, kWidthInChars }
 

Public Member Functions

virtual ~Font ()
 
int charWidth (char c) const
 
int stringWidth (const Common::String &msg) const
 
bool getLine (Common::String &s, int maxWidth, Common::String &line, int &width, LINE_WIDTH_TYPE widthType=kWidthInPixels) const
 
void drawString (BaseSurface *s, const Common::String &msg, const Common::Point &pt) const
 
int drawChar (BaseSurface *s, char c, Common::Point &pt) const
 

Static Public Attributes

static byte _fontColors [4]
 

Protected Member Functions

 Font (byte firstCharIndex)
 

Protected Attributes

byte _firstCharIndex
 
int _bitWidth
 
int _height
 
Common::Array< Graphics::Surface_chars
 

Member Enumeration Documentation

◆ LINE_WIDTH_TYPE

Type of line wrapping - Martian wraps based on chars, Amazon based on px.

Since the fonts are variable width we need to support both types to exactly wrap like the originals.

Constructor & Destructor Documentation

◆ Font()

Access::Font::Font ( byte  firstCharIndex)
protected

Constructor

◆ ~Font()

virtual Access::Font::~Font ( )
virtual

Destructor

Member Function Documentation

◆ charWidth()

int Access::Font::charWidth ( char  c) const

Get the width of a given character

◆ stringWidth()

int Access::Font::stringWidth ( const Common::String msg) const

Get the width of a given string

◆ getLine()

bool Access::Font::getLine ( Common::String s,
int  maxWidth,
Common::String line,
int &  width,
LINE_WIDTH_TYPE  widthType = kWidthInPixels 
) const

Get a partial string that will fit in a given width

Parameters
sSource string. Modified to remove line
maxWidthMaximum width allowed in px or chars (see widthType)
lineOutput line
widthActual width of returned line in selected units
widthTypeSelect the type of width constraint - px or chars
Returns
True if last line

◆ drawString()

void Access::Font::drawString ( BaseSurface s,
const Common::String msg,
const Common::Point pt 
) const

Draw a string on a given surface

◆ drawChar()

int Access::Font::drawChar ( BaseSurface s,
char  c,
Common::Point pt 
) const

Draw a character on a given surface


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