Skip to content

Commit

Permalink
remove special chars for 7seg font
Browse files Browse the repository at this point in the history
  • Loading branch information
Freubert committed Sep 27, 2024
1 parent f3db296 commit a0459c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/lcdclock/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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});
}
}

0 comments on commit a0459c0

Please sign in to comment.