Originally Posted by Sideshow
That's the dirty way ...
I was just curious if it would possible to drop in a random font file and then recognise/use it in my script.
|
Well, according to wowprogramming it would be possible.
Code:
isValid = FontInstance:SetFont("filename", fontHeight, "flags")
<snip>
Returns:
isValid - 1 if filename refers to a valid font file; otherwise nil (1nil)
You can load files by checking for font1.ttf, font2.ttf, etc.
Example snippet:
Code:
local fonts, object = {}, CreateFont()
for i=1, 100 do
local file = "Interface\\AddOns\\TinyDPS\\fonts\\font" .. i
if object:SetFont(file, 12, "") then
tinsert(fonts, file)
end
end
All from the top of my head and untested.
You could also bruteforce aa, ab, ac, ba, zz, zzzzzzzzzzzzz, but that wouldn't be that efficient