ScummVM
LastExpress::Font Class Reference

#include <font.h>

Public Member Functions

 Font ()
 
 ~Font ()
 
bool load (Common::SeekableReadStream *stream)
 
Common::Rect drawString (Graphics::Surface *surface, int16 x, int16 y, Common::String str)
 
Common::Rect drawString (Graphics::Surface *surface, int16 x, int16 y, const uint16 *str, uint16 length)
 

Private Member Functions

void reset ()
 
uint16 getCharGlyph (uint16 c) const
 
bytegetGlyphImg (uint16 g)
 
uint8 getGlyphWidth (uint16 g)
 
bytegetCharImg (uint16 c)
 
uint8 getCharWidth (uint16 c) const
 
uint16 getStringWidth (Common::String str) const
 
uint16 getStringWidth (const uint16 *str, uint16 length) const
 
void drawChar (Graphics::Surface *surface, int16 x, int16 y, uint16 c)
 

Private Attributes

uint16 _palette [_paletteSize]
 
uint8 _charMap [_charMapSize]
 
uint16 _numGlyphs
 
byte_glyphs
 
uint8_glyphWidths
 

Static Private Attributes

static const uint32 _paletteSize = 0x10
 
static const uint32 _charMapSize = 0x200
 
static const uint32 _charHeight = 16
 

Detailed Description

Definition at line 49 of file font.h.

Constructor & Destructor Documentation

◆ Font()

LastExpress::Font::Font ( )

Definition at line 32 of file font.cpp.

◆ ~Font()

LastExpress::Font::~Font ( )

Definition at line 37 of file font.cpp.

Member Function Documentation

◆ drawChar()

void LastExpress::Font::drawChar ( Graphics::Surface surface,
int16  x,
int16  y,
uint16  c 
)
private

Definition at line 165 of file font.cpp.

◆ drawString() [1/2]

Common::Rect LastExpress::Font::drawString ( Graphics::Surface surface,
int16  x,
int16  y,
Common::String  str 
)

Definition at line 185 of file font.cpp.

◆ drawString() [2/2]

Common::Rect LastExpress::Font::drawString ( Graphics::Surface surface,
int16  x,
int16  y,
const uint16 str,
uint16  length 
)

Definition at line 195 of file font.cpp.

◆ getCharGlyph()

uint16 LastExpress::Font::getCharGlyph ( uint16  c) const
private

Definition at line 89 of file font.cpp.

◆ getCharImg()

byte * LastExpress::Font::getCharImg ( uint16  c)
private

Definition at line 132 of file font.cpp.

◆ getCharWidth()

uint8 LastExpress::Font::getCharWidth ( uint16  c) const
private

Definition at line 136 of file font.cpp.

◆ getGlyphImg()

byte * LastExpress::Font::getGlyphImg ( uint16  g)
private

Definition at line 97 of file font.cpp.

◆ getGlyphWidth()

uint8 LastExpress::Font::getGlyphWidth ( uint16  g)
private

Definition at line 107 of file font.cpp.

◆ getStringWidth() [1/2]

uint16 LastExpress::Font::getStringWidth ( Common::String  str) const
private

Definition at line 149 of file font.cpp.

◆ getStringWidth() [2/2]

uint16 LastExpress::Font::getStringWidth ( const uint16 str,
uint16  length 
) const
private

Definition at line 157 of file font.cpp.

◆ load()

bool LastExpress::Font::load ( Common::SeekableReadStream stream)

Definition at line 46 of file font.cpp.

◆ reset()

void LastExpress::Font::reset ( )
private

Definition at line 41 of file font.cpp.

Member Data Documentation

◆ _charHeight

const uint32 LastExpress::Font::_charHeight = 16
staticprivate

Definition at line 61 of file font.h.

◆ _charMap

uint8 LastExpress::Font::_charMap[_charMapSize]
private

Definition at line 76 of file font.h.

◆ _charMapSize

const uint32 LastExpress::Font::_charMapSize = 0x200
staticprivate

Definition at line 60 of file font.h.

◆ _glyphs

byte* LastExpress::Font::_glyphs
private

Definition at line 78 of file font.h.

◆ _glyphWidths

uint8* LastExpress::Font::_glyphWidths
private

Definition at line 79 of file font.h.

◆ _numGlyphs

uint16 LastExpress::Font::_numGlyphs
private

Definition at line 77 of file font.h.

◆ _palette

uint16 LastExpress::Font::_palette[_paletteSize]
private

Definition at line 75 of file font.h.

◆ _paletteSize

const uint32 LastExpress::Font::_paletteSize = 0x10
staticprivate

Definition at line 59 of file font.h.


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