vdr  2.0.6
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 bottom, esyslog, face, fontName, height, library, and size.

cFreetypeFont::~cFreetypeFont ( )
virtual

Definition at line 174 of file font.c.

References face, and library.

Member Function Documentation

int cFreetypeFont::Bottom ( void  ) const
inlineprivate

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(), SI::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
inlinevirtual

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

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

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 SI::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().

cString cFreetypeFont::fontName
private

Definition at line 101 of file font.c.

Referenced by cFreetypeFont(), and FontName().

cList<cGlyph> cFreetypeFont::glyphCacheAntiAliased
mutableprivate

Definition at line 108 of file font.c.

Referenced by Glyph().

cList<cGlyph> cFreetypeFont::glyphCacheMonochrome
mutableprivate

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: