RegisterFontFile()

Syntax

Result = RegisterFontFile(FileName$)
Description
Register a font file for use with the LoadFont() command. All fonts contained in the file are then available.

Parameters

FileName$ The file containing the font. The file must be in TrueType format.

Return value

Returns nonzero if the file was sucessfully registered.

Remarks

The font file is registered for the current program only. This means that the font(s) are not accessible by other programs and will be unregistered when the program ends. No system-wide changes are made by this command.

Example

  ; Now let's use a new font, which it was downloaded from internet to the temporary directory...
  ; The font name is "ascii" and the font file is "ascii.ttf"
  If RegisterFontFile(GetTemporaryDirectory() + "ascii.ttf") ; We have to register it before to use it
    LoadFont(0, "ascii", 12) ; Now we can load the font, the operating system knows it
    SetGadgetFont(0, FontID(0))
  ...

Example

FontRegister.pb

See Also

LoadFont()

Supported OS

All

<- LoadFont() - Font Index