Fonts / Sizes / Custom

I looked at the Fonts for the Edge 520plus. 820, 1000, and 1030. Some observations.

1. The SYSTEM fonts (9-17) are identical to fonts (0-8). Why do the SYSTEM fonts exist?
2. For the fonts 0-4, the 520plus, 820 and 1000 are the same font height and string length. Only the 1030 is larger.
3. However, number fonts 5-8, the 520plus and 820 are the same, and the 1000 and 1030 are larger and the same. So the 1000 is inconsistent.
4. The number fonts provide a + and - and / symbol, but no = or *. Interesting. Would be nice to also have a space character.

Anyway, my real question is that font 4 is a BIG jump from font 3. And, of course, I really need a font 3.5, something between those two.

How much memory does it take, and how much of a pain is it to create and use a custom font of a particular size (about 3.5)? Before I jump down that rabbit trail.

Thanks!
  • 3) If you look at all the different watch "families", each "generation" has different groups of fonts which are the same size. For some watches, the only difference between 0 and 1 is that 1 is bold and 0 is not.

    So you really can't count on any kind of consistency. If you want your UX to be perfect, you have to tailor it somewhat for every different family of devices.


    4) As far as I can tell, spaces actually work with the number fonts (*), even though simple data fields will switch to non-numeric fonts as you as you output a space. Haven't tested that on every platform, but the modern watches and Edges seem to work fine with spaces.

    (* Someone please correct me if I'm wrong. I haven't tested on every platform.)

    I've only ever created an icon font with one character. Seemed to directly take about 100 bytes in memory. However, keep in mind that as soon as you load even one resource at run time, the app loads the entire resource list, which takes up space based on the number of resources, not the size. So if you have a lot strings for your app settings, memory will be used for each of them.

    Dunno what your app is like, but is memory really an issue on Edge?

    I've only ever created a font from icons, but the process for creating a font from a pre-existing font that you got somewhere else should be even easier. Honestly it was a pain the first time.

    I got most of the following procedure from here
    https://developer.garmin.com/connect...ompiler/#fonts

    You can use FontForge and BMFont to create fonts:
    https://fontforge.github.io/en-US/
    http://www.angelcode.com/products/bmfont/

    If you have a pre-existing font, skip to step 4.

    In FontForge
    1) Create a new font
    2) Add all your characters. E.g. Import SVG files for your icons
    3) Use Generate Fonts... which exports as TTF

    4) Import the font into your OS (double-click on the TTF in Windows)

    In BMFont:
    5) In Font Options,
    5a) Select your font.
    5b) Set size in pixels

    6) In Export Options,
    6a) Set Channel A to glyph.
    6b) Set textures to PNG

    7) Click Save Bitmap Font as...
  • Thanks for the info! Yep, on an EDGE device, using Fonts 5-8 (number type), a space is rendered like other invalid characters like letters or parens or brackets, etc... as a box.

    And yes, my most feature rich full screen data field that includes Power/HR stress monitoring, and race effort analysis and feedback... Is running at 112KB right now, so I don't have a lot of headroom.

    I'd want a very standard looking font, nothing fancy with textures or anything. But a complete set so I could construct and drawText strings based on my custom font set. So maybe 75 or so characters. Besides the memory for these 75 characters, my concern is the compute demand to write a string. Would that require writing one character at a time from my set of bitmaps, dealing with spacing each letter due to the varying width. Or is there a built in feature in which the system can take a user-defined font family and then treat it like a built-in font?
  • Thanks for the info! Yep, on an EDGE device, using Fonts 5-8 (number type), a space is rendered like other invalid characters like letters or parens or brackets, etc... as a box.


    Whoops. That reminds me, I have to go fix some code....

    Besides the memory for these 75 characters, my concern is the compute demand to write a string. Would that require writing one character at a time from my set of bitmaps, dealing with spacing each letter due to the varying width. Or is there a built in feature in which the system can take a user-defined font family and then treat it like a built-in font?


    Yes, you put the font in your resources, then you load it at run-time. When you cal a draw*() function, you specify your custom font object, instead of a built-in font number. Everything works like normal.
  • One thing with fonts in the sim, you might want to move to the 3.0.7 SDK https://forums.garmin.com/forum/developers/connect-iq/connect-iq-news-announcements/1436785-connect-iq-3-0-7-sdk-now-available
    As The changelog has this:
    • Fix font sizes used by simulator to more closely match those used by devices.
    Not sure what devices or fonts, but it doesn't hurt. The only one I've really looked at is the e520, (I have one) and yes, they are much better than in the past.

    As far as what's valid in the number fonts, See Appendix B of the UX Guide. One character that's not consistent is the degree symbol for example. If I recall, there are things like a,p,n,w,s,e, in some (am/pm and directions).

    There is a speed impact of using custom fonts, but the only place I've really seen that is in onPartialUpdate with a watchface
  • As Jim says, huge improvement with fonts matching between the sim and Edge devices on 3.0.7. There are still some single pixel discrepancies, but they used to be way off.

    Fonts are actually a great way to do monochrome bitmaps (or limited colors using transparency) as they are much lower in resource consumption. Plus you can use different colors on the fly.

    Not sure if anyone answered your question about SYSTEM fonts. I don't have a definitive answer but I've never seen them be any different than 0-8.

    Different char sets for number fonts and various devices is definitely annoying. Space is a good one. For me it's the degrees symbol. And no easy way to figure out programatically which chars are there. It's a good place for using Jungles.
  • Fonts are actually a great way to do monochrome bitmaps (or limited colors using transparency) as they are much lower in resource consumption. Plus you can use different colors on the fly.



    Yep, and you get anti-aliasing, so your icons look a lot better, especially with thin lines.
  • FONT_* and FONT_SYSTEM_* are the same now for backwards compatibility. A bit of history (2016?) if I remember correctly, there was a thought of having fonts native to the fw and a common set of CIQ fonts across devices, so that's why there are the two different names for the same font. There are posts here about it back from that time, but I've not looked.