In Apache FOP 1.0 a convenience feature for XSL-FO to PDF rendering was added: automatic detection and use of fonts. This can be fonts registered by the operating system or fonts lying in directories you point at by mentioning them in the FOP configuration file. But if you want to use the auto feature, you have to tell FOP to use your configuration file, even it’s the standard configuration in <fop directory>/conf/fop.xconf – often forgetting the -c parameter and wondering why your fonts are not detected costs endless hours.
To use costum-fonts just add the following (just one or both sections, as you need it) to your fop.xconf under the <fonts> node:
<!-- use fonts located in a special directory --> <directory>/Library/Fonts</directory>
<!-- automatically detect operating system installed fonts --> <auto-detect/>
Runnig the auto-detection font feature can result in a huge memory consumption by fop building it’s font cache file (~.fop/fop-fonts.cache). If you get the message: Exception in thread „main“ java.lang.OutOfMemoryError: Java heap space – try this options (entered in a shell just before you start FOP or add this to the FOP start script):
or if that doesn’t work, then