Just venting.... What a pain. In this example, I want to determine the vertical space between the top of the central Power metric and the bottom of the inner arc. The white space so I can add a GRADE metric centered in the available space.
The issue is that different devices place fonts in different locations vertically. This varies by device, and even varies between Numeric Fonts (font # 5-8) and Text Fonts. For example, the 1050 and some others vertically center numeric font, leaving more whitespace above the top of the value like you see on the left. But many EDGE devices place the numeric fonts near the top of the fontHeight region like you see on the right. So the only way I know of to determine the whitespace is a complicated function that takes into account the specific product type, the string that is being rendered (does it have ascenders/descenders, the font being rendered (LARGE, THAI_MEDIUM, etc), and then return the vertical skew from font center to the actual top of the rendered text. Ugh. And hope the simulator actually performs the same rendering as the physical device so my code properly handles all these inconsistencies.
Ok, vent over.