summaryrefslogtreecommitdiff
path: root/font.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2007-06-23 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2007-06-23 18:00:00 +0200
commita9c7f0de90a44ea7c031154d47b092faed74f90b (patch)
treee361dd22d05e8435de69b6aee64efe1aa816a2bc /font.c
parentb1e4da3be6552f58f3890bf2ad48879823d2e130 (diff)
downloadvdr-patch-lnbsharing-a9c7f0de90a44ea7c031154d47b092faed74f90b.tar.gz
vdr-patch-lnbsharing-a9c7f0de90a44ea7c031154d47b092faed74f90b.tar.bz2
Version 1.5.5vdr-1.5.5
- Fixed a name clash between skincurses.c and the new cOsd position functions. - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Changed the parameter "OSD font size" to "Default font size" in "Setup/OSD". - Fixed handling address masks in SVDRP host settings (thanks to Frank Schmirler). - Fonts can now be created with a width that overwrites the default width (thanks to Andreas Mair). - Added full weekday names to i18n.c for plugins to use (thanks to Patrice Staudt). The new function WeekDayNameFull() can be used to get these names from integer values (just like the abbreviated weekday names). - Fixed stripping i18n stuff from font names (reported by Anssi Hannula). - Improved performance of the SVDRP commands LSTC and CHAN when used with a channel name.
Diffstat (limited to 'font.c')
-rw-r--r--font.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/font.c b/font.c
index 7e47e7a..19753bf 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 1.19 2007/06/17 12:13:49 kls Exp $
+ * $Id: font.c 1.21 2007/06/23 11:25:42 kls Exp $
*/
#include "font.h"
@@ -103,7 +103,7 @@ private:
int Kerning(cGlyph *Glyph, uint PrevSym) const;
cGlyph* Glyph(uint CharCode, bool AntiAliased = false) const;
public:
- cFreetypeFont(const char *Name, int CharHeight);
+ cFreetypeFont(const char *Name, int CharHeight, int CharWidth = 0);
virtual ~cFreetypeFont();
virtual int Width(uint c) const;
virtual int Width(const char *s) const;
@@ -111,7 +111,7 @@ public:
virtual void DrawText(cBitmap *Bitmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const;
};
-cFreetypeFont::cFreetypeFont(const char *Name, int CharHeight)
+cFreetypeFont::cFreetypeFont(const char *Name, int CharHeight, int CharWidth)
{
height = 0;
bottom = 0;
@@ -140,7 +140,7 @@ cFreetypeFont::cFreetypeFont(const char *Name, int CharHeight)
}
else {
error = FT_Set_Char_Size(face, // handle to face object
- 0, // char_width in 1/64th of points
+ CharWidth * 64, // CharWidth in 1/64th of points
CharHeight * 64, // CharHeight in 1/64th of points
0, // horizontal device resolution
0); // vertical device resolution
@@ -332,11 +332,11 @@ const cFont *cFont::GetFont(eDvbFont Font)
return fonts[Font];
}
-cFont *cFont::CreateFont(const char *Name, int CharHeight)
+cFont *cFont::CreateFont(const char *Name, int CharHeight, int CharWidth)
{
cString fn = GetFontFileName(Name);
if (*fn)
- return new cFreetypeFont(fn, CharHeight);
+ return new cFreetypeFont(fn, CharHeight, CharWidth);
return NULL;
}
@@ -354,9 +354,19 @@ bool cFont::GetAvailableFontNames(cStringList *FontNames, bool Monospaced)
char *s = (char *)FcNameUnparse(fontset->fonts[i]);
if (s) {
// Strip i18n stuff:
+ char *c = strchr(s, ':');
+ if (c) {
+ char *p = strchr(c + 1, ',');
+ if (p)
+ *p = 0;
+ }
char *p = strchr(s, ',');
- if (p)
- *p = 0;
+ if (p) {
+ if (c)
+ memmove(p, c, strlen(c) + 1);
+ else
+ *p = 0;
+ }
// Make it user presentable:
s = strreplace(s, "\\", ""); // '-' is escaped
s = strreplace(s, "style=", "");