The function WindowFont appears to return eOK regardless of whether the font is loaded correctly. I am running MUSHClient version 4.37 on Ubuntu. I put together the following test script.
When I run the script, I get the output:
Font loaded successfully
test_font -> Courier New
It looks like WindowFont is returning eOK even though I'm passing it a bad font name, and I'm ending up with Courier New loaded.
font_name = "bad_font_name"
if WindowFont(win, "test_font", font_name, 8, false, false, false, false, 0, 49) == error_code.eOK then
Note('Font loaded successfully')
else
Note('Error loading font')
end
fonts = WindowFontList(win)
if fonts then
for _, v in ipairs (fonts) do
Note (v .. " -> " .. WindowFontInfo(win, v, 21))
end
end
When I run the script, I get the output:
Font loaded successfully
test_font -> Courier New
It looks like WindowFont is returning eOK even though I'm passing it a bad font name, and I'm ending up with Courier New loaded.