From f3db296830b657cfd438689385f4d149e723c1b0 Mon Sep 17 00:00:00 2001 From: Freubert <46076489+Freubert@users.noreply.github.com> Date: Fri, 27 Sep 2024 10:59:31 +0200 Subject: [PATCH 1/6] remove special chars for 7seg font --- apps/lcdclockplus/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/lcdclockplus/app.js b/apps/lcdclockplus/app.js index 4bf48b585..d5cad352d 100644 --- a/apps/lcdclockplus/app.js +++ b/apps/lcdclockplus/app.js @@ -51,7 +51,7 @@ let clockInfoDraw = (itm, info, options) => { if (info.img) { g.drawImage(info.img, options.x+1,options.y+2); } - var text = info.text.toString().toUpperCase(); + var text = info.text.toString().toUpperCase().replace(/[^A-Z0-9]/g, ""); if (g.setFont("7Seg:2").stringWidth(text)+24-2>options.w) g.setFont("7Seg"); g.setFontAlign(0,-1).drawString(text, options.x+options.w/2+13, options.y+6); }; From a0459c06b451a7dc5a8816858544bddee9dc86b2 Mon Sep 17 00:00:00 2001 From: Freubert <46076489+Freubert@users.noreply.github.com> Date: Fri, 27 Sep 2024 11:00:23 +0200 Subject: [PATCH 2/6] remove special chars for 7seg font --- apps/lcdclock/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/lcdclock/app.js b/apps/lcdclock/app.js index 77e1afdf0..bf0ea83e9 100644 --- a/apps/lcdclock/app.js +++ b/apps/lcdclock/app.js @@ -38,7 +38,7 @@ let clockInfoDraw = (itm, info, options) => { if (info.img) g.drawImage(info.img, options.x+2, options.y+2); var title = clockInfoItems[options.menuA].name; - var text = info.text.toString().toUpperCase(); + var text = info.text.toString().toUpperCase().replace(/[^A-Z0-9]/g, ""); if (title!="Bangle") g.setFontAlign(1,0).drawString(title.toUpperCase(), options.x+options.w-2, options.y+14); if (g.setFont("7Seg:2").stringWidth(text)+8>options.w) g.setFont("7Seg"); g.setFontAlign(0,0).drawString(text, options.x+options.w/2, options.y+40); @@ -82,4 +82,4 @@ Bangle.drawWidgets(); let clockInfoItems = require("clock_info").load(); let clockInfoMenu = require("clock_info").addInteractive(clockInfoItems, { app:"lcdclock", x:R.x, y:R.y, w:midX-2, h:barY-R.y-2, draw : clockInfoDraw}); let clockInfoMenu2 = require("clock_info").addInteractive(clockInfoItems, { app:"lcdclock", x:midX+2, y:R.y, w:midX-3, h:barY-R.y-2, draw : clockInfoDraw}); -} \ No newline at end of file +} From c2699a02b17bd833d52f1a684425db34704cf858 Mon Sep 17 00:00:00 2001 From: Freubert <46076489+Freubert@users.noreply.github.com> Date: Fri, 27 Sep 2024 13:56:39 +0200 Subject: [PATCH 3/6] Bump app version --- apps/lcdclock/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/lcdclock/ChangeLog b/apps/lcdclock/ChangeLog index df68cb17e..4b9e4ebc1 100644 --- a/apps/lcdclock/ChangeLog +++ b/apps/lcdclock/ChangeLog @@ -4,3 +4,4 @@ 0.04: clock_info is loaded before widgets to match other clocks 0.05: fix alignment of clock items caused by 0.04 (fix #2970) 0.06: Minor code improvements +0.07: fix special characters in clockinfo menus From 2bafbf394ed32844da6fe1db06a6a2ea959ecedd Mon Sep 17 00:00:00 2001 From: Freubert <46076489+Freubert@users.noreply.github.com> Date: Fri, 27 Sep 2024 13:57:49 +0200 Subject: [PATCH 4/6] Bump app version --- apps/lcdclock/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/lcdclock/metadata.json b/apps/lcdclock/metadata.json index d1ab47d8a..5413a8f2f 100644 --- a/apps/lcdclock/metadata.json +++ b/apps/lcdclock/metadata.json @@ -1,6 +1,6 @@ { "id": "lcdclock", "name": "LCD Clock", - "version": "0.06", + "version": "0.07", "description": "A Casio-style clock, with ClockInfo areas at the top and bottom. Tap them and swipe up/down to toggle between different information", "icon": "app.png", "screenshots": [{"url":"screenshot.png"}], From cfd5755286deeaf829e3e83f63ab53dc1f39976f Mon Sep 17 00:00:00 2001 From: Freubert <46076489+Freubert@users.noreply.github.com> Date: Fri, 27 Sep 2024 14:01:34 +0200 Subject: [PATCH 5/6] Bump app version --- apps/lcdclockplus/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/lcdclockplus/ChangeLog b/apps/lcdclockplus/ChangeLog index 7727f3cc4..1348999aa 100644 --- a/apps/lcdclockplus/ChangeLog +++ b/apps/lcdclockplus/ChangeLog @@ -1,2 +1,3 @@ 0.01: New App! 0.02: Minor code improvements +0.03: fix special characters in clockinfo menus From b6296b22c15c304a8c6303ba2b41be40ce24377a Mon Sep 17 00:00:00 2001 From: Freubert <46076489+Freubert@users.noreply.github.com> Date: Fri, 27 Sep 2024 14:02:06 +0200 Subject: [PATCH 6/6] Bump app version --- apps/lcdclockplus/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/lcdclockplus/metadata.json b/apps/lcdclockplus/metadata.json index a25d5e6d5..b0187f800 100644 --- a/apps/lcdclockplus/metadata.json +++ b/apps/lcdclockplus/metadata.json @@ -1,6 +1,6 @@ { "id": "lcdclockplus", "name": "LCD Clock Plus", - "version": "0.02", + "version": "0.03", "description": "A Casio-style clock, with four ClockInfo areas at the top and bottom. Tap them and swipe up/down and left/right to toggle between different information.", "icon": "app.png", "screenshots": [{"url":"screenshot.png"},{"url":"screenshot2.png"}],