FOray Users
Module Users

FOray: Using Fonts



The following table summarizes the font capabilities of the various FOray renderers:

Renderer Base-14 AWT/OS Custom Custom Embedding
PDF yes no yes yes
PostScript yes no yes no
PCL yes (modified) no no no
TXT yes (used for layout but not for output) no yes (used for layout but not for output) no
AWT if available from OS yes yes n/a (display only)
Print if available from OS yes yes controlled by OS printer driver
RTF n/a (font metrics not needed) n/a n/a n/a
MIF n/a (font metrics not needed) n/a n/a n/a
SVG if available from OS yes no no
XML yes no yes n/a

Base-14 Fonts

The Adobe PDF Specification specifies a set of 14 fonts that must be available to every PDF reader: Helvetica (normal, bold, italic, bold italic), Times (normal, bold, italic, bold italic), Courier (normal, bold, italic, bold italic), Symbol and ZapfDingbats.

AWT/Operating System Fonts

The AWT family of renderers (AWT, Print, SVG), use the Java AWT libraries for font metric information. Through operating system registration, the AWT libraries know what fonts are available on the system, and the font metrics for each one.

Custom Fonts

Support for custom fonts is added by registering them in the FOray font-configuration file.

Font Configuration

Before FOray can use any font, it must get information from the user about the font itself, and further information about how the user wants that font to be used in processing. Much of FOray's use of fonts, including the Base-14 fonts and Custom Fonts are so-called "free-standing" fonts, that is, they can be addressed by FOray independently of Java's knowledge of system fonts. This is important primarily because Java's font handling does not provide support for many standard font types, and provides no ability to get to the font contents at all, which is necessary to embed a font in an output document.

FOray uses a font-configuration file to provide information about these free-standing fonts and to assist in resolving which font to select when processing XSL-FO input. This font-configuration can be thought of as the user's description of the "database" of font information that is available to FOray. FOray uses the aXSL font-configuration DTD for this purpose.

Some features of the aXSL font-configuration are implementation dependent. The following notes supplement the aXSL documentation noted above by documenting features specific to FOray's implementation of the aXSL interface

  • The "from-environment" attribute of the parameter element can refer to either of the following:
    • First, a java environment variable is sought. These can be set with the "-D" command-line switch when invoking the runtime. They can be set programmatically by using the System.setProperty(String, String) method.
    • If not found in the Java environment, an operating system environment variable is sought. These are usually set in a shell supported by the operating system, such as the Korn or Bourne shells in Unix. This feature is currently supported only in Linux, Unix, Mac operating systems since OS/X, and Windows. If you need this feature on another platform, please raise the issue on the user mailing list for consideration.
    • The following feature is available in current repository code and releases after 0.2

      If not found in the above locations, the special environment variable FONT_BASE_DIRECTORY will be mapped to the "font-base-directory" entry in the FOray configuration. Using this method allows your aXSL font configuration to remain generic, but still ties it to your FOray configuration without needing to set an environment variable. Here is an example of how this might be used in your aXSL font configuration:

      <axsl-font-config embed="all" xml:base="{font-root}">
        <server setup-free-standing-fonts="true"

      The above ties the {font-root} value used in the aXSL font configuration to the "font-base-directory" entry in the FOray configuration.

FOray finds the font configuration file itself from the font-configuration entry in the FOray configuration.

Known Limitations of the Font System

Unless otherwise noted, we hope to eventually remove all of the limitations listed here, as we have resources.

  • OpenType fonts are not supported. We hope to add support for them soon.
  • The PostScript renderer does not support font embedding.
  • Font files in Macintosh format are not supported. However, Macintosh users can use font files in other formats with no problems that we know of.

User Font Resources