How to handle number fonts vertical placement on different devices?

I have seen some threads about this but I still don't fully understand. My next task is to do something about the graphics of my app. I try to get it working on anything from FR230/Fenix3 all the way to FR965. 

I'm using the Graphics.FONT_NUMBER_MEDIUM because the large text font simply isn't large enough. But this number font is different on different devices. Up until now, i have placed everything in a layout.xml (simply because the tutorial I started with used this). I got it somewhat goodlooking on my Fenix5Xplus, but when I looked at some other watches, it looked wrong. Below are some snippets from Fenix3, Fenix5XPlus and FR965.

Should I leave layouts.xml and strictly calculate every postion? But how? I know about TEXT_JUSTIFY_VCENTER but on some devices there are (different) spacing on the top and bottom. So dc.getFontHeight() may or may not include spacing. 

How do people do this? Special case for each device? All I want is for the three rows to fit within my two horizontal lines without interfering with each other...

  • Right now, memory is not really an issue for me. I ended up doing it like jim_m_58 does, i.e. scrap layout.xml and use the onLayout() to check height/width etc and decide what fonts, positions etc to use in various drawXXX().

    Might not be perfect, but I think it will be good enough for most cases.

  • I just posted my solution today, for EDGE devices. That same pattern would work. It is a pain. But unfortunately Garmin is not consistent in rendering VCENTERed text. It varies by device. You also need to adjust depending on if the string has descenders (numbers don't so that helps you).

  • Understand that there are also different issues.  Here for example are a couple of FONT_NUMBER fonts on a fenix5.  No white space above or below.

    And the same two on a fenix6.  They have white space.

    So you can't just use the font height for spacing and need some extra smarts.

    I posted the same earlier in this thread, but on a different page.

  • wow, this looks like a ... bug.

  • Nope.  What it is, is that the folks that do the firmware, do the fonts.  This did turn some heads when the fenix5 was introduced.  The font differences between different devices has been known since CIQ started, and why adding a new device to an app can be much more complex than checking a box and building an iq file.  The fr935 is like the fenix5. As is the fenix5 plus

    Things have improved some with newer device.

    You ever wonder why there are the FONT_SYSTEM_* fonts?  At one time, they were looking at providing access to the native fonts on a device as well as "common CIQ fonts", but that never panned out.  All that remains is the names.