summaryrefslogtreecommitdiff
path: root/dvbosd.c
diff options
context:
space:
mode:
Diffstat (limited to 'dvbosd.c')
-rw-r--r--dvbosd.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/dvbosd.c b/dvbosd.c
index c0150e2..457175d 100644
--- a/dvbosd.c
+++ b/dvbosd.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbosd.c 1.4 2000/11/01 09:13:32 kls Exp $
+ * $Id: dvbosd.c 1.6 2000/11/18 15:36:51 kls Exp $
*/
#include "dvbosd.h"
@@ -21,6 +21,7 @@ cBitmap::cBitmap(int Width, int Height)
width = Width;
height = Height;
bitmap = NULL;
+ fontType = fontOsd;
font = NULL;
if (width > 0 && height > 0) {
bitmap = new char[width * height];
@@ -42,10 +43,15 @@ cBitmap::~cBitmap()
delete bitmap;
}
-void cBitmap::SetFont(eDvbFont Font)
+eDvbFont cBitmap::SetFont(eDvbFont Font)
{
- delete font;
- font = new cFont(Font);
+ eDvbFont oldFont = fontType;
+ if (fontType != Font || !font) {
+ delete font;
+ font = new cFont(Font);
+ fontType = Font;
+ }
+ return oldFont;
}
bool cBitmap::Dirty(void)
@@ -81,6 +87,11 @@ int cBitmap::Width(unsigned char c)
return font ? font->Width(c) : -1;
}
+int cBitmap::Width(const char *s)
+{
+ return font ? font->Width(s) : -1;
+}
+
void cBitmap::Text(int x, int y, const char *s, eDvbColor ColorFg, eDvbColor ColorBg)
{
if (bitmap) {