2000-10-03 10:34:48 +02:00
|
|
|
/*
|
|
|
|
* font.h: Font handling for the DVB On Screen Display
|
|
|
|
*
|
|
|
|
* See the main source file 'vdr.c' for copyright information and
|
|
|
|
* how to reach the author.
|
|
|
|
*
|
2003-10-24 13:13:02 +02:00
|
|
|
* $Id: font.h 1.4 2003/10/24 12:59:45 kls Exp $
|
2000-10-03 10:34:48 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __FONT_H
|
|
|
|
#define __FONT_H
|
|
|
|
|
2003-10-24 12:53:12 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
2000-10-03 10:34:48 +02:00
|
|
|
enum eDvbFont {
|
|
|
|
fontOsd,
|
2000-11-18 15:46:00 +01:00
|
|
|
fontFix,
|
2003-10-24 12:53:12 +02:00
|
|
|
fontSml
|
|
|
|
#define eDvbFontSize (fontSml + 1)
|
|
|
|
};
|
|
|
|
|
|
|
|
enum eDvbCode {
|
|
|
|
code_iso8859_1,
|
2003-10-24 13:13:02 +02:00
|
|
|
code_iso8859_7
|
|
|
|
#define eDvbCodeSize (code_iso8859_7 + 1)
|
2000-10-03 10:34:48 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class cFont {
|
|
|
|
public:
|
|
|
|
enum { NUMCHARS = 256 };
|
|
|
|
typedef unsigned long tPixelData;
|
|
|
|
struct tCharData {
|
|
|
|
tPixelData width, height;
|
|
|
|
tPixelData lines[1];
|
|
|
|
};
|
|
|
|
private:
|
2003-10-24 12:53:12 +02:00
|
|
|
static eDvbCode code;
|
|
|
|
static cFont *fonts[];
|
2000-10-03 10:34:48 +02:00
|
|
|
const tCharData *data[NUMCHARS];
|
|
|
|
public:
|
2003-10-24 12:53:12 +02:00
|
|
|
cFont(void *Data);
|
|
|
|
void SetData(void *Data);
|
|
|
|
int Width(unsigned char c) const { return data[c]->width; }
|
|
|
|
int Width(const char *s) const;
|
|
|
|
int Height(unsigned char c) const { return data[c]->height; }
|
|
|
|
int Height(const char *s) const;
|
|
|
|
const tCharData *CharData(unsigned char c) const { return data[c]; }
|
|
|
|
static bool SetCode(const char *Code);
|
|
|
|
static void SetCode(eDvbCode Code);
|
|
|
|
static void SetFont(eDvbFont Font, void *Data = NULL);
|
|
|
|
static const cFont *GetFont(eDvbFont Font);
|
2000-10-03 10:34:48 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //__FONT_H
|