From: Joerg Pietschmann Date: Sun, 20 Jul 2003 22:27:13 +0000 (+0000) Subject: Added comments about pattern file structure and conversion X-Git-Tag: Root_Temp_KnuthStylePageBreaking~1264 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=09abb5a881e528aa4c292f7d55b0e313ff1bbb48;p=xmlgraphics-fop.git Added comments about pattern file structure and conversion of TeX patterns git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196734 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/hyphenation.xml b/src/documentation/content/xdocs/hyphenation.xml index e046e7015..ce78b81cf 100644 --- a/src/documentation/content/xdocs/hyphenation.xml +++ b/src/documentation/content/xdocs/hyphenation.xml @@ -62,40 +62,79 @@ Please note that the "view" links reflect current CVS, and may be different than Custom Hyphenation Support
Introduction -

FOP uses an XML-based TeX-like hyphenation pattern scheme. -However, because of licensing issues, there are currently some significant holes in FOP's hyphenation support. -The information in this section is intended to help you work around these limitations, if possible, add support for other languages, or enhance FOP's support of current languages.

- If you have access to hyphenation patterns that are licensed in an Apache-compatible way, or if you have made improvements to an existing FOP hyphenation pattern, or if you have created one from scratch, please consider contributing these to FOP so that they can benefit other FOP users as well. Please inquire on the FOP User mailing list. +

FOP uses Liang's hyphenation algorithm, well known from TeX. It needs + language specific pattern and other data for operation.

+

Because of licensing issues, + there are currently some significant holes in FOP's hyphenation support. + The information in this section is intended to help you work around these + limitations, if possible, add support for other languages, or enhance FOP's + support of current languages.

+ If you have access to hyphenation patterns that are licensed in an + Apache-compatible way, or if you have made improvements to an existing FOP + hyphenation pattern, or if you have created one from scratch, please + consider contributing these to FOP so that they can benefit other FOP users + as well. Please inquire on the FOP User + mailing list.
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.

- The user is responsible to settle license issues for hyphenation pattern files that are obtained from non-Apache sources. +

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. The LPPL puts restrictions on file names + in redistributed derived works which we feel can't guarantee. Some + hyphenation pattern files have other or additional restrictions, for + example against use for commercial purposes.

+

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.

+ The user is responsible to settle license issues for hyphenation + pattern files that are obtained from non-Apache sources.
Sources of Custom Hyphenation Pattern Files -

The most important source of hyphenation pattern files is the CTAN TeX Archive.

+

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:

    -
  1. 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.
  2. -
  3. Name this new file following this schema: languageCode_countryCode.xml. -The country code is optional, and should be used only if needed. For example: +
  4. 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.
  5. +
  6. 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.
    • +
    • en_US.xml would be the file name for American + English hyphenation patterns.
    • +
    • it.xml would be the file name for Italian + hyphenation patterns.
    -The language and country codes must match the XSL-FO input, which follows ISO 639 (languages) and -ISO 3166 (countries). -NOTE: The ISO 639/ISO 3166 convention is that language names are written in lower case, while country codes are written in upper case.
  7. -
  8. There are two ways to make the FOP-compatible hyphenation pattern file accessible to FOP: + The language and country codes must match the XSL-FO input, which + follows ISO + 639 (languages) and ISO + 3166 (countries). NOTE: The ISO 639/ISO 3166 convention is that + language names are written in lower case, while country codes are written + in upper case. FOP does not check whether the language and country specified + in the FO source are actually from the current standard, but it relies + on it being two letter strings in a few places. So you can make up your + own codes for custom hyphenation patterns, but they should be two + letter strings too (patches for proper handling extensions are welcome)
  9. +
  10. 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.
    • +
    • 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.
@@ -103,28 +142,74 @@ NOTE: The ISO 639/ISO 3166 convention is that language names are written in lowe
Hyphenation Patterns -

If you would like to build your own hyphenation pattern files, or modify existing ones, this section will help you understand how to do so. Even when creating a pattern file from scratch, it may be beneficial to start with an existing file and modify it. See Standard Hyphenation Support or the source distribution (src/hyph) for examples. Here is a brief explanation of the contents of FOP's hyphenation patterns:

- The remaining content of this section should be considered "draft" quality. It was drafted from theoretical literature, and has not been tested against actual FOP behavior. It may contain errors or omissions. Do not rely on these instructions without testing everything stated here. If you use these instructions, please provide feedback on the FOP User mailing list, either confirming their accuracy, or raising specific problems that we can address. +

If you would like to build your own hyphenation pattern files, or modify + existing ones, this section will help you understand how to do so. Even + when creating a pattern file from scratch, it may be beneficial to start + with an existing file and modify it. See Standard + Hyphenation Support or the source distribution (src/hyph) for + examples. Here is a brief explanation of the contents of FOP's hyphenation + patterns:

+ The remaining content of this section should be considered "draft" + quality. It was drafted from theoretical literature, and has not been + tested against actual FOP behavior. It may contain errors or omissions. + Do not rely on these instructions without testing everything stated here. + If you use these instructions, please provide feedback on the + FOP User mailing list, either + confirming their accuracy, or raising specific problems that we can + address.