Thanks Fizzle for the reply but that wasn't what I was after. But I did manage to get what I needed working after all, which I'll explain below for the sake of future searches:
for a) well there is actually no fixed (non proportional) font in wow default, the one marked fixedSize=true is actually seemingly only fixed width for digits but "W" there is much wider than say "i"
So I added a custom font to my addon because I found an otf one that is only 14.5 kbytes
To scale an existing font you basically have to do something like
Lua Code:
DB.fixedFont = CreateFont("DynBoxerFixedFont")
DB.fixedFont:SetFont(CombatTextFont:GetFont(), 12)
for b) the main trick is you need to call
:CreateFontString() for example:
Lua Code:
DB.fontString = DB:CreateFontString() -- DB is a frame (in addition to a namespace/table)
DB.fontString:SetFontObject(font)
DB.fontString:SetText(newText)
local width = DB.fontString:GetStringWidth()
DB:Debug("Width with new font is %", width)
e:SetWidth(width + 4) -- + some or highlights hides most of it/it doesn't fit
The code in action before/after:
and an example of actual id generated:
The code doing all that including tabbing between the 2 dialogs, forcing selection, allowing enter or any key to regen new ids, etc... is on
https://github.com/mooreatv/DynamicB...xer/DBoxUI.lua