remove special chars for 7seg font

pull/3592/head
Freubert 2024-09-27 10:59:31 +02:00 committed by GitHub
parent 2834c72e2e
commit f3db296830
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ let clockInfoDraw = (itm, info, options) => {
if (info.img) { if (info.img) {
g.drawImage(info.img, options.x+1,options.y+2); 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"); 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); g.setFontAlign(0,-1).drawString(text, options.x+options.w/2+13, options.y+6);
}; };