InstallFont

Description:

baInstallFont installs a TrueType or Bitmap font.

Platforms:

Windows

Usage:

Result = baInstallFont( FontFile, FontName )

Arguments:

String, string.
FontFile is the .ttf or .fon file to install.
FontName is the name of the font.

Returns:

Integer.
Returns 0 if font installs OK. Otherwise returns one of

A font file with that name already exists.

The font file was not found.

Error copying font file.

Windows couldn't install the font.

The font file is an invalid name.

Examples:

Director:
OK = baInstallFont( the moviePath & "arialb.ttf" , "Arial Bold" )

Authorware:
OK := baInstallFont( FileLocation ^ "arialb.ttf" , "Arial Bold" )
 

Notes:

Most fonts are copyrighted material. You should not install a font unless you are legally allowed to do so.

The name of the font should be taken from the Fonts Control Panel. The name that Windows identifies the font to applications is taken from information inside the font file, not the name you give it.

You should use the baFontInstalled command to check whether or not a particular font is already installed before you try to install a new copy.

Director does not rebuild it's font list after it has been started. This means that the font will not be available to the projector that installed it unless it is restarted. All versions of Authorware should be able to use the font immediately. There is usually no need to restart Windows.
 

See also:

baFontInstalled
baFontStyleList
baFontList