Livecode Wiki

It's an old command, now use Start using font:

RevFontLoad
start using font ...

It loaded a font using the font external library. It works only on Windows and Mac, for Linux see below. Syntax:

revFontLoad <fontFile>

Examples:

revFontLoad myFontFile
revFontLoad "C:/myFontFolder/myCustomFont.ttf"

The revFontLoad command loads a font from a font file into memory.

After loading a font, the fontNames function will return the name of the new font as well as all the previously loaded fonts. To determine the name of the newly loaded font, compare the value of the fontNames before and after loading the font.

On Linux use this code:

create folder "~/.fonts"
revCopyFile "DroidSansMono.ttf", "~/.fonts/DroidSansMono.ttf"
put shell("fc-cache -fv") into temp

Parameters:

  • fontFile: The path to the font file
  • The result: If the font was loaded successfully, the revFontLoad command puts empty into the result. If the font failed to load or invalid parameters were given, the result will contain an error string. This will be 'couldn't find font' if the specified file could not be found and 'couldn't load font' if the specified file could not be loaded as a font.

See also: result (function),fontNames (function),