ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

#include <winfont.h>

Inheritance diagram for Graphics::WinFont:
Collaboration diagram for Graphics::WinFont:

List of all members.

Classes

struct  GlyphEntry

Public Member Functions

 WinFont ()
 ~WinFont ()
bool loadFromFON (const Common::String &fileName, const WinFontDirEntry &dirEntry=WinFontDirEntry())
 Open a font with a name in an FON file.
bool loadFromFNT (const Common::String &fileName)
 Open a font from an FNT file.
void close ()
 Close this font.
int getFontHeight () const
 Query the height of the font.
int getMaxCharWidth () const
 Query the maximum width of the font.
int getCharWidth (uint32 chr) const
 Query the width of a specific character.
void drawChar (Surface *dst, uint32 chr, int x, int y, uint32 color) const
 Draw a character at a specific point on a surface.

Private Member Functions

bool loadFromPE (const Common::String &fileName, const WinFontDirEntry &dirEntry)
bool loadFromNE (const Common::String &fileName, const WinFontDirEntry &dirEntry)
uint32 getFontIndex (Common::SeekableReadStream &stream, const WinFontDirEntry &dirEntry)
bool loadFromFNT (Common::SeekableReadStream &stream)
char indexToCharacter (uint16 index) const
uint16 characterToIndex (uint32 character) const

Private Attributes

uint16 _pixHeight
uint16 _maxWidth
byte _firstChar
byte _lastChar
byte _defaultChar
uint16 _glyphCount
struct
Graphics::WinFont::GlyphEntry
_glyphs

Detailed Description

Definition at line 45 of file winfont.h.


Constructor & Destructor Documentation

Graphics::WinFont::WinFont (  ) 

Definition at line 34 of file winfont.cpp.

Graphics::WinFont::~WinFont (  ) 

Definition at line 39 of file winfont.cpp.


Member Function Documentation

uint16 Graphics::WinFont::characterToIndex ( uint32  character  )  const [private]

Definition at line 204 of file winfont.cpp.

void Graphics::WinFont::close (  ) 

Close this font.

Definition at line 43 of file winfont.cpp.

void Graphics::WinFont::drawChar ( Surface dst,
uint32  chr,
int  x,
int  y,
uint32  color 
) const [virtual]

Draw a character at a specific point on a surface.

Note that the point describes the top left edge point where to draw the character. This can be different from top left edge point of the character's bounding box! For example, TTF fonts sometimes move characters like 't' one (or more) pixels to the left to create better visual results. To query the actual bounding box of a character use getBoundingBox.

See also:
getBoundingBox

The Font implemenation should take care of not drawing outside of the specified surface.

Parameters:
dst The surface to drawn on.
chr The character to draw.
x The x coordinate where to draw the character.
y The y coordinate where to draw the character.
color The color of the character.

Implements Graphics::Font.

Definition at line 328 of file winfont.cpp.

int Graphics::WinFont::getCharWidth ( uint32  chr  )  const [virtual]

Query the width of a specific character.

Parameters:
chr The character to query the width of.
Returns:
The character's width.

Implements Graphics::Font.

Definition at line 212 of file winfont.cpp.

int Graphics::WinFont::getFontHeight (  )  const [inline, virtual]

Query the height of the font.

Returns:
font height.

Implements Graphics::Font.

Definition at line 64 of file winfont.h.

uint32 Graphics::WinFont::getFontIndex ( Common::SeekableReadStream stream,
const WinFontDirEntry dirEntry 
) [private]

Definition at line 164 of file winfont.cpp.

int Graphics::WinFont::getMaxCharWidth (  )  const [inline, virtual]

Query the maximum width of the font.

Returns:
maximum font width.

Implements Graphics::Font.

Definition at line 65 of file winfont.h.

char Graphics::WinFont::indexToCharacter ( uint16  index  )  const [private]

Definition at line 196 of file winfont.cpp.

bool Graphics::WinFont::loadFromFNT ( Common::SeekableReadStream stream  )  [private]

Definition at line 216 of file winfont.cpp.

bool Graphics::WinFont::loadFromFNT ( const Common::String fileName  ) 

Open a font from an FNT file.

Definition at line 190 of file winfont.cpp.

bool Graphics::WinFont::loadFromFON ( const Common::String fileName,
const WinFontDirEntry dirEntry = WinFontDirEntry() 
)

Open a font with a name in an FON file.

If dirEntry is not given, the first font in the FONTDIR will be loaded

Definition at line 79 of file winfont.cpp.

bool Graphics::WinFont::loadFromNE ( const Common::String fileName,
const WinFontDirEntry dirEntry 
) [private]

Definition at line 88 of file winfont.cpp.

bool Graphics::WinFont::loadFromPE ( const Common::String fileName,
const WinFontDirEntry dirEntry 
) [private]

Definition at line 123 of file winfont.cpp.


Member Data Documentation

Definition at line 82 of file winfont.h.

Definition at line 80 of file winfont.h.

Definition at line 84 of file winfont.h.

Definition at line 81 of file winfont.h.

Definition at line 79 of file winfont.h.

Definition at line 78 of file winfont.h.


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


Generated on Sat Nov 16 2019 05:02:55 for ResidualVM by doxygen 1.7.1
curved edge   curved edge