From 0872cba0a10c1350e6f694ea2296947428a97326 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 2 Mar 2008 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.5.17=20-=20Updated=20the=20Swedish=20OSD=20?= =?UTF-8?q?texts=20(thanks=20to=20Tomas=20Berglund).=20-=20Made=20the=20'p?= =?UTF-8?q?ic2mpg'=20script=20of=20the=20'pictures'=20plugin=20work=20with?= =?UTF-8?q?=20uppercase=20filename=20=20=20extensions=20and=20relative=20p?= =?UTF-8?q?aths=20(thanks=20to=20Stefan=20Wagner=20for=20reporting=20this?= =?UTF-8?q?=20one).=20-=20Updated=20the=20Romanian=20OSD=20texts=20(thanks?= =?UTF-8?q?=20to=20Lucian=20Muresan).=20-=20Updated=20the=20Dutch=20OSD=20?= =?UTF-8?q?texts=20(thanks=20to=20Johan=20Schuring).=20-=20Stripping=20con?= =?UTF-8?q?trol=20codes=200x86=20and=200x87=20from=20SI=20strings.=20-=20U?= =?UTF-8?q?pdated=20French=20language=20texts=20(thanks=20to=20Jean-Claude?= =?UTF-8?q?=20Repetto).=20-=20Fixed=20handling=203=20and=204=20byte=20UTF-?= =?UTF-8?q?8=20symbols=20in=20Utf8CharGet()=20(thanks=20to=20Andreas=20=20?= =?UTF-8?q?=20Mair).=20-=20Fixed=20a=20crash=20in=20cFreetypeFont::DrawTex?= =?UTF-8?q?t()=20if=20an=20unknown=20symbol=20is=20encountered=20=20=20(th?= =?UTF-8?q?anks=20to=20Tobias=20Grimm).=20Unknown=20symbols=20are=20replac?= =?UTF-8?q?ed=20with=20a=20'=3F'.=20-=20Updated=20the=20Slovenian=20OSD=20?= =?UTF-8?q?texts=20(thanks=20to=20Matjaz=20Thaler).=20-=20Updated=20the=20?= =?UTF-8?q?Czech=20OSD=20texts=20(thanks=20to=20Vladim=C3=ADr=20B=C3=A1rta?= =?UTF-8?q?=20and=20Jiri=20Dobry).=20-=20Updated=20the=20Turkish=20OSD=20t?= =?UTF-8?q?exts=20(thanks=20to=20Oktay=20Yolge=C3=A7en).=20-=20The=20'plug?= =?UTF-8?q?ins'=20target=20in=20the=20Makefile=20now=20returns=20an=20erro?= =?UTF-8?q?r=20exit=20code=20if=20one=20of=20the=20=20=20plugins=20failed?= =?UTF-8?q?=20to=20compile=20(suggested=20by=20Tobias=20Grimm).=20-=20Rend?= =?UTF-8?q?ering=20the=20non-breaking=20space=20symbol=20as=20a=20blank=20?= =?UTF-8?q?(thanks=20to=20Tobias=20Grimm).=20-=20Changed=20the=20default?= =?UTF-8?q?=20character=20set=20for=20SI=20data=20from=20ISO6937=20(as=20r?= =?UTF-8?q?equired=20by=20the=20DVB=20=20=20standard=20ETSI=20EN=20300=204?= =?UTF-8?q?68)=20to=20ISO-8859-9,=20in=20order=20to=20work=20around=20the?= =?UTF-8?q?=20stupidity=20of=20=20=20some=20providers,=20who=20actually=20?= =?UTF-8?q?use=20ISO-8859-9,=20but=20fail=20to=20correctly=20announce=20th?= =?UTF-8?q?at.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- font.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'font.c') diff --git a/font.c b/font.c index 2f14d14..b458e89 100644 --- a/font.c +++ b/font.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: font.c 1.23 2008/02/09 11:52:25 kls Exp $ + * $Id: font.c 1.25 2008/03/01 10:19:41 kls Exp $ */ #include "font.h" @@ -184,6 +184,10 @@ int cFreetypeFont::Kerning(cGlyph *Glyph, uint PrevSym) const cGlyph* cFreetypeFont::Glyph(uint CharCode, bool AntiAliased) const { + // Non-breaking space: + if (CharCode == 0xA0) + CharCode = 0x20; + // Lookup in cache: cList *glyphCache = AntiAliased ? &glyphCacheAntiAliased : &glyphCacheMonochrome; for (cGlyph *g = glyphCache->First(); g; g = glyphCache->Next(g)) { @@ -214,6 +218,9 @@ cGlyph* cFreetypeFont::Glyph(uint CharCode, bool AntiAliased) const return Glyph; } } +#define UNKNOWN_GLYPH_INDICATOR '?' + if (CharCode != UNKNOWN_GLYPH_INDICATOR) + return Glyph(UNKNOWN_GLYPH_INDICATOR, AntiAliased); return NULL; } @@ -258,6 +265,8 @@ void cFreetypeFont::DrawText(cBitmap *Bitmap, int x, int y, const char *s, tColo uint sym = Utf8CharGet(s, sl); s += sl; cGlyph *g = Glyph(sym, AntiAliased); + if (!g) + continue; int kerning = Kerning(g, prevSym); prevSym = sym; uchar *buffer = g->Bitmap(); -- cgit v1.2.3