Get the cap height with Pango metrics

I needs some help on this, the question is in the title pretty much.
How can I compute the cap height of my Pango font?


PangoFontMetrics doesn’t have a field for this.

But you can use harfbuzz api to get it.

Thanks for the tip Matthias.

I believe to have found a solution to estimate it using pure Pango API.
That is to calculate the ink extents of the “M” character, and take the height as the result.

While I’m not sure how well this works over a wide range of fonts, it did the trick in the cases I tested.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.