WoW:API FontInstance GetFont: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Move page script moved page API FontInstance GetFont to API FontInstance GetFont without leaving a redirect) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{widgetmethod}} | {{widgetmethod|FontInstance}} | ||
Returns detailed information on a font object | Returns detailed information on a font object | ||
Line 5: | Line 5: | ||
fontName, fontHeight, fontFlags = MyFontObject:GetFont() | fontName, fontHeight, fontFlags = MyFontObject:GetFont() | ||
== Returns == | == Returns == | ||
:;fontName: String - path to font file | :;fontName | ||
:;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 | :: String - path to font file | ||
:;fontFlags: String - See [[API FontInstance SetFont|FontInstance:SetFont]](). | :;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 [[API FontInstance SetFont|FontInstance:SetFont]](). | |||
== Example == | == Example == |
Latest revision as of 04:45, 15 August 2023
← Widget API ← FontInstance < GetFont
Returns detailed information on a font object
fontName, fontHeight, fontFlags = MyFontObject:GetFont()
Returns[edit]
- 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().
Example[edit]
print(GameFontNormal:GetFont()); > "Fonts\FRIZQT__.TTF" > 12.000000298023 > ""
Notes[edit]
To get an integer font height, simply do math.floor(fontHeight+0.5);