5. Controlling the Font Registration and Caching Mechanism

Using the following options, the registration and caching of fonts can be customized.

5.1. Command Line Options

  • -C,--fontcachefile <fontcachefile>. Specifies the location where the font cache file should be stored.

  • -D,--disablefontcache. Disables the font cache (fonts will be registered even though).

  • -r,--disablefontreading. Disables the reading of fonts entirely.

5.2. Java API Options

  • setFontCachePath(String fontCachePath). Specifies the location where the font cache file should be stored.

  • setCacheFonts(boolean cacheFonts). Activates or deactivates the fontcache.

  • setDisableFontRegistration(boolean disableFontRegistration). Specifies whether fonts are registered with PDFreactor.

5.3. Automatic Font Fallback

Whenever the current font cannot be used to display a certain character, an automatic font fallback is used to find a replacement font for this character. To do so fonts are iterated in the order specified by the following:

  1. The font-family property of the current element

  2. The method setFontFallback

  3. An internal list of recommended fonts

  4. All fonts on the system