summaryrefslogtreecommitdiff
path: root/graphtft
diff options
context:
space:
mode:
authorStone <syphyr@gmail.com>2009-01-03 21:43:28 +0200
committerVille Skyttä <ville.skytta@iki.fi>2009-01-03 21:43:28 +0200
commit0bb8af583951e51284eb7363e2748f7322c70020 (patch)
treea686b75a092365e449a9db53161d6462a1985d60 /graphtft
parent2e095b8005c91278fe90ccad25557bae5aadb750 (diff)
downloadvdr-plugin-text2skin-0bb8af583951e51284eb7363e2748f7322c70020.tar.gz
vdr-plugin-text2skin-0bb8af583951e51284eb7363e2748f7322c70020.tar.bz2
Make compatible with VDR >= 1.5.4.
Diffstat (limited to 'graphtft')
-rw-r--r--graphtft/font.c14
-rw-r--r--graphtft/font.h4
2 files changed, 18 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;
diff --git a/graphtft/font.h b/graphtft/font.h
index 2d2eee1..041baef 100644
--- a/graphtft/font.h
+++ b/graphtft/font.h
@@ -24,7 +24,9 @@ class cGraphtftFont
{
private:
typedef map<string,cFont*> cache_map;
+#if VDRVERSNUM < 10503
typedef map<string,cFont::tPixelData*> del_map;
+#endif
public:
cGraphtftFont();
@@ -40,7 +42,9 @@ private:
FT_Face _face;
FT_GlyphSlot _slot;
cache_map _cache;
+#if VDRVERSNUM < 10503
del_map _del;
+#endif
};