# HG changeset patch # User Ideenmodellierer # Date 1598290768 -7200 # Node ID 2ffee0811ad9fbab4f36856e36e2a24c77272cdd # Parent 0d2449e9d6597ca9443aa6c50809492040993a28 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 0d2449e9d659 -r 2ffee0811ad9 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) {