From 6b4f0ad178cefe2a62c927b3aec51f76e1f52d26 Mon Sep 17 00:00:00 2001 From: seife Date: Sat, 30 Jan 2010 14:09:10 +0000 Subject: [PATCH] fontrenderer: do not paint background color do not paint the background color, making the font "transparent" this works around display problems in e.g. streaminfo, because the "wrong" background color is used git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@224 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/driver/fontrenderer.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index c86e7b71e..2b38a9632 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -525,7 +525,10 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u /* not nice (and also slower), but currently the easiest way to prevent visible errors */ frameBuffer->paintPixel(x + glyph->left + ax, y - glyph->top + ay, colors[*s++]); #else - *td++= colors[*s++]; + /* do not paint the backgroundcolor, see below */ + if (colors[*s] != bgcolor) + *td = colors[*s]; + td++; s++; #endif } else @@ -549,7 +552,13 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u #ifdef USE_NEVIS_GXA frameBuffer->paintPixel(x + glyph->left + ax, y - glyph->top + ay, colors[lcolor]); #else - *td++= colors[lcolor]; + /* we make the font "transparent" by not painting the background color + colored boxes are painted beneath the fonts anyway + note that this is not totally correct, because of subpixel hinting etc, + but that should be barely visible in reality ;) */ + if (colors[lcolor] != bgcolor) + *td = colors[lcolor]; + td++; #endif s++; }