Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:LabelGetFont

From RoR Wiki

UI Lua API · Label functions
Version: WAR 1.4.8

Returns the name of the font used by a Label.

fontName = LabelGetFont(labelName)

Arguments

labelName
string – Name of a Label window.

Returns

fontName
string – Name of the label's font, for example "font_default_text". An empty string if the label has no font.

Details

  • The name is the one used with the font attribute in XML and with LabelSetFont.
  • The stock UI never calls LabelGetFont.

Errors

  • Error in function call 'LabelGetFont': Window %s does not exist
  • Error in function call 'LabelGetFont': Window %s is not a Label

Example

A minimal example built from the signature above:

local font = LabelGetFont( "MyLabel" )
if( font ~= "font_default_text_large" ) then
    LabelSetFont( "MyLabel", "font_default_text_large", WindowUtils.FONT_DEFAULT_TEXT_LINESPACING )
end

See also