diff options
author | Stone <syphyr@gmail.com> | 2009-01-03 21:43:28 +0200 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2009-01-03 21:43:28 +0200 |
commit | 0bb8af583951e51284eb7363e2748f7322c70020 (patch) | |
tree | a686b75a092365e449a9db53161d6462a1985d60 /graphtft/font.c | |
parent | 2e095b8005c91278fe90ccad25557bae5aadb750 (diff) | |
download | vdr-plugin-text2skin-0bb8af583951e51284eb7363e2748f7322c70020.tar.gz vdr-plugin-text2skin-0bb8af583951e51284eb7363e2748f7322c70020.tar.bz2 |
Make compatible with VDR >= 1.5.4.
Diffstat (limited to 'graphtft/font.c')
-rw-r--r-- | graphtft/font.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/graphtft/font.c b/graphtft/font.c index 7941b74..4eb666c 100644 --- a/graphtft/font.c +++ b/graphtft/font.c @@ -41,6 +41,7 @@ bool cGraphtftFont::Load(string Filename, string CacheName, int Size, int Langua if ( _cache.find(CacheName) != _cache.end() ) return true; +#if VDRVERSNUM < 10503 int error = FT_New_Face(_library, Filename.c_str(), format, &_face); // every thing ok? @@ -186,6 +187,17 @@ bool cGraphtftFont::Load(string Filename, string CacheName, int Size, int Langua delete(font_data); // Something went wrong! return false; +#else +#if VDRVERSNUM < 10504 + cFont* newFont = new cFreetypeFont(*AddDirectory(FONTDIR, Filename.c_str()), Size); +#else + cFont* newFont = cFont::CreateFont(Filename.c_str(), Size); +#endif + if ( newFont == NULL ) + return false; + _cache[CacheName] = newFont; + return true; +#endif } const cFont* cGraphtftFont::GetFont(string CacheName){ @@ -209,10 +221,12 @@ void cGraphtftFont::Clear() delete((*it).second); _cache.clear(); +#if VDRVERSNUM < 10503 del_map::iterator del_it = _del.begin(); for (; del_it != _del.end(); ++del_it) delete((*del_it).second); _del.clear(); +#endif } cGraphtftFont GraphtftFont; |