vdr  2.2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
cFreetypeFont Class Reference

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
 
- Public Member Functions inherited from cFont
virtual ~cFont ()
 
int Height (const char *s) 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
 

Additional Inherited Members

- Static Public Member Functions inherited from cFont
static void SetFont (eDvbFont Font, const char *Name, int CharHeight)
 
static const cFontGetFont (eDvbFont Font)
 
static cFontCreateFont (const char *Name, int CharHeight, int CharWidth=0)
 
static bool GetAvailableFontNames (cStringList *FontNames, bool Monospaced=false)
 
static cString GetFontFileName (const char *FontName)
 

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 esyslog.

cFreetypeFont::~cFreetypeFont ( )
virtual

Definition at line 174 of file font.c.

Member Function Documentation

int cFreetypeFont::Bottom ( void  ) const
inlineprivate

Definition at line 109 of file font.c.

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(), cPalette::Bpp(), clrTransparent, cBitmap::GetColor(), cPalette::Index(), tKerning::kerning, cGlyph::Left(), MAX_BLEND_LEVELS, cGlyph::Pitch(), tKerning::prevSym, cGlyph::Rows(), cBitmap::SetIndex(), Setup, cGlyph::Top(), Utf8CharGet(), SI::Utf8CharLen(), cGlyph::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
inlinevirtual

Returns the font name.

Reimplemented from cFont.

Definition at line 115 of file font.c.

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

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

Implements cFont.

Definition at line 119 of file font.c.

int cFreetypeFont::Kerning ( cGlyph Glyph,
uint  PrevSym 
) const
private
virtual int cFreetypeFont::Size ( void  ) const
inlinevirtual

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.

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, and Setup.

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, tKerning::prevSym, Setup, Utf8CharGet(), and SI::Utf8CharLen().

Member Data Documentation

int cFreetypeFont::bottom
private

Definition at line 104 of file font.c.

FT_Face cFreetypeFont::face
private

Handle to face object.

Definition at line 106 of file font.c.

cString cFreetypeFont::fontName
private

Definition at line 101 of file font.c.

cList<cGlyph> cFreetypeFont::glyphCacheAntiAliased
mutableprivate

Definition at line 108 of file font.c.

cList<cGlyph> cFreetypeFont::glyphCacheMonochrome
mutableprivate

Definition at line 107 of file font.c.

int cFreetypeFont::height
private

Definition at line 103 of file font.c.

FT_Library cFreetypeFont::library
private

Handle to library.

Definition at line 105 of file font.c.

int cFreetypeFont::size
private

Definition at line 102 of file font.c.


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