summaryrefslogtreecommitdiff
path: root/font.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2009-05-03 14:15:21 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2009-05-03 14:15:21 +0200
commitf161d1b2fe69d4fcfac37581fa60b5d9ce5ded11 (patch)
treeff65b9bcb3041e0733ebb1c59bac1203002c5903 /font.c
parent34b3d467849d0e8192c9cfbd65a630973f602863 (diff)
downloadvdr-f161d1b2fe69d4fcfac37581fa60b5d9ce5ded11.tar.gz
vdr-f161d1b2fe69d4fcfac37581fa60b5d9ce5ded11.tar.bz2
OSD sizes in percent; automatic update of OSD size
Diffstat (limited to 'font.c')
-rw-r--r--font.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/font.c b/font.c
index f962a09c..3fa97df7 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 2.1 2008/05/02 16:16:51 kls Exp $
+ * $Id: font.c 2.2 2009/05/03 11:15:39 kls Exp $
*/
#include "font.h"
@@ -145,7 +145,7 @@ cFreetypeFont::cFreetypeFont(const char *Name, int CharHeight, int CharWidth)
0, // horizontal device resolution
0); // vertical device resolution
if (!error) {
- height = ((face->size->metrics.ascender-face->size->metrics.descender) + 63) / 64;
+ height = (face->size->metrics.ascender - face->size->metrics.descender + 63) / 64;
bottom = abs((face->size->metrics.descender - 63) / 64);
}
else
@@ -328,7 +328,7 @@ cFont *cFont::fonts[eDvbFontSize] = { NULL };
void cFont::SetFont(eDvbFont Font, const char *Name, int CharHeight)
{
- cFont *f = CreateFont(Name, CharHeight);
+ cFont *f = CreateFont(Name, min(max(CharHeight, MINFONTSIZE), MAXFONTSIZE));
if (!f || !f->Height())
f = new cDummyFont;
delete fonts[Font];