diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2009-07-13 01:12:24 +0300 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2009-07-13 01:12:24 +0300 |
commit | 41d45011c24740abfcaae9ecf0ea3f1906c6f29e (patch) | |
tree | 40c29c378b9f96b2c166246f63660c9b4e6cf08a /xml | |
parent | 457026f870e5d2916347212ead617ff15b1e9bf1 (diff) | |
download | vdr-plugin-text2skin-41d45011c24740abfcaae9ecf0ea3f1906c6f29e.tar.gz vdr-plugin-text2skin-41d45011c24740abfcaae9ecf0ea3f1906c6f29e.tar.bz2 |
Replace internal freetype font handling with VDR's font facilities.
Skins that use fonts other than VDR's standard "Osd", "Fix", and "Sml"
need to be adapted to use font names as understood by VDR's
CreateFont() (Family:Style as of writing this) instead of filenames in
their font attributes' names, to use '@' instead of ':' as the
separator before sizes, and have fonts shipped with the skin installed
and configured in fontconfig. Typically, install font files (if
necessary) to a dir somewhere, run fc-cache(1) on the dir, replace for
example font="SomeFont.ttf:22,85" with font="Some Font@22,85" or
font="SomeFontBold.ttf:22,85" with font="Some Font:Bold@22,85" in the
*.skin file. Also, in case the shipped fonts are derivatives of some
existing ones, they may need to be properly renamed to something so
they will be used instead of the original if it happens to be
installed. (closes #36)
Diffstat (limited to 'xml')
-rw-r--r-- | xml/object.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/xml/object.c b/xml/object.c index ec69fe7..421c00d 100644 --- a/xml/object.c +++ b/xml/object.c @@ -116,7 +116,7 @@ bool cxObject::ParseFontFace(const std::string &Text) { int size = 0, width = 0, pos; std::string face = Text; - if ((pos = face.find(':')) != -1) { + if ((pos = face.find('@')) != -1) { std::string s = face.substr(pos + 1); const char *p = s.c_str(); char *end; @@ -152,11 +152,7 @@ const cFont *cxObject::Font(void) const { const cFont *font; - if ((font = cText2SkinFont::Load(SkinPath() + "/" + mSkin->Name(), mFontFace, mFontSize, - mFontWidth)) != NULL) - return font; - - if ((font = cText2SkinFont::Load(SkinPath() + "/fonts", mFontFace, mFontSize, mFontWidth)) != NULL) + if ((font = cText2SkinFont::Load(mFontFace, mFontSize)) != NULL) return font; return cFont::GetFont(fontOsd); |