From eebfdf1a3d737db58e6d2d3c6945584dd5e5054f Mon Sep 17 00:00:00 2001 From: Andreas Mair Date: Mon, 5 Apr 2010 12:31:58 +0200 Subject: 2010-04-05: Version 0.1.1 - Moved "General / Show progressbar" to "Logos & Symbols / Show progressbar in lists". - Fixed gcc 4.3 compiler warnings. - Show "Parental Rating" and "Contents" in EPG and recording details (requires at least VDR 1.7.11). - Show estimated bitrate and recording format (TS/PES) in recording's details. - Show subtitle tracks in EPG and recording details. - Changed defaults for setup options. - Don't define CLEAR_BUG_WORKAROUND by default. - Added new setup option "Colored status symbols in EPG details". - Added new theme "bgw" (Submitted by jlacvdr @gmail.com). - Added new setup option "Round corners". - Display cut length and size of recordings in recording's details (based on skinelchi-0.2.1). - Fixed calculation of channel info OSD areas. - Check for valid OSD width and height and font size and width. - Added VDR's default fonts to the TrueTypeFont selector. - Unselectable rows in menu OSD starting with "---" will be formated as headlines if "Show symbols in lists" is set. - New "elapsed/remaining" option for "Show remaining/elapsed time" setting. - New "active only" option for "Show status symbols" setting. - Added setup option for minimal info area width. - Restructured setup menu. --- font.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'font.c') diff --git a/font.c b/font.c index 25d8e66..29fd5df 100644 --- a/font.c +++ b/font.c @@ -26,20 +26,26 @@ const cFont* cGraphtftFont::GetFont(const char *Filename, int Size, int Width) if (Filename == NULL) return NULL; + if (Size < MINFONTSIZE) + Size = MINFONTSIZE; + if (Width == 0) + Width = 100; + char *cachename = NULL; - asprintf(&cachename, "%s_%d_%d", Filename, Size, Width); - string CacheName = cachename; - free(cachename); - cachename = NULL; - - if (_cache.find(CacheName) != _cache.end()) - return _cache[CacheName]; - - debug("cGraphtftFont::Load() CREATING FONT %s size=%d width=%d", Filename, Size, Width); - cFont *newFont = cFont::CreateFont(Filename, Size, Width > 0 ? (Size * Width / 100) : 0); - if (newFont) { - _cache[CacheName] = newFont; - return newFont; + if (-1 != asprintf(&cachename, "%s_%d_%d", Filename, Size, Width)) { + string CacheName = cachename; + free(cachename); + cachename = NULL; + + if (_cache.find(CacheName) != _cache.end()) + return _cache[CacheName]; + + debug("cGraphtftFont::Load() CREATING FONT %s size=%d width=%d", Filename, Size, Width); + cFont *newFont = cFont::CreateFont(Filename, Size, Width > 0 ? (Size * Width / 100) : 0); + if (newFont) { + _cache[CacheName] = newFont; + return newFont; + } } error("ERROR: EnigmaNG: Couldn't load font %s:%d", Filename, Size); -- cgit v1.2.3