xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Hennebert <vhenneb...@gmail.com>
Subject Re: Inserting line-break symbols?
Date Thu, 11 Mar 2010 11:18:48 GMT
Hi Brad,

Brad Smith wrote:
>> <xsl:attribute-set name="monospace.verbatim.properties">
>>    <xsl:attribute name="wrap-option">wrap</xsl:attribute>
>>    <xsl:attribute name="hyphenation-character">\</xsl:attribute>
>> </xsl:attribute-set>
>> The second attribute hyphenation-character identifies the character to
>> use when the line is broken, in this case a backslash. You could use
>> any Unicode character you like, but the character has to be available
>> to the XSL-FO processor at that point. Note that FOP does not support
>> the hyphenate.verbatim feature at all.
> So, am I mis-understanding, or if I set wrap-option="wrap",
> hyphenate="true" and hyphenation-character="\", should fop be able to
> do what I'm looking for or not?

No. Have a look at the following thread:
The hyphenation-character property (which FOP does support) is not meant
to be used for adding continuation characters where long lines are being
wrapped. It’s only used when breaking /inside/ a word, which rarely is
what you want when you typeset program listings.

>From the quick look I had in the DocBook stylesheets, they don’t use
hyphenation-character. They implemented their own algorithm to wrap
lines at the XSLT stage; it makes use of an extension function that must
be supported by the XSLT processor. But all of that happens before FOP
kicks in.

> As it is, I've got everything but the
> hyphenation char showing up. Looking at fop's output I see "Couldn't
> find hyphenation pattern none". After a bit of searching I figured out
> that I needed to set "language=en_US" in the root xslfo element and
> add the offo hyphenation jar to my classpath. I did that and while I
> no longer get the error about hyphenation patterns, the results I get
> makes no sense. Now, when a line that spills over, chunks of it get
> repeated over and over, filling the better part of the page with
> nonesense.
> So, basically:
> 1) Am I missing something simple that will add the appropriate
> hyphenation rules and ensure the fop follows them?
> 2) Even if I get that, will it ever work in conjunction with a
> hyphenation-character, or dig you mean "abandon all hope" when you
> noted that fop doesn't support hyphenate.verbatim? If the latter, why
> does fop bother (according to its docs, at least) implementing things
> like hyphenation-character?
> Thanks,
> --Brad

Try and find out if the mechanism implemented in the DocBook stylesheets
can do what you want. Otherwise you will have to break long lines
manually, or implement your own utility.


To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

View raw message