Question

I'm looking for a way to programatically find the ascent and descent values of the current (truetype) font in Codename one. The codename one Graphics class doesn't have a getFontMetrics() method.

Text width can be determined by using Graphics.stringWidth(text), height can be queried from the Font object. But there doesn't seem to be a way to determine ascent and descent values.

Can anybody help?

Was it helpful?

Solution

Ascent/descent values were very hard to codify across platforms so we codified that into a single height value which includes the entire height.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top