From 40650ddcf7b4142790b786e50f315dade90e8678 Mon Sep 17 00:00:00 2001 From: Andreas Mair Date: Mon, 2 Jul 2007 12:12:06 +0200 Subject: 2007-07-02: Version 0.0.5 - Reworked font handling in menu OSD a little bit to (hopefully) fix crashes with plugins that patch fonts. - Updated Nederlands translation (Provided by dorpsgek @vdr-portal.de). - Don't make info area in mainmenu too small (Requested by vdrchuck @vdr-portal.de). - Save and restore TTF FixedFont (Reported by zulu @vdr-portal.de). - Updated Italian translation (Provided by Gringo). - Updated French translation (Provided by Pat @vdr-portal.de). --- config.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'config.c') diff --git a/config.c b/config.c index 62b33cf..3d96fc3 100644 --- a/config.c +++ b/config.c @@ -48,7 +48,7 @@ FontConfig allFontConfig[FONT_NUMFONTS] = { FONT_DETAILSDATE, "FontDetailsDate", "FontDetailsDateName" }, { FONT_DETAILSTEXT, "FontDetailsText", "FontDetailsTextName" }, { FONT_REPLAYTIMES, "FontReplayTimes", "FontReplayTimesName" }, - { FONT_FIXED, "FontFixed", "FontFixed" } + { FONT_FIXED, "FontFixed", "FontFixedName" } }; cEnigmaConfig::cEnigmaConfig() : showAuxInfo(1), showLogo(1), showVps(1), showSymbols(1), @@ -130,11 +130,13 @@ void cEnigmaConfig::SetFontsDir(const char *dir) } #endif -const cFont *cEnigmaConfig::GetFont(int id) +const cFont *cEnigmaConfig::GetFont(int id, const cFont *pFontCur) { const cFont *res = NULL; if (::Setup.UseSmallFont == 1) { // if "Use small font" == "skin dependent" if (allFonts[id].VdrId == FONT_TRUETYPE) { + if (pFontCur) // TTFs can't get patched, so it's always save to return the previous pointer + return pFontCur; if (!isempty(allFonts[id].Name)) { #ifdef HAVE_FREETYPE char *cachename; @@ -170,7 +172,7 @@ void cEnigmaConfig::SetFont(int id, const char *font) if (id >= 0 && id < FONT_NUMFONTS && font) { char *tmp = strrchr(font, ':'); if (tmp) { - strncpy(allFonts[id].Name, font, std::min((int)sizeof(allFonts[id].Name), tmp - font)); + strncpy(allFonts[id].Name, font, std::min((int)sizeof(allFonts[id].Name), (int)(tmp - font))); allFonts[id].Size = atoi(tmp + 1); tmp = strchr(tmp + 1, ','); if (tmp) { -- cgit v1.2.3