fix: Use SharedMedia:Fetch to get actual font object

This commit is contained in:
Xurkon
2026-04-02 19:42:15 -05:00
parent 11cc0e9a79
commit 2efbc0e799
2 changed files with 5 additions and 4 deletions
+4 -4
View File
@@ -17,6 +17,7 @@ local QuestiePlayer = QuestieLoader:ImportModule("QuestiePlayer")
local QuestieQuest = QuestieLoader:ImportModule("QuestieQuest") local QuestieQuest = QuestieLoader:ImportModule("QuestieQuest")
local HBD = QuestieCompat.HBD or LibStub("HereBeDragonsQuestie-2.0") local HBD = QuestieCompat.HBD or LibStub("HereBeDragonsQuestie-2.0")
local SharedMedia = LibStub("LibSharedMedia-3.0")
local atan2 = math.atan2 local atan2 = math.atan2
local pi = math.pi local pi = math.pi
@@ -803,16 +804,15 @@ function QuestieArrow:UpdateSettings()
end end
function QuestieArrow:UpdateFont() function QuestieArrow:UpdateFont()
print("UpdateFont called, arrowFrame=" .. tostring(arrowFrame) .. " title=" .. tostring(arrowFrame and arrowFrame.title))
if not arrowFrame then return end if not arrowFrame then return end
local fontSize = Questie.db.profile.arrowFontSize or 10 local fontSize = Questie.db.profile.arrowFontSize or 10
local fontFace = Questie.db.profile.arrowFont or QuestieFont:GetFont() local fontName = Questie.db.profile.arrowFont or "Friz Quadrata TT"
local fontFace = SharedMedia:Fetch("font", fontName) or fontName
print("UpdateFont: fontName=" .. tostring(fontName) .. " fontFace=" .. tostring(fontFace))
if arrowFrame.title then if arrowFrame.title then
print("Setting title font to " .. tostring(fontFace) .. " size " .. fontSize)
arrowFrame.title:SetFont(fontFace, fontSize, "OUTLINE") arrowFrame.title:SetFont(fontFace, fontSize, "OUTLINE")
end end
if arrowFrame.distance then if arrowFrame.distance then
print("Setting distance font to " .. tostring(fontFace) .. " size " .. (fontSize - 2))
arrowFrame.distance:SetFont(fontFace, fontSize - 2, "OUTLINE") arrowFrame.distance:SetFont(fontFace, fontSize - 2, "OUTLINE")
end end
end end
@@ -91,6 +91,7 @@ function QuestieOptions.tabs.arrow:Initialize()
desc = function() return l10n("The font used for the arrow distance and title text.") end, desc = function() return l10n("The font used for the arrow distance and title text.") end,
get = function() return Questie.db.profile.arrowFont or "Friz Quadrata TT" end, get = function() return Questie.db.profile.arrowFont or "Friz Quadrata TT" end,
set = function(_, value) set = function(_, value)
print("Arrow Font set to: " .. tostring(value) .. " type: " .. type(value))
Questie.db.profile.arrowFont = value Questie.db.profile.arrowFont = value
if QuestieArrow and QuestieArrow.UpdateFont then if QuestieArrow and QuestieArrow.UpdateFont then
QuestieArrow:UpdateFont() QuestieArrow:UpdateFont()