summaryrefslogtreecommitdiff
path: root/font.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-10-03 10:34:48 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2000-10-03 10:34:48 +0200
commit6a50f37f25b43112d4a1fad8a5057089548dfc3c (patch)
treec3a28722d1c7b04c12174fe748aead391e7c0ed8 /font.c
parentb4faf3787a24c43b0a22b3ee695374012c992eb2 (diff)
downloadvdr-6a50f37f25b43112d4a1fad8a5057089548dfc3c.tar.gz
vdr-6a50f37f25b43112d4a1fad8a5057089548dfc3c.tar.bz2
Faster OSD by using bitmap
Diffstat (limited to 'font.c')
-rw-r--r--font.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/font.c b/font.c
new file mode 100644
index 00000000..3ef40835
--- /dev/null
+++ b/font.c
@@ -0,0 +1,41 @@
+/*
+ * font.c: Font handling for the DVB On Screen Display
+ *
+ * See the main source file 'vdr.c' for copyright information and
+ * how to reach the author.
+ *
+ * $Id: font.c 1.1 2000/10/01 15:01:49 kls Exp $
+ */
+
+#include "font.h"
+#include "tools.h"
+
+#include "fontosd.c"
+
+cFont::cFont(eDvbFont Font)//XXX
+{
+ switch (Font) {
+ default:
+ case fontOsd: for (int i = 0; i < NUMCHARS; i++)
+ data[i] = (tCharData *)&FontOsd[i < 32 ? 0 : i - 32];
+ break;
+ // TODO others...
+ }
+}
+
+int cFont::Width(const char *s)
+{
+ int w = 0;
+ while (s && *s)
+ w += Width(*s++);
+ return w;
+}
+
+int cFont::Height(const char *s)
+{
+ int h = 0;
+ if (s && *s)
+ h = Height(*s); // all characters have the same height!
+ return h;
+}
+