diff options
author | Glenn Adams <gadams@apache.org> | 2016-03-06 06:14:41 +0000 |
---|---|---|
committer | Glenn Adams <gadams@apache.org> | 2016-03-06 06:14:41 +0000 |
commit | 57949ba0cfffa2dd5933a103c6ad867de9f1e7a0 (patch) | |
tree | cd1d8100a9135449635251820f39f272151005ac /fop/hyph | |
parent | c8cde713f54ca731f4a7f3bfaef8af9e8a1b9262 (diff) | |
download | xmlgraphics-fop-57949ba0cfffa2dd5933a103c6ad867de9f1e7a0.tar.gz xmlgraphics-fop-57949ba0cfffa2dd5933a103c6ad867de9f1e7a0.zip |
Configure maven build.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/maven@1733788 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'fop/hyph')
-rw-r--r-- | fop/hyph/hyphenation.dtd | 69 | ||||
-rw-r--r-- | fop/hyph/readme | 93 |
2 files changed, 162 insertions, 0 deletions
diff --git a/fop/hyph/hyphenation.dtd b/fop/hyph/hyphenation.dtd new file mode 100644 index 000000000..d2171df5f --- /dev/null +++ b/fop/hyph/hyphenation.dtd @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="US-ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- $Id$ --> + +<!ELEMENT hyphenation-info (hyphen-char?, hyphen-min?, + classes, exceptions?, patterns)> + +<!-- Hyphen character to be used in the exception list as shortcut for + <hyphen pre-break="-"/>. Defaults to '-' +--> +<!ELEMENT hyphen-char EMPTY> +<!ATTLIST hyphen-char value CDATA #REQUIRED> + +<!-- Default minimum length in characters of hyphenated word fragments + before and after the line break. For some languages this is not + only for aesthetic purposes, wrong hyphens may be generated if this + is not accounted for. +--> +<!ELEMENT hyphen-min EMPTY> +<!ATTLIST hyphen-min before CDATA #REQUIRED> +<!ATTLIST hyphen-min after CDATA #REQUIRED> + +<!-- Character equivalent classes: space separated list of character groups, all + characters in a group are to be treated equivalent as far as + the hyphenation algorithm is concerned. The first character in a group + is the group's equivalent character. Patterns should only contain + first characters. It also defines word characters, i.e. a word that + contains characters not present in any of the classes is not hyphenated. +--> +<!ELEMENT classes (#PCDATA)> + +<!-- Hyphenation exceptions: space separated list of hyphenated words. + A hyphen is indicated by the hyphen tag, but you can use the + hyphen-char defined previously as shortcut. This is in cases + when the algorithm procedure finds wrong hyphens or you want + to provide your own hyphenation for some words. +--> +<!ELEMENT exceptions (#PCDATA|hyphen)* > + +<!-- The hyphenation patterns, space separated. A pattern is made of 'equivalent' + characters as described before, between any two word characters a digit + in the range 0 to 9 may be specified. The absence of a digit is equivalent + to zero. The '.' character is reserved to indicate beginning or ending + of words. --> +<!ELEMENT patterns (#PCDATA)> + +<!-- A "full hyphen" equivalent to TeX's \discretionary + with pre-break, post-break and no-break attributes. + To be used in the exceptions list, the hyphen character is not + automatically added --> +<!ELEMENT hyphen EMPTY> +<!ATTLIST hyphen pre CDATA #IMPLIED> +<!ATTLIST hyphen no CDATA #IMPLIED> +<!ATTLIST hyphen post CDATA #IMPLIED> diff --git a/fop/hyph/readme b/fop/hyph/readme new file mode 100644 index 000000000..5bcbc0d07 --- /dev/null +++ b/fop/hyph/readme @@ -0,0 +1,93 @@ +Hyphenation + +FOP uses Liang's hyphenation algorithm, well known from TeX. It needs +language specific patterns and other data for operation. + +Because of licensing issues (and for convenience), all hyphenation +patterns for FOP are made available through the Objects For Formatting +Objects project <http://offo.sourceforge.net/hyphenation/index.html>. + +To install 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}/hyph/hyphenation.dtd. + + The most important source of TeX hyphenation pattern files is the + CTAN TeX Archive + <http://www.ctan.org/tex-archive/language/hyphenation/>. + +2. Name this new file following this scheme: + 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 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 + <http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt> + (languages) and ISO 3166 + <http://www.ics.uci.edu/pub/ietf/http/related/iso3166.txt> + (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) + +3. There are basically three ways to make the FOP-compatible + hyphenation pattern file(s) accessible to FOP: + +a. Download the precompiled JAR from OFFO + <http://offo.sourceforge.net/hyphenation/index.html> and place it + either in the {fop-dir}/lib directory, or in a directory of your + choice (and append the full path to the JAR to the environment + variable FOP_HYPHENATION_PATH). + +b. Download the desired FOP-compatible hyphenation pattern file(s) from + OFFO <http://offo.sourceforge.net/hyphenation/index.html>, and/or + take your self created hyphenation pattern file(s), + - place them in the directory {fop-dir}/hyph, + - or place them in a directory of your choice and set the Ant + variable user.hyph.dir to point to that directory (in + build-local.properties), + and run Ant with build target jar-hyphenation. This will create a + JAR containing the compiled patterns in {fop-dir}/build that will + be added to the classpath on the next run. + + When FOP is built from scratch, and there are pattern source + file(s) present in the directory pointed to by the user.hyph.dir + variable, this JAR will automatically be created from the supplied + pattern(s). + +c. Put the pattern source file(s) into a directory of your choice and + configure FOP to look for custom patterns in this directory, by + setting the hyphenation-dir configuration option. + + Either of these three options will ensure hyphenation is working + when using FOP from the command-line. If FOP is being embedded, + remember to add the location(s) of the hyphenation JAR(s) to the + CLASSPATH (option 1 and 2) or to set the hyphenation-dir + configuration option programmatically (option 3). + +If you would like to build your own hyphenation pattern files, or +modify existing ones, the section entitled 'Hyphenation Patterns' of +the 'FOP: Hyphenation' page at the FOP web site +<http://xmlgraphics.apache.org/fop/hyphenation.html#patterns> 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 OFFO's Hyphenation page +<http://offo.sourceforge.net/hyphenation/index.html> for examples. + +If you have made improvements to an existing FOP hyphenation pattern, +or if you have created one from scratch, please consider contributing +these to OFFO so that they can benefit other FOP users as well. +Please inquire on the FOP User mailing list. + |