vdr  1.7.27
Public Member Functions | Private Member Functions | Private Attributes
cFreetypeFont Class Reference

List of all members.

Public Member Functions

 cFreetypeFont (const char *Name, int CharHeight, int CharWidth=0)
virtual ~cFreetypeFont ()
virtual const char * FontName (void) const
virtual int Size (void) const
virtual int Width (uint c) const
virtual int Width (const char *s) const
virtual int Height (void) const
virtual void DrawText (cBitmap *Bitmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const
virtual void DrawText (cPixmap *Pixmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const

Private Member Functions

int Bottom (void) const
int Kerning (cGlyph *Glyph, uint PrevSym) const
cGlyphGlyph (uint CharCode, bool AntiAliased=false) const

Private Attributes

cString fontName
int size
int height
int bottom
FT_Library library
FT_Face face
cList< cGlyphglyphCacheMonochrome
cList< cGlyphglyphCacheAntiAliased

Detailed Description

Definition at line 99 of file font.c.


Constructor & Destructor Documentation

cFreetypeFont::cFreetypeFont ( const char *  Name,
int  CharHeight,
int  CharWidth = 0 
)

Definition at line 124 of file font.c.

References bottom, esyslog, face, fontName, height, library, and size.

Definition at line 174 of file font.c.

References face, and library.


Member Function Documentation

int cFreetypeFont::Bottom ( void  ) const [inline, private]

Definition at line 109 of file font.c.

References bottom.

Referenced by DrawText().

void cFreetypeFont::DrawText ( cBitmap Bitmap,
int  x,
int  y,
const char *  s,
tColor  ColorFg,
tColor  ColorBg,
int  Width 
) const [virtual]

Draws the given text into the Bitmap at position (x, y) with the given colors.

The text will not exceed the given Width (if > 0), and will end with a complete character.

Implements cFont.

Definition at line 269 of file font.c.

References cGlyph::AdvanceX(), cSetup::AntiAlias, cGlyph::Bitmap(), cPalette::Blend(), Bottom(), cPalette::Bpp(), clrTransparent, cBitmap::GetColor(), Glyph(), height, cPalette::Index(), Kerning(), cGlyph::Left(), MAX_BLEND_LEVELS, cGlyph::Pitch(), cGlyph::Rows(), cBitmap::SetIndex(), Setup, cGlyph::Top(), Utf8CharGet(), Utf8CharLen(), cGlyph::Width(), Width(), and cBitmap::Width().

void cFreetypeFont::DrawText ( cPixmap Pixmap,
int  x,
int  y,
const char *  s,
tColor  ColorFg,
tColor  ColorBg,
int  Width 
) const [virtual]
virtual const char* cFreetypeFont::FontName ( void  ) const [inline, virtual]

Returns the font name.

Reimplemented from cFont.

Definition at line 115 of file font.c.

References fontName.

cGlyph * cFreetypeFont::Glyph ( uint  CharCode,
bool  AntiAliased = false 
) const [private]
virtual int cFreetypeFont::Height ( void  ) const [inline, virtual]

Returns the height of this font in pixel (all characters have the same height).

Implements cFont.

Definition at line 119 of file font.c.

References height.

int cFreetypeFont::Kerning ( cGlyph Glyph,
uint  PrevSym 
) const [private]

Definition at line 180 of file font.c.

References cGlyph::CharCode(), face, cGlyph::GetKerningCache(), KERNING_UNKNOWN, and cGlyph::SetKerningCache().

Referenced by DrawText(), and Width().

virtual int cFreetypeFont::Size ( void  ) const [inline, virtual]

Returns the original size as requested when the font was created.

This may be different than the actual height.

Reimplemented from cFont.

Definition at line 116 of file font.c.

References size.

int cFreetypeFont::Width ( uint  c) const [virtual]

Returns the width of the given character in pixel.

Implements cFont.

Definition at line 239 of file font.c.

References cGlyph::AdvanceX(), cSetup::AntiAlias, Glyph(), and Setup.

Referenced by DrawText().

int cFreetypeFont::Width ( const char *  s) const [virtual]

Returns the width of the given string in pixel.

Implements cFont.

Definition at line 245 of file font.c.

References cGlyph::AdvanceX(), cSetup::AntiAlias, Glyph(), Kerning(), Setup, Utf8CharGet(), and Utf8CharLen().


Member Data Documentation

int cFreetypeFont::bottom [private]

Definition at line 104 of file font.c.

Referenced by Bottom(), and cFreetypeFont().

FT_Face cFreetypeFont::face [private]

Handle to face object.

Definition at line 106 of file font.c.

Referenced by cFreetypeFont(), Glyph(), Kerning(), and ~cFreetypeFont().

Definition at line 101 of file font.c.

Referenced by cFreetypeFont(), and FontName().

Definition at line 108 of file font.c.

Referenced by Glyph().

Definition at line 107 of file font.c.

Referenced by Glyph().

int cFreetypeFont::height [private]

Definition at line 103 of file font.c.

Referenced by cFreetypeFont(), DrawText(), and Height().

FT_Library cFreetypeFont::library [private]

Handle to library.

Definition at line 105 of file font.c.

Referenced by cFreetypeFont(), and ~cFreetypeFont().

int cFreetypeFont::size [private]

Definition at line 102 of file font.c.

Referenced by cFreetypeFont(), and Size().


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