Page 1 of 1

Apache-fop: hyphenation for identifiers

Posted: Wed Dec 04, 2013 11:19 am
by Patrik
Hi,

since one use-case of oxygen is writing specifications in a dita-derived document-type we have lots of identifiers in our texts. For these the standrd hyphenation patterns are not sufficient.
For instance identifieres like THIS_IS_AN_IDENTIFIER or ThisIsAnIdentifier. Suitable hyphenatin points would obvioulsy be right after an underscore or after a lower-case letter followed by an upper-case letter. Is there an easy way to make apache-fop do this? (The hyphen pattern file for German with 14k+ entries is quite scary...)

Furthermore there are some identifiers without any patterns I could think of. Thus, I'd need a way to set the possible hyphenation positions explicitly. In Framemaker this can be done by adding a soft hyphen right in the word and in latex you can define the hyphenation for individual words.
Is there anything similar that is working with oxygen and Apache-fop?

Thanks for any advice,

Patrik

Re: Apache-fop: hyphenation for identifiers

Posted: Wed Dec 04, 2013 12:24 pm
by sorin_ristache
Hi Patrik,

You have to add your own custom hyphenation patterns to the existing standard ones provided by the OFFO project. I think you should add your custom hyphenation patterns to the XML source form of the set of patterns for your language, build the binary format (get a jar file) from the XML source form and after that deploy the result jar file in Oxygen.


Regards,
Sorin

Re: Apache-fop: hyphenation for identifiers

Posted: Mon Jan 13, 2014 1:04 pm
by Patrik
Hi Sorin,

finally I'm back to this topic...

Thanks for your replay, but we found no easy way to formulate suitable hyphenation patterns.

However, we found another solution that works fine for us so far (in case, someone else has this problem):
In the transformation for the fop-generation we add an additional transformation for text-nodes within elements that can contain identifiers (e.g. <codeph>). This transformation adds soft-hyphens at the following positions:
- between '.' and a letter
- between '_' and a letter
- after (at least) two lowercase letters before an uppercase letter

Regards,

Patrik

Re: Apache-fop: hyphenation for identifiers

Posted: Mon Jan 13, 2014 1:19 pm
by sorin_ristache
Hi Patrik,

Thank you for letting us know. Other users may find this soft hyphen trick helpful.


Thank you,
Sorin

Re: Apache-fop: hyphenation for identifiers

Posted: Mon Aug 24, 2020 2:35 pm
by lisazeng99
Hi all,

from the installation in https://xmlgraphics.apache.org/fop/1.0/ ... ml#install
"Download the precompiled JAR from OFFO and place it either in the {fop-dir}/lib directory"

Can you share where is {fop-dir}/lib ? I can only find {oxygen -dir}/lib . should I copy the downloaded jar there?

Re: Apache-fop: hyphenation for identifiers

Posted: Mon Aug 24, 2020 2:44 pm
by Radu
Hi Lisa,

This forum thread was started 16 years ago, maybe you could have started a new post instead :)
If you are interested to make this work for DITA publishing maybe this link will help:
https://www.oxygenxml.com/doc/versions/ ... ransformat

Regards,
Radu