mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
Faster OSD by using bitmap
This commit is contained in:
41
font.c
Normal file
41
font.c
Normal file
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user