mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
fontrenderer: remove '\n' handling
'\n' in a text was not working correctly - it did not reset the
X position correctly and it did jump out of the assigned box.
Visible errors were e.g. on epgplus, 13.0E SF1, where the short
description often contains '\n' and thus garbage was painted
below the epgplus window (and did not get cleared afterwards).
For now we replace '\n' with '¶' (0x00b6). Later, if no offenders
are found, it should simply be removed.
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@872 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Commit: b666fab10b
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2010-10-31 (Sun, 31 Oct 2010)
This commit is contained in:
@@ -471,17 +471,25 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u
|
||||
for (; *text; text++)
|
||||
{
|
||||
FTC_SBit glyph;
|
||||
if (*text=='\n')
|
||||
{
|
||||
x = left;
|
||||
y += step_y;
|
||||
}
|
||||
|
||||
int unicode_value = UTF8ToUnicode(text, utf8_encoded);
|
||||
|
||||
if (unicode_value == -1)
|
||||
break;
|
||||
|
||||
if (*text=='\n')
|
||||
{
|
||||
/* a '\n' in the text is basically an error, it should not have come
|
||||
until here. To find the offenders, we replace it with a paragraph
|
||||
marker */
|
||||
unicode_value = 0x00b6; /* ¶ PILCROW SIGN */
|
||||
/* this did not work anyway - pen1 overrides x value down below :-)
|
||||
and there are no checks that we don't leave our assigned box
|
||||
x = left;
|
||||
y += step_y;
|
||||
*/
|
||||
}
|
||||
|
||||
int index = FT_Get_Char_Index(face, unicode_value);
|
||||
|
||||
if (!index)
|
||||
|
Reference in New Issue
Block a user