47.37 Working with fonts

When using Hollywood to compile executables for several platforms, the most common problem is usually the question of what to do with the fonts required by your script. The easiest solution to this problem is to simply link all fonts required by your script into your executable. You can do this by using either the @FONT preprocessor command or the -linkfonts console argument. However, many fonts are copyrighted and it is not allowed to link them into your executable, so you might want to load fonts manually instead of linking them. How this works depends on the type of the font your script is using. Hollywood supports two font types: Bitmap fonts in AmigaOS format and TrueType fonts. Please read below for information on how to deal with these two font types.

1) Dealing with Amiga bitmap fonts:

Amiga bitmap fonts are natively supported by Hollywood on all platforms. The advantage of Amiga bitmap fonts is that they do not have to be installed first. They can be used immediately. Simply create a Fonts subdirectory in the directory of your executable and copy all the Amiga bitmap fonts that your executable needs to this directory. Note that an Amiga bitmap font is not a single file but requires three components:

  1. *.font descriptor containing information about the font
  2. Directory named after the font
  3. One or multiple bitmaps containing the raster graphics for the different font sizes

Thus, if you want to use goudyb in size 23 under Windows for example you will require the following files:

C:/Program Files/MyProg/MyCoolProgram.exe  ; exe generated by Hollywood
C:/Program Files/MyProg/Fonts/goudyb.font  ; font descriptor
C:/Program Files/MyProg/Fonts/goudyb/23    ; bitmap for size 23

On AmigaOS it would look like the following:

dh0:Programs/MyProg/MyCoolProgram      ; exe generated by Hollywood
dh0:Programs/MyProg/Fonts/goudyb.font  ; font descriptor
dh0:Programs/MyProg/Fonts/goudyb/23    ; bitmap for size 23

On Mac OS you need to pay attention to the fact that all data files accompanying your program must be put into the Resources folder inside the application bundle. So it would look like the following:

/Programs/MyProg.app  ; exe generated by Hollywood

Important note (AmigaOS): Fonts that have an additional *.otag file are not bitmap fonts! Fonts that have an accompanying *.otag file are usually vector fonts in the TrueType format. TrueType fonts cannot be used by simply copying them to a subdirectory relative to your program. TrueType fonts always have to be installed first! Please see below for more information.

2) Dealing with TrueType fonts:

Working with TrueType fonts is different from working with bitmap fonts in the way that TrueType fonts always have to be installed before you can use them. The only way to use TrueType fonts without installing them is to link them into your executable. However, this is often not possible because of font copyrights. TrueType fonts come as a single file that usually bears the extension *.ttf. To install such a *.ttf file on your system, you need to do the following:

Use the program FTManager. Note that FTManager by default uses a pretty awkward font name which you should change if you plan to compile your script for multiple platforms. See Font specification for details.

Use TypeManager in SYS:System.

Windows and Mac OS:
Simply double-click the *.ttf file and click on Install.

Once you have installed the new font, it is ready for use by Hollywood.

Show TOC