You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Fotis Jannidis <fo...@lrz.uni-muenchen.de> on 2000/12/12 21:19:44 UTC

hyphenation, configuration

I integrated and committed Carlos' very fine hyphenation package. 
Effectively this means that now the following properties are 
supported: 

hyphenate
hyphenation-character
hyphenation-push-character-count
hyphenation-remain-character-count
language
country

Here is the text from the readme in xml-fop/hyph describing, how to 
add hyphenation pattern files (German, US/GB English, Spanish 
and French hyphenation pattern files have already been added. 
Carlos wants to add other ones soon. )


>>>>>>>>>>>>>
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. 
<<<<<<<<<<<<<<<<

Because I thought I need some configuration utility I wrote it, but I 
changed my mind - well at least mostly. Now all pattern files which 
have been put into the xml-fop/hyph directory are automatically 
accessible to Fop. They are serialized during build and packed into 
fop.jar; further configuration is only necessary, if somebody doesn't 
want to rebuild Fop, but add a hyphenation pattern (see 3.b. above)
So I didn't invest too much time into the configuration package. It 
basically does what I described in my last mail, but at the moment 
having pdf, standard, and awt config information seperated seems to 
be an overkill, so the tools to do this are there but are not used. 

I made sure, that CommandLine and XalanCommandLine work, but I 
didn't check AWTCommandLine. Because the class Version now 
reads its version information from the standard config file, all 
attempts to use this class before the configuration has been read in 
will result in a NullPointerException.

There is a new test file hyphen.fo which shows the use of the new 
property, actually the group of properties. If anybody has some 
French/Spanish text to add, please do so. 

Although we are using serialized pattern files and Carlos did his best 
to find an effective data structure for the patterns, you will notice a 
slow down, if you use hyphenation. My integration of the 
hyphenation package (mainly in LineArea) probably could be 
optimized with ease, but it only an ad hoc solution to be replaced 
with some more efficient and typographically better line breaking 
mechanism which uses the whole block.

Fotis