Recount causes my World of Warcaft to stop responding if I go to change profiles.
I've isolated that this is caused by a modification I made to the Fonts.lua to add monochrome outlines to the Main Window as well as remove text shadowing, but don't know how it affects profile switching.
I'd also like someone more experienced with lua to suggest how to fix this, maybe I'm just doing it wrong.
Code:
local Recount = _G.Recount
local FontStrings={}
local FontFile
local SM = LibStub:GetLibrary("LibSharedMedia-3.0")
--First thing first need to add fonts
--SM:Register("font", "Vera", [[Interface\AddOns\Recount\Fonts\Vera.ttf]])
-- removed ABF.ttf by request from Curse (Arrowmaster)
-- tried DejaVu, crashes client if resized too big
-- tried Bitstream Vera, crashes client if resized too big
-- Hence reverting to Arial Narrow as default font, sorry.
function Recount:AddFontString(string)
local Font, Height, Flags
FontStrings[#FontStrings+1]=string
if not FontFile and Recount.db.profile.Font then
FontFile=SM:Fetch("font",Recount.db.profile.Font)
end
if FontFile then
Font, Height, Flags = string:GetFont()
if Font~=FontFile then
string:SetFont(FontFile, Height, Flags)
end
end
end
function Recount:SetFont(fontname)
local Height, Flags
Recount.db.profile.Font=fontname
FontFile=SM:Fetch("font",fontname)
for _, v in pairs(FontStrings) do
_, Height, Flags = v:GetFont()
v:SetFont(FontFile, Height, "OUTLINE, MONOCHROME")
v:SetShadowColor(0, 0, 0, 0)
end
end