You are reading a single comment by @HughB and its replies. Click here to read the full conversation.
  • Next you will want to muck about with fonts.
    Read the font tutorial but basically you need to try fronts from fonts.google.com or search for FREE true type fonts.

    I have just googled 'free square true type font'.
    This has lead me to:

    https://www.1001fonts.com/search.html?search=square
    From there I have downloaded the zip file for square head and identified the file called:
    SSFSquareHead.ttf

    Next I load that file into the font coverter at:
    https://www.espruino.com/Font+Converter

    I adjust the slider to around 30 as I want to be able to scale the font up to 90 pixels and 3x90=90.
    I click go and get the following bit for code:

    Graphics.prototype.setFontSFSquareHead = function(scale) {
      // Actual height 26 (29 - 4)
      g.setFontCustom(atob("AAAAPAAAAADwAAAAA8AAAAAPAAAAAAAAAAAAAAAAAAOAAAAAfwAAAB/8AAAH//AAAP//AAA//8AAD//4AAA//gAAAP+AAAAD8AAAAAQAAAAAAAAAAAD////AA////wAP///8AD////AA8AADwAPAAA8ADwAAPAA8AADwAPAAA8ADwAAPAA8AADwAPAAA8ADwAAPAA8AADwAPAAA8ADwAAPAA8AADwAPAAA8ADwAAPAA8AADwAPAAA8ADwAAPAA8AADwAP///8AD////AA////wAP///8AAAAAAAAAAAAAAPAAA8ADwAAPAA8AADwAPAAA8ADwAAPAA8AADwAPAAA8ADwAAPAA8AADwAPAAA8ADwAAPAA////wAP///8AD////AA////wAAAAA8AAAAAPAAAAADwAAAAA8AAAAAPAAAAADwAAAAA8AAAAAPAAAAADwAAAAA8AAAAAPAAAAADwAAAAAAAAAAAAAA8B//wAPAf/8ADwH//AA8B//wAPAeA8ADwHgPAA8B4DwAPAeA8ADwHgPAA8B4DwAPAeA8ADwHgPAA8B4DwAPAeA8ADwHgPAA8B4DwAPAeA8ADwHgPAA8B4DwAPAeA8ADwHgPAA8B4DwAPAeA8AD//gPAA//4DwAP/+A8AD//gPAAAAAAAAAAAAAADwHgPAA8B4DwAPAeA8ADwHgPAA8B4DwAPAeA8ADwHgPAA8B4DwAPAeA8ADwHgPAA8B4DwAPAeA8ADwHgPAA8B4DwAPAeA8ADwHgP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PAeA8ADwHgPAA8B4DwAPAeA8ADwHgPAA8B4DwAP///8AD////AA////wAP///8AAAAAAAAAAAAAAAAeA8AAAHgPAAAB4DwAAAeA8AAAAAAAAAAAAA"), 46, atob("BgwdHR0dHR0dHR0dBg=="), 38+(scale<<8)+(1<<16));
    }
    
    
    

    Now instead of using the Vector font I use:

    g.setFontSFSquareHead(3);
    

    Now I get a clock that will look like this:


    1 Attachment

    • download (2).png
About

Avatar for HughB @HughB started