world.WindowFontList

MUSHclient script function (Method) — introduced in version 4.34

Lists all fonts loaded into a miniwindow

Prototype

VARIANT WindowFontList(BSTR WindowName);

Data type meanings

Description

This returns a list of all fonts loaded into this miniwindow. You could use this to find which fonts have been loaded, and then use WindowFontInfo to find information about each one.

WindowName - the name of the miniwindow to check for fonts.

For more information, see:

http://www.gammon.com.au/mushclient/mw_text.htm

Lua example

-- show all fonts
fonts = WindowFontList(win)

if fonts then
  for _, v in ipairs (fonts) do 
    Note (v) 
  end
end -- if any

Lua notes

Lua returns nil if there are no fonts.

Return value

If there are no fonts loaded then the return value is empty. Use "IsEmpty" to test for this possibility.

Otherwise, it returns a variant array containing the font ids of all the fonts. Use "ubound" to find the number of fonts in the list. You can then use "WindowFontInfo" to find details about each fonts.

Related topic

MiniWindows

See also

FunctionDescription
WindowCreateCreates a miniwindow
WindowFontLoads a font into a miniwindow
WindowFontInfoReturns information about a font
WindowTextDraws text into a miniwindow
WindowTextWidthCalculates the width of text in a miniwindow