Home

Dokumentation

Impressum

Dokumentation VDR
 

Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

font.c

Go to the documentation of this file.
00001 /*
00002  * font.c: Font handling for the DVB On Screen Display
00003  *
00004  * See the main source file 'vdr.c' for copyright information and
00005  * how to reach the author.
00006  *
00007  * $Id: font.c 1.2 2000/11/18 15:16:08 kls Exp $
00008  */
00009 
00010 #include "font.h"
00011 #include "tools.h"
00012 
00013 #include "fontfix.c"
00014 #include "fontosd.c"
00015 
00016 cFont::cFont(eDvbFont Font)
00017 {
00018 
00019 #define FONTINDEX(Name)\
00020     case font##Name: for (int i = 0; i < NUMCHARS; i++)\
00021                          data[i] = (tCharData *)&Font##Name[i < 32 ? 0 : i - 32];\
00022                      break;
00023 
00024   switch (Font) {
00025     default:
00026     FONTINDEX(Osd);
00027     FONTINDEX(Fix);
00028     // TODO others...
00029     }
00030 }
00031 
00032 int cFont::Width(const char *s)
00033 {
00034   int w = 0;
00035   while (s && *s)
00036         w += Width(*s++);
00037   return w;
00038 }
00039 
00040 int cFont::Height(const char *s)
00041 {
00042   int h = 0;
00043   if (s && *s)
00044      h = Height(*s); // all characters have the same height!
00045   return h;
00046 }
00047 

Generated on Wed Feb 5 23:30:08 2003 for VDR by doxygen1.3-rc2