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] 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); };