문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top