FontInstance:SetFont

From Warcraft Wiki
Jump to navigation Jump to search

Sets the font instance's basic font properties.

success = FontInstance:SetFont(fontFile, height, flags)

Arguments

fontFile
string - Path to the font file.
height
number : uiFontHeight - Size in points.
flags
string : TBFFlagsOUTLINE, THICK, MONOCHROME - Any comma-separated combination of flags; otherwise must be at least an empty string (except for FontString objects).
Flag Description
MONOCHROME Font is rendered without antialiasing
OUTLINE Font is displayed with a black outline
THICK Font is displayed with a thick black outline

Returns

success
boolean? - True if fontFile refers to a valid font, otherwise returns nil.

Example

myFontString:SetFont("Fonts\\FRIZQT__.TTF", 11, "OUTLINE, MONOCHROME")

Patch changes

Dragonflight Patch 10.0.0 (2022-10-25): The flags parameter is no longer optional.