Font Height Weirdness

I'm implementing a dynamic font height function that adjusts the font height to the available field height. Pretty basic idea. Except, it isn't. Sad.

In the example below the first number (26 or 25) is the available height (depends on where the field is placed on the screen). (dc.getHeight()/2).toNumber()

The 2nd number (36) is the reported font height. dc.getFontHeight(4).

The 3rd number is the reported actual TEXT height. dc.getTextDimensions(msgText,4)[1]. Apparently that function is broken - it simply returns the font height, not the height of the text string. In this case, the text string (a number) is really 25 pixels tall, but it is reported as 36 pixels tall.

So, my questions are:

1. Is there a function to report the true height of a text string (not the font height)?

2. If not, for text with no "descender characters", do you have any tips on how to code a correction factor for the true string height? I bet it depends on the device and the font. On an Edge 520, for example, a Font 4 numeric string is 11 pixels shorter than reported.

It seems I'd need to develop a table for EVERY Garmin device and each Font, with a unique correction factor. What a pain! And since I don't own every device, I'd have to trust that the simulator accurately represents the real-life device fonts, which we know has been problematic in the past.

My initial thought is to take the Font Height, subtract a fixed amount (say, 4, to account for the white space above/below), and the multiply by, say, 80%, to account for the fact that there are no descenders in my string.