summaryrefslogtreecommitdiff
path: root/font.c
diff options
context:
space:
mode:
Diffstat (limited to 'font.c')
-rw-r--r--font.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/font.c b/font.c
index 3fa97df..515017b 100644
--- a/font.c
+++ b/font.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: font.c 2.2 2009/05/03 11:15:39 kls Exp $
+ * $Id: font.c 2.4 2009/12/31 14:49:59 kls Exp $
*/
#include "font.h"
@@ -93,6 +93,8 @@ void cGlyph::SetKerningCache(uint PrevSym, int Kerning)
class cFreetypeFont : public cFont {
private:
+ cString fontName;
+ int size;
int height;
int bottom;
FT_Library library; ///< Handle to library
@@ -105,6 +107,8 @@ private:
public:
cFreetypeFont(const char *Name, int CharHeight, int CharWidth = 0);
virtual ~cFreetypeFont();
+ virtual const char *FontName(void) const { return fontName; }
+ virtual int Size(void) const { return size; }
virtual int Width(uint c) const;
virtual int Width(const char *s) const;
virtual int Height(void) const { return height; }
@@ -113,6 +117,8 @@ public:
cFreetypeFont::cFreetypeFont(const char *Name, int CharHeight, int CharWidth)
{
+ fontName = Name;
+ size = CharHeight;
height = 0;
bottom = 0;
int error = FT_Init_FreeType(&library);
@@ -346,6 +352,7 @@ const cFont *cFont::GetFont(eDvbFont Font)
case fontOsd: SetFont(Font, Setup.FontOsd, Setup.FontOsdSize); break;
case fontSml: SetFont(Font, Setup.FontSml, Setup.FontSmlSize); break;
case fontFix: SetFont(Font, Setup.FontFix, Setup.FontFixSize); break;
+ default: esyslog("ERROR: unknown Font %d (%s %d)", Font, __FUNCTION__, __LINE__);
}
}
return fonts[Font];