comparison Discovery/Src/gfx_engine.c @ 485:7a17bfc932b6 FixLayout_Header_LogView

Bugfix right alignment of string: Size calculation did not consider "tiny" displayed characters as used for example for units => added code to identify small font and adapt calculation
author ideenmodellierer
date Tue, 26 May 2020 21:13:00 +0200
parents 89f6857276f8
children d78c48552f23
comparison
equal deleted inserted replaced
484:eea282e733e8 485:7a17bfc932b6
3173 tFont *font; 3173 tFont *font;
3174 uint8_t gfx_selected_language; 3174 uint8_t gfx_selected_language;
3175 uint32_t pText; 3175 uint32_t pText;
3176 uint8_t setToTinyFont = 0; 3176 uint8_t setToTinyFont = 0;
3177 uint16_t decodeUTF8; 3177 uint16_t decodeUTF8;
3178 uint8_t tinyState = 0; /* used to identify the usage of tiny font */
3178 3179
3179 #ifndef BOOTLOADER_STANDALONE 3180 #ifndef BOOTLOADER_STANDALONE
3180 SSettings *pSettings; 3181 SSettings *pSettings;
3181 pSettings = settingsGetPointer(); 3182 pSettings = settingsGetPointer();
3182 gfx_selected_language = pSettings->selected_language; 3183 gfx_selected_language = pSettings->selected_language;
3195 Xsum = 0; 3196 Xsum = 0;
3196 j = 0; 3197 j = 0;
3197 3198
3198 while (*(char*)pText != 0)// und fehlend: Abfrage window / image size 3199 while (*(char*)pText != 0)// und fehlend: Abfrage window / image size
3199 { 3200 {
3201 if(*(char*)pText == '\016') /* request font change */
3202 {
3203 tinyState++;
3204 }
3205 if(*(char*)pText == '\017') /* request font reset */
3206 {
3207 tinyState = 0;
3208 }
3209 if(tinyState > 1)
3210 {
3211 font = (tFont *)cfg->TinyFont;
3212 }
3213 else
3214 {
3215 font = (tFont *)cfg->font;
3216 }
3217
3218
3200 if((font == &FontT144) && (*(char*)pText == '.')) 3219 if((font == &FontT144) && (*(char*)pText == '.'))
3201 { 3220 {
3202 font = (tFont *)&FontT84; 3221 font = (tFont *)&FontT84;
3203 } 3222 }
3204 else 3223 else