Update for posterity and basic completeness.
I was able to provoke a salient error message using :SetFormattedText(). The "blank lines" have had their font set to
nil and size 0. At this point I have no speculation of how the font is being set to
nil as this seems to (quite rightly) produce an error when attempted from an Addon.
If a font is set, the data is immediately displayed.
One could automagically detect-and-correct but I think this is ill-advised and prefer to call the routine if/when detected (I have it launched from a slash-command personally).
Below is a universal version should it ever be of any use.
Lua Code:
-- Scans the displayed GameTooltip for instances of nil font or
-- font-size of 0. If nil-font or 0-size, a font/size will be assigned.
-- Nota Bene: :NumLines() is the number of currently displayed lines
-- so a long tooltip (e.g., item, etc) is best.
function MouseUI:ScanAndRepairToolTip()
local gtt = GameTooltip
for i=1,gtt:NumLines() do
local lineL = _G["GameTooltipTextLeft"..tostring(i)]
local lineR = _G["GameTooltipTextRight"..tostring(i)]
local fontNameL, fontSizeL = lineL:GetFont()
if fontNameL == nil or fontSizeL == 0 then
print("Font Applied: L"..tostring(i))
lineL:SetFont("Fonts\\FRIZQT__.TTF", i==1 and 14 or 12)
lineL:SetJustifyH("LEFT")
end
local fontNameR, fontSizeR = lineR:GetFont()
if fontNameR == nil or fontSizeR == 0 then
print("Font Applied: R"..tostring(i))
lineR:SetFont("Fonts\\FRIZQT__.TTF", i==1 and 14 or 12)
lineR:SetJustifyH("RIGHT")
end
end
print("Finished Scanning/Fixing Tooltip ["..tostring( gtt:NumLines() ).."]" )
end
To determine what font or size is used, or verify what's happening before the above, the below spits out data on all displayed lines.
Lua Code:
function MouseUI:ScanTip()
local gtt = GameTooltip
for i=1,gtt:NumLines() do
local fontNameL, fontSizeL = _G["GameTooltipTextLeft"..tostring(i)]:GetFont()
local fontNameR, fontSizeR = _G["GameTooltipTextRight"..tostring(i)]:GetFont()
print(tostring(i).."L: "..tostring(fontNameL).." ["..tostring(fontSizeL).."]")
print(tostring(i).."R: "..tostring(fontNameR).." ["..tostring(fontSizeR).."]")
end
end