PDA

View Full Version : Font size



Xarxus
January 8th, 2023, 17:37
Is there a way to know the size of a font whose name you know?
<font name="narratorfont">
<ttf file="graphics/fonts/Noto_Sans/NotoSans-Bold.ttf" name="Noto Sans Bold" size="16" />
<color value="#261A12" />
</font>


For example, in the code shown narratorfont has the size 16. I can set a font in a control with setFont(myFont), but what if I need to know its size to better organize my view?

Moon Wizard
January 9th, 2023, 00:59
No, there is no API for that information. Though, it is general practice for layered rulesets and extensions to override fonts with the same size fonts for best compatibility with themes and more. So, just assume that if you are using a predefined font, then it is the size defined in CoreRPG.

Regards,
JPG