Font Function

Used to access the names of fonts installed on the user's computer.

Syntax
result = Font( index )

Parameters
index | Integer | The number of the font.

Return Value
Result | String | The name of the font whose index number is passed. Result is in the appropriate WorldScript encoding.

# Notes

Fonts are accessed in alphabetical order where font 0 is the first font. Use the FontCount function to determine the number of fonts.

# Examples

This is an example of a function that determines if the font named passed is installed on the user's computer:

Function FontAvailable(FontName As String) as Boolean
Dim i,n as Integer
n= FontCount-1
For i=0 to n
If Font(i)=FontName Then
Return True
End If
Next
Return False

This example dynamically creates a Font menu using a menu item array named FontFontName:

Dim m as MenuItem
Dim i,n as Integer
n= FontCount-1
FontFontName(0).Text=Font(0)
For i=1 to n
m= New FontFontName
m.Text=Font(i)
Next

# See Also

FontCount, FontsFolder functions.