Skip to main content

FontList

FontList (separatorStr [, options ])

The FontList function returns a list of the installed fonts, separated by the characters in separatorStr.

Parameters

A maximum of 10 bytes from separatorStr are appended to each font name as the output string is generated. separatorStr is usually ";".

Use options to limit the returned font list according to font type. It is restricted to returning only scalable fonts (TrueType, PostScript, or OpenType), which you can do with options = 1.

To get a list of nonscalable fonts (bitmap or raster), use:

String bitmapFontList = RemoveFromList(FontList(";",1), FontList(";"))

(If all fonts are scalable, bitmapFontList might be empty.)

Examples

Function SetFont(fontName)
String fontName
Prompt fontName, "font name:", popup, FontList(";") + "default;"
DoPrompt "Pick a Font", fontName

Print fontName

Variable type= WinType("") // target window type
String windowName= WinName(0,127)
if( (type == 1) || (type == 3) || (type == 7) ) // graph,panel,layout
Print "Setting drawing font for " + windowName
Execute "SetDrawEnv fname=\"" + fontName + "\""
else
if( type == 5 ) // notebook
Print "Setting font for selection in " + windowName
Notebook $windowName font=fontName
endif
endif
End

See Also

FontSizeStringWidth, FontSizeHeight, WinType

Execute, SetDrawEnv, Notebook