FOP: Hyphenation | print-friendly |
- Introduction
- License Issues
- Sources of Hyphenation Pattern Files
- Installing Custom Hyphenation Patterns
Introduction
FOP uses an XML-based TeX-like hyphenation pattern scheme. Hyphenation pattern files for many languages are included in the standard FOP distribution. However, because of licensing issues, there are currently some significant holes in FOP's hyphenation support. The information on this page is intended to help you work around these limitations, if possible, add support for other languages, or enhance FOP's support of current languages.
License Issues
Many of the hyphenation files distributed with TeX and its offspring are licenced under the LaTeX Project Public License (LPPL), which prevents them from being distributed with Apache software. Although Apache FOP cannot redistribute hyphenation pattern files that do not conform with its license scheme, that does not necessarily prevent users from using such hyphenation patterns with FOP. However, it does place on the user the responsibility for determining whether the user can rightly use such hyphenation patterns under the hyphenation pattern license.
Sources of Hyphenation Pattern Files
The most important source of hyphenation pattern files is the CTAN TeX Archive.
Installing Custom Hyphenation Patterns
To install custom a custom hyphenation pattern for use with FOP:
- Convert the TeX hyphenation pattern file to the FOP format. The FOP format is an xml file conforming to the DTD found at {fop-dir}/src/hyph/hyphenation.dtd.
- Name this new file following this schema: languageCode_countryCode.xml.
The country code is optional, and should be used only if needed. For example:
- en_US.xml would be the file name for an American English hyphenation pattern.
- it.xml would be the file name for an Italian hyphenation pattern.
- There are two ways to make the FOP-compatible hyphenation pattern file accessible to FOP:
- Place the FOP-compatible hyphenation pattern file into the directory {fop-dir}/src/hyph and rebuild FOP. The file will be picked up and added to fop.jar.
- Put the file into a directory of your choice and configure FOP to look for custom patterns in this directory, by setting the <hyphenation-dir> configuration option.