summaryrefslogtreecommitdiff
path: root/font.h
blob: 414eaa8b75d1a54fff6d7334cfacc0b0abf294da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * 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.
 *
 * $Id: font.h 1.2 2000/11/18 14:51:45 kls Exp $
 */

#ifndef __FONT_H
#define __FONT_H

enum eDvbFont {
  fontOsd,
  fontFix,
/* TODO as soon as we have the font files...
  fontTtxSmall,
  fontTtxLarge,
*/
  };

class cFont {
public:
  enum { NUMCHARS = 256 };
  typedef unsigned long tPixelData;
  struct tCharData {
    tPixelData width, height;
    tPixelData lines[1];
    };
private:
  const tCharData *data[NUMCHARS];
public:
  cFont(eDvbFont Font);
  int Width(unsigned char c) { return data[c]->width; }
  int Width(const char *s);
  int Height(unsigned char c) { return data[c]->height; }
  int Height(const char *s);
  const tCharData *CharData(unsigned char c) { return data[c]; }
  };

#endif //__FONT_H