Bumping, and adding some informations.
Here is the code that I'm using to set the font:
Code:
local fontpath
local SelectedFont = self:GetText()
if not (SelectedFont == "" or SelectedFont == "Default" or SelectedFont == "default" or SelectedFont == "DEFAULT") then
-- Add ".ttf" if not specified by user
if string.find(SelectedFont,"\.ttf$") then
fontpath = SelectedFont
else
fontpath = SelectedFont.."\.ttf"
end
-- This is the part not working currently, SetFont should return something if the path is correct
-- but it returns nothing (eventhough the path is correct). However this works on reload UI
if f.StatusBar.Text:SetFont("Interface\\Addons\\ResolveStatus\\Fonts\\"..fontpath,ResolveStatusDB.fontsize) then
ResolveStatusDB.fontpath = fontpath
UpdateResolveStatusBar()
self:SetText(ResolveStatusDB.fontpath)
else
self:SetText("Invalid file")
end
else
ResolveStatusDB.fontpath = "Default"
UpdateResolveStatusBar()
self:SetText("Default")
end
Need clueeeees