diff Discovery/Src/t7.c @ 481:89f6857276f8 Improve_Button_Sleep

Bugfix calculation of string center position: Strings shown on the right side at surface mode use special characters ('\016' and '\017') to switch font size. Headline strings like "Desaturation" could also be set to the target font directly, because they do not contain mixed font sizes, but nethertheless they are using the special characters. The function calculating the offset needed to display the strinter with center alignment did not consider the small font size => misalignment during string display. To avoid this an evaluation of the special characters has been added to the helper function.
author ideenmodellierer
date Mon, 18 May 2020 21:51:08 +0200
parents 5e6a612d03b5
children fa8b09544b3d
line wrap: on
line diff
--- a/Discovery/Src/t7.c	Wed May 13 21:56:35 2020 +0200
+++ b/Discovery/Src/t7.c	Mon May 18 21:51:08 2020 +0200
@@ -789,16 +789,18 @@
     {
         text[0] = '\001';
         text[1] = '\004';
-        text[2] = TXT_2BYTE;
-        text[3] = TXT2BYTE_Sunday;
-        text[4] = 0;
+        text[2] = '\016';
+        text[3] = '\016';
+        text[4] = TXT_2BYTE;
+        text[5] = TXT2BYTE_Sunday;
+        text[6] = 0;
         if(Sdate.WeekDay != RTC_WEEKDAY_SUNDAY)
-            text[3] += Sdate.WeekDay;
+            text[5] += Sdate.WeekDay;
 
         if(!(Stime.Seconds % 2) && (dateNotSet == 1))
             text[1] = '\021';
 
-        GFX_write_string(&FontT24,&t7surfaceR,text,4);
+        GFX_write_string(&FontT48,&t7surfaceR,text,4);
     }
 
     /* DEBUG uTick Pressure and Compass */