# HG changeset patch # User Ideenmodellierer # Date 1598290768 -7200 # Node ID d78c48552f23d914c51f16026616a6a6555e16e7 # Parent b560e474e3190d31c40e61c487088704f919276c Bugfix right alignment of dualfont strings Dualfonts support the change of font size after a '.' or ':'. The function realizing this did not consider the font change in the calculation of the string screen size causing a misalignment. An existing indicator for the fontchange is used to avoid this problem now. diff -r b560e474e319 -r d78c48552f23 Discovery/Src/gfx_engine.c --- a/Discovery/Src/gfx_engine.c Mon Aug 24 19:36:18 2020 +0200 +++ b/Discovery/Src/gfx_engine.c Mon Aug 24 19:39:28 2020 +0200 @@ -3219,6 +3219,7 @@ if((font == &FontT144) && (*(char*)pText == '.')) { font = (tFont *)&FontT84; + tinyState = 2; } else if((font == &FontT105) && (*(char*)pText == '\16')) // two times to start tiny font @@ -3229,9 +3230,10 @@ font = (tFont *)&FontT54; } else - if((font == &FontT105) && cfg->dualFont && ((*(char*)pText == '.') || (*(char*)pText == ':'))) + if((font == &FontT105) && cfg->dualFont && ((*(char*)pText == '.') || (*(char*)pText == ':'))) /* Display character after '.' or ':' using smaller font */ { font = (tFont *)&FontT54; + tinyState = 2; } if(*(char*)pText == ' ') @@ -3250,7 +3252,7 @@ { decodeUTF8 = *(char*)pText; } - for(i=0;ilength;i++) + for(i=0;ilength;i++) /* lookup character and add width */ { if(font->chars[i].code == decodeUTF8) {