# HG changeset patch # User Ideenmodellierer # Date 1605467539 -3600 # Node ID 7b56d4eda6958bc7f03ba44cc296987bccfe2b57 # Parent 5e0a75e2f00b6828592428f517258783ad4a3c1f Bugfix center / right alignment if dualfont is used: The implementation of the dualfont effects on string screen sizes was different and the center function did not consider this feature at all. Changed implementation for both functions to behalf the same way. diff -r 5e0a75e2f00b -r 7b56d4eda695 Discovery/Src/gfx_engine.c --- a/Discovery/Src/gfx_engine.c Sun Nov 15 20:09:31 2020 +0100 +++ b/Discovery/Src/gfx_engine.c Sun Nov 15 20:12:19 2020 +0100 @@ -3102,6 +3102,7 @@ pText = (uint32_t)&cText[0]; Xsum = 0; j = 0; + ptargetFont = (tFont *)cfg->font; while (*(char*)pText != 0)// und fehlend: Abfrage window / image size { if(*(char*)pText == '\016') /* request font change */ @@ -3112,6 +3113,12 @@ { tinyState = 0; } + + if((ptargetFont == &FontT105) && ((*(char*)pText == '.') || (*(char*)pText == ':'))) + { + tinyState++; + } + if(tinyState > 1) { ptargetFont = (tFont *)cfg->TinyFont; @@ -3206,6 +3213,16 @@ { tinyState = 0; } + + if((font == &FontT144) && (*(char*)pText == '.')) + { + tinyState++; + } + if((font == &FontT105) && ((*(char*)pText == '.') || (*(char*)pText == ':'))) + { + tinyState++; + } + if(tinyState > 1) { font = (tFont *)cfg->TinyFont; @@ -3215,27 +3232,6 @@ font = (tFont *)cfg->font; } - - if((font == &FontT144) && (*(char*)pText == '.')) - { - font = (tFont *)&FontT84; - tinyState = 2; - } - else - if((font == &FontT105) && (*(char*)pText == '\16')) // two times to start tiny font - { - if(!setToTinyFont) - setToTinyFont = 1; - else - font = (tFont *)&FontT54; - } - else - if((font == &FontT105) && cfg->dualFont && ((*(char*)pText == '.') || (*(char*)pText == ':'))) /* Display character after '.' or ':' using smaller font */ - { - font = (tFont *)&FontT54; - tinyState = 2; - } - if(*(char*)pText == ' ') { Xsum += font->spacesize;