Widget API: FontInstance:GetFont

Revision as of 04:45, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page API FontInstance GetFont to API FontInstance GetFont without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Widget API ← FontInstance < GetFont

Returns detailed information on a font object

fontName, fontHeight, fontFlags = MyFontObject:GetFont()

ReturnsEdit

fontName
String - path to font file
fontHeight
Number - font height in pixels. Due to internal graphics engine workings, this will be ridiculously close to an integer number, but not quite ever fully
fontFlags
String - See FontInstance:SetFont().

ExampleEdit

print(GameFontNormal:GetFont());

> "Fonts\FRIZQT__.TTF"
> 12.000000298023
> ""

NotesEdit

To get an integer font height, simply do math.floor(fontHeight+0.5);