Stanzilla / WoWUIBugs

World of Warcraft UI Bug Tracker
153 stars 7 forks source link

SetFont calls on fontstrings cause later SetFontObject calls to be partially disrespected #581

Open Meorawr opened 4 weeks ago

Meorawr commented 4 weeks ago

Calling the SetFont API on a fontstring bricks its ability to honor subsequent calls to SetFontObject, resulting in the fontstring rendering text with the original font file, size, and flags and ignoring most aspects of objects supplied via future SetFontObject calls.

Test case

Execute the following commands in the chat frame. The expectation would be that after the second command is executed the fontstring would render with the GameFontNormalSmall font, however in reality it ignores most aspects of the supplied object and only bothers to copy its shadow settings and color attributes whilst displaying in the original font (+ size and outline flags) specified in the SetFont call.

/run FS = UIParent:CreateFontString() FS:SetPoint("CENTER") FS:SetFont([[Fonts\SKURRI.ttf]], 24, "THICKOUTLINE") FS:SetText("Test")
/run FS:SetFontObject(GameFontNormalSmall)