Page 1 of 1
Breaking lines with a hyphen
Posted: Fri Mar 04, 2005 12:21 am
by g3org3
I'm trying to output some java souce code in a docbook pdf. I want long lines to be wrapped with a continuation character. The problem is that when I turn on hyphenation to allow this, I get a hyphen in front of almost every word. Is this a problem with the built in fop? Or am I doing something wrong? Here's the xsl in my customisation layer:
Code: Select all
...
<xsl:import href="file:/Applications/oxygen/frameworks/docbook/xsl/fo/docbook.xsl"/>
<xsl:param name="hyphenate.verbatim" select="1"/>
<xsl:attribute-set name="monospace.verbatim.properties"
use-attribute-sets="verbatim.properties monospace.properties">
<xsl:attribute name="font-size">75%</xsl:attribute>
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
<xsl:attribute name="hyphenation-character">►</xsl:attribute>
</xsl:attribute-set>
...
Posted: Fri Mar 04, 2005 5:43 pm
by sorin_ristache
Hello,
It doesn't seem to be a problem in FOP. Do you use a hyphenation file together with FOP ? How did you obtain it ?
Regards,
Sorin
Posted: Fri Mar 04, 2005 8:10 pm
by g3org3
First I should point out that I'm new to this and I've just been gathering information about docbook and fo from the web as I go, so it's quite possible I've misunderstood somewhere along the line. I thought getting a hyphenation file might fix the problem so I got en.xml via this page
http://xml.apache.org/fop/hyphenation.html. I downloaded an example fop configuration file and set the hyphenation directory where I put en.xml, then I set oxygen's fo preferences to the location of the config file. It didn't make any difference! Is that what I should have done? Thanks for your help.
Posted: Mon Mar 07, 2005 6:08 pm
by sorin_ristache
Hello,
The English hyphenation file is part of the FOP's standard hyphenation support so you don't have to download and set any config file for that. Using the <oXygen/> built in FOP is enough. I tested that and it works with non verbatim DocBook elements like para (verbatim elements are programlisting, screen, synopsis).
For verbatim elements I got the same wrong result: a hyphen in front of almost every word. This happened for me both with the FOP's builtin hyphenation support for the English language and with a config file specifying the directory with the en.xml file downloaded from the Apache site. What you did in your customisation layer is right but the problem is in the DocBook XSL stylesheet imported by your layer. You can see that if you disable the FO processing in the transformation scenario edit dialog (the FO Processor tab), change the value of Save As (the Output tab) to FOPinput.fo for example and look at the generated .fo file. So FOP does not add the strange hyphens to your document content but they are already present in the FOP input file. The next step is to ask about the strange hyphens on the docbook-apps list:
http://www.oasis-open.org/docbook/mailinglist/
The list archives are at:
http://lists.oasis-open.org/archives/docbook-apps/
I hope this helps,
Sorin
Posted: Mon Mar 07, 2005 10:50 pm
by g3org3
Many thanks for your help. It's good to know I wasn't totally off track! I'll post back here if/when I find a solution.
Posted: Wed Feb 14, 2007 7:22 pm
by dleal
Dear g3org3 and sorin,
I have the same problem. Did you arrived to any solution about this problem?
Thanks in advance,
David