|
1 | 1 | Graphics.prototype.setFont7Seg = function() { |
2 | | - return this.setFontCustom(atob("AAAAAAAAAAAACAQCAAAAAAIAd0BgMBdwAAAAAAAADuAAAB0RiMRcAAAAAiMRiLuAAAcAQCAQdwAADgiMRiIOAAAd0RiMRBwAAAAgEAgDuAAAd0RiMRdwAADgiMRiLuAAAABsAAAd0QiEQdwAADuCIRCIOAAAd0BgMBAAAAAOCIRCLuAAAd0RiMRAAAADuiEQiAAAAAd0BgMBBwAADuCAQCDuAAAdwAAAAAAAAAAAIBALuAAAdwQCAQdwAADuAIBAIAAAAd0AgEAcEAgEAdwAd0AgEAdwAADugMBgLuAAAd0QiEQcAAADgiEQiDuAAAd0AgEAAAAADgiMRiIOAAAAEAgEAdwAADuAIBALuAAAdwBAIBdwAADuAIBAIOAIBALuADuCAQCDuAAAcAQCAQdwAAAOiMRiLgAAAA=="), 32, atob("BwAAAAAAAAAAAAAAAAcCAAcHBwcHBwcHBwcEAAAAAAAABwcHBwcHBwcHBwcHCgcHBwcHBwcHBwoHBwc="), 9); |
3 | | -} |
| 2 | + return this.setFontCustom(atob("AAAAAAAAACAQAAAAIAd0BgLuAAAAAAdwAB0RiLgAAAiMRdwAcAQCDuADgiMRBwAd0RiIOAAAgEAdwAd0RiLuADgiMRdwAABsADuiEQdwAdwRCIOADugMBAAABwRCLuADuiMRAAAd0QiAAADugMBBwAdwQCDuADuAAAAAAAABALuADuCAQdwAdwBAIAADugEAcEAdwAd0AgDuADugMBdwAd0QiDgADgiEQdwAd0AgAAADgiMRBwAAEAgDuADuAIBdwAdwBALuADuAIBBwBdwAdwQCDuADgCAQdwAB0RiLgAA="), 32, atob("BQAAAAAAAAAAAAAAAAUCAAUFBQUFBQUFBQUDAAAAAAAABQUFBQUFBQUFBQUFBwUFBQUFBQUFBQcFBQU="), 9); |
| 3 | +}; |
| 4 | +/* font created with: |
| 5 | +require("sevenseg_font_tools").createFont({ |
| 6 | + img : ` |
| 7 | + aa j |
| 8 | +f b i |
| 9 | +fx b i |
| 10 | +fx b i |
| 11 | + gg |
| 12 | +ex c i |
| 13 | +ex c i |
| 14 | +e c i |
| 15 | +odd h`, |
| 16 | + width : 5, // width +1 for empty column |
| 17 | + colonWidth : 3, // width of colon |
| 18 | + doubleWidth : 7, // width for double-size (eg 'W' and 'M') |
| 19 | + height : 9, |
| 20 | + export : "alphanum" |
| 21 | +}); |
| 22 | +*/ |
4 | 23 |
|
5 | 24 |
|
6 | 25 | { // must be inside our own scope here so that when we are unloaded everything disappears |
@@ -38,7 +57,7 @@ let clockInfoDraw = (itm, info, options) => { |
38 | 57 |
|
39 | 58 | if (info.img) g.drawImage(info.img, options.x+2, options.y+2); |
40 | 59 | var title = clockInfoItems[options.menuA].name; |
41 | | - var text = info.text.toString().toUpperCase().replace(/[^A-Z0-9]/g, ""); |
| 60 | + var text = info.text.toString().toUpperCase().replace(/[^A-Z0-9-.]/g, ""); |
42 | 61 | if (title!="Bangle") g.setFontAlign(1,0).drawString(title.toUpperCase(), options.x+options.w-2, options.y+14); |
43 | 62 | if (g.setFont("7Seg:2").stringWidth(text)+8>options.w) g.setFont("7Seg"); |
44 | 63 | g.setFontAlign(0,0).drawString(text, options.x+options.w/2, options.y+40); |
@@ -83,3 +102,5 @@ let clockInfoItems = require("clock_info").load(); |
83 | 102 | 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}); |
84 | 103 | 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}); |
85 | 104 | } |
| 105 | + |
| 106 | + |
0 commit comments