1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
/*
* $Id: font.c,v 1.6 2004/12/14 20:02:31 lordjaxom Exp $
*/
#include "font.h"
#include "render.h"
#include <vdr/tools.h>
#ifdef HAVE_FREETYPE
cGraphtftFont cText2SkinFont::mFontCache;
#endif
cText2SkinFont::cText2SkinFont(void)
{
}
cText2SkinFont::~cText2SkinFont()
{
}
const cFont *cText2SkinFont::Load(const std::string &Path, const std::string &Filename, int Size)
{
if (Filename == "Osd")
return cFont::GetFont(fontOsd);
else if (Filename == "Fix")
return cFont::GetFont(fontFix);
else if (Filename == "Sml")
return cFont::GetFont(fontSml);
const cFont *res = NULL;
#ifdef HAVE_FREETYPE
char *cachename;
asprintf(&cachename, "%s_%d_%d", Filename.c_str(), Size, Setup.OSDLanguage);
Dprintf("trying now: %s %s\n", (Path + "/" + Filename).c_str(), cachename);
if (mFontCache.Load(Path + "/" + Filename, cachename, Size, Setup.OSDLanguage))
res = mFontCache.GetFont(cachename);
else
esyslog("ERROR: Text2Skin: Couldn't load font %s:%d", Filename.c_str(), Size);
free(cachename);
#else
esyslog("ERROR: Text2Skin: Font engine not enabled at compile time!");
#endif
return res;
}
|