vdr/font.c
Klaus Schmidinger b8e837dbbb Version 1.3.2
- Fixed resetting the EPG data versions after changing the preferred languages
  (thanks to Teemu Rantanen for reporting this one and helping to debug it).
- Added LinkageDescriptor handling to 'libsi' (thanks to Marcel Wiesweg).
- Added Russian language texts (thanks to Vyacheslav Dikonov).
  Plugin authors may want to add the new entries to their I18N texts and contact
  the translators to have their texts translated. Note that there are now 17
  different OSD languages, so please make sure you have 17 versions for each of
  your texts.
- Some corrections and additions to the Finnish OSD texts (thanks to Rolf
  Ahrenberg and Niko Tarnanen).
- Fixed a wrong 'delta' value in the call to the shutdown script (thanks to
  Stephan Epstein for reporting this one).
- Activated detection of radio channels (to avoid reports about "channels not
  being detected that used to be detected with the 'scan' utility or the
  original 'autopid' patch ;-).
- Channels with a zero VPID no longer write a PPID into channels.conf.
- Short channel names are now only stored if they actually differ from the
  full name.
- The EPG scan now scans newly found transponders together with already existing
  ones.
- The "Red" button in the "Setup/EPG" menu can now be used to force an EPG
  scan on a single DVB card system (see MANUAL for details).
- The new SVDRP command 'SCAN' can be used to force  an EPG scan on a single
  DVB card system (see MANUAL under Setup/EPG for details).
- Fixed handling PID changes in 'Transfer Mode'.
- Excess blanks in channel names read from the SDT are now removed.
- Fixed wrong parameter settings when scanning NITs for terrestrial transponders
  (thanks to Christian Tramnitz for pointing out this one).
- Fixed some out of bounds parameter settings when scanning NITs for cable
  and satellite transponders.
- Added 'libsi' include files to the 'include' directory, so that plugins can
  use them (thanks to Marcel Wiesweg).
- Now only processing NITs that contain the transponder they are actually
  broadcast on.
- Fixed setting the source type for newly detected terrestrial transponders
  (thanks to Christian Tramnitz for his support in debugging this).
2004-01-18 18:00:00 +01:00

102 lines
2.1 KiB
C

/*
* 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.5 2004/01/16 13:17:57 kls Exp $
*/
#include "font.h"
#include "tools.h"
#include "fontfix.c"
#include "fontosd.c"
#include "fontsml.c"
#include "fontfix-iso8859-5.c"
#include "fontosd-iso8859-5.c"
#include "fontsml-iso8859-5.c"
#include "fontfix-iso8859-7.c"
#include "fontosd-iso8859-7.c"
#include "fontsml-iso8859-7.c"
static void *FontData[eDvbCodeSize][eDvbFontSize] = {
{ FontOsd_iso8859_1, FontFix_iso8859_1, FontSml_iso8859_1 },
{ FontOsd_iso8859_5, FontFix_iso8859_5, FontSml_iso8859_5 },
{ FontOsd_iso8859_7, FontFix_iso8859_7, FontSml_iso8859_7 },
};
static const char *FontCode[eDvbCodeSize] = {
"iso8859-1",
"iso8859-5",
"iso8859-7",
};
eDvbCode cFont::code = code_iso8859_1;
cFont *cFont::fonts[eDvbFontSize] = { NULL };
cFont::cFont(void *Data)
{
SetData(Data);
}
void cFont::SetData(void *Data)
{
int h = ((tCharData *)Data)->height;
for (int i = 0; i < NUMCHARS; i++)
data[i] = (tCharData *)&((tPixelData *)Data)[(i < 32 ? 0 : i - 32) * (h + 2)];
}
int cFont::Width(const char *s) const
{
int w = 0;
while (s && *s)
w += Width(*s++);
return w;
}
int cFont::Height(const char *s) const
{
int h = 0;
if (s && *s)
h = Height(*s); // all characters have the same height!
return h;
}
bool cFont::SetCode(const char *Code)
{
for (int i = 0; i < eDvbCodeSize; i++) {
if (strcmp(Code, FontCode[i]) == 0) {
SetCode(eDvbCode(i));
return true;
}
}
return false;
}
void cFont::SetCode(eDvbCode Code)
{
if (code != Code) {
code = Code;
for (int i = 0; i < eDvbFontSize; i++) {
if (fonts[i])
fonts[i]->SetData(FontData[code][i]);
}
}
}
void cFont::SetFont(eDvbFont Font, void *Data)
{
delete fonts[Font];
fonts[Font] = new cFont(Data ? Data : FontData[code][Font]);
}
const cFont *cFont::GetFont(eDvbFont Font)
{
if (!fonts[Font])
SetFont(Font);
return fonts[Font];
}