Background: I am trying to render some text using the Cambria Math font. In order to position and scale it to fit correctly I need to measure the text. However both Graphics.MeasureString and Graphics.MeasureCharacterRanges seem to return the line height of the text defined in the FontMetrics for the font, regardless of the actual text to be rendered. For example if I measure a simple single character such as "x", it is reported to be nearly 8 times as tall as it is wide.
This particular font has a very large ascent, descent and line height, presumably because it contains a few unusual symbols which are very tall. (FontMetrics.GetLineHeight is 11428 for this font, as opposed to 2318 for a random, typical font I tested. Both had GetEmHeight = 2048).
The effects of this can be seen in the Character map application in Win7: if you select the Cambria Math font, and select a character it appears as a large dot in the selection box - presumably it has been scaled to about 15% of natural size to make the theoretical line height fit the box.
The question: Is there a way to measure the actual height of a particular string, which would give me a more meaningful height in this case? In practice I won't be rendering any unusually tall characters.