Obtained from: Submitted by: Reviewed by: Added 'hyphenation-jar' build target Updated startup scripts to include the compiled jar-file git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-maintain@198530 13f79535-47bb-0310-9956-ffa450edef68fop-0_20_2-maintain
@@ -207,7 +207,7 @@ Sometimes ant gives out this warnings, but the build is finished without any pro | |||
<property name="src.dir" value="./src"/> | |||
<property name="src.codegen" value="./src/codegen"/> | |||
<property name="lib.dir" value="./lib"/> | |||
<property name="hyph.dir" value="./src/hyph"/> | |||
<property name="hyph.dir" value="./hyph"/> | |||
<property name="conf.dir" value="./conf"/> | |||
<property name="packages" value="org.apache.fop.*"/> | |||
@@ -573,11 +573,23 @@ Sometimes ant gives out this warnings, but the build is finished without any pro | |||
targetDir="${build.dest}/hyph" /> | |||
</target> | |||
<target name="hyphenation-jar" depends="hyphenation"> | |||
<jar jarfile="${build.dir}/fop-hyph.jar" | |||
basedir="${build.dest}" | |||
includes="hyph/**"> | |||
<manifest> | |||
<attribute name="Implementation-Title" value="${Name}"/> | |||
<attribute name="Implementation-Version" value="${version}"/> | |||
<attribute name="Implementation-Vendor" value="Apache Software Foundation (http://xml.apache.org/fop/)"/> | |||
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}])"/> | |||
</manifest> | |||
</jar> | |||
</target> | |||
<!-- =================================================================== --> | |||
<!-- Creates the class package --> | |||
<!-- =================================================================== --> | |||
<target name="package" depends="compile,hyphenation" description="Generates the jar files (default target)"> | |||
<target name="package" depends="compile,hyphenation-jar" description="Generates the jar files (default target)"> | |||
<echo message="Creating the jar file ${build.dir}/${name}.jar"/> | |||
<tstamp> | |||
@@ -585,7 +597,7 @@ Sometimes ant gives out this warnings, but the build is finished without any pro | |||
</tstamp> | |||
<jar jarfile="${build.dir}/${name}.jar" | |||
basedir="${build.dest}" | |||
includes="org/**,conf/**,hyph/**"> | |||
includes="org/**,conf/**"> | |||
<manifest> | |||
<attribute name="Main-Class" value="${main.class}"/> | |||
<attribute name="Class-Path" value="${runtime.classpath}"/> |
@@ -6,6 +6,7 @@ if "%OS%"=="Windows_NT" set LOCAL_FOP_HOME=%~dp0 | |||
set LIBDIR=%LOCAL_FOP_HOME%lib | |||
set LOCALCLASSPATH=%LOCAL_FOP_HOME%build\fop.jar | |||
set LOCALCLASSPATH=%LOCAL_FOP_HOME%build\fop-hyph.jar | |||
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis.jar | |||
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xercesImpl-2.2.1.jar | |||
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.4.1.jar | |||
@@ -14,4 +15,6 @@ set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\avalon-framework-cvs-20020806.jar | |||
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jimi-1.0.jar | |||
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_core.jar | |||
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_codec.jar | |||
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\fop-hyph.jar | |||
set LOCALCLASSPATH=%LOCALCLASSPATH%;%FOP_HYPHENATION_PATH% | |||
java -cp "%LOCALCLASSPATH%" org.apache.fop.apps.Fop %1 %2 %3 %4 %5 %6 %7 %8 |
@@ -46,6 +46,8 @@ fi | |||
if $cygwin ; then | |||
[ -n "$FOP_HOME" ] && | |||
FOP_HOME=`cygpath --unix "$FOP_HOME"` | |||
[ -n "$FOP_HYPHENATION_PATH" ] && | |||
FOP_HYPHENATION_PATH=`cygpath --unix "$FOP_HYPHENATION_PATH"` | |||
[ -n "$JAVA_HOME" ] && | |||
JAVA_HOME=`cygpath --unix "$JAVA_HOME"` | |||
[ -n "$CLASSPATH" ] && | |||
@@ -93,6 +95,11 @@ do | |||
fi | |||
done | |||
# add in user-defined hyphenation JARs | |||
if [ -n "$FOP_HYPHENATION_PATH" ] ; then | |||
LOCALCLASSPATH=$LOCALCLASSPATH:$FOP_HYPHENATION_PATH | |||
fi | |||
# For Cygwin, switch paths to Windows format before running java | |||
if $cygwin; then | |||
FOP_HOME=`cygpath --path --windows "$FOP_HOME"` |
@@ -0,0 +1,52 @@ | |||
<?xml version="1.0" encoding="US-ASCII"?> | |||
<!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 minimun 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 begining 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> |
@@ -0,0 +1,43 @@ | |||
Hyphenation | |||
Fop comes with some hyphenation pattern. If you need a hyphenation | |||
pattern which isn't included in the distribution, do the following: | |||
1. get the TeX hyphenation pattern file and turn it into an xml file | |||
which conforms to the hyphenation.dtd in the sub directory /hyph | |||
2. name this new file following this schema: languageCode_countryCode.xml. | |||
If you don't need a country code, leave it away, p.e. the file name | |||
for an American english hyphenation pattern would look like this: | |||
en_US.xml. | |||
For an Italian file: it.xml. | |||
Language and country codes must be the same as in xsl:fo, that is follow | |||
ISO 639 <http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt> and | |||
ISO 3166 <http://www.ics.uci.edu/pub/ietf/http/related/iso3166.txt> | |||
respectively. | |||
NOTE: The ISO 639/ISO 3166 convention is that language names are | |||
written in lower case, while country codes are written in upper case. | |||
3. If you have build your new hyphenation pattern file successfully there are | |||
two ways to make it accessible to Fop. | |||
a) Put this new file into the directory /hyph and rebuild Fop. The file will | |||
be picked up and added to the fop.jar. | |||
b) Put the file into a directory of your choice and specify this directory | |||
in the userconfig.xml in the entry <hyphenation-dir> | |||
4. If the license of your hyphenation pattern file does allow it, please send | |||
it to the list fop-dev, so it can be made part of the Fop distribution. | |||
the following hyphenation patterns are part of the Fop distribution | |||
da Danish | |||
de German (traditional) | |||
de_DR German (new spelling) | |||
en American English | |||
en_GB British English | |||
en_US American English | |||
es Spanish | |||
fi Finnish | |||
fr French | |||
it Italian | |||
nl Dutch (new official Dutch spelling) |