You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Matthias Brunner <mb...@gmx.net> on 2003/04/14 10:36:52 UTC

Manual line breaks

Hello!

In a perfect XML world content is always separatable from 
presentation. Unfortunately, there are cases (at least in 
publishing) when this is simply not possible. For example, we need 
to provide the possibility to insert manual breaks into text 
(especially titles).

Web research tells me that whitespace-treatment="preserve" is a 
solution to this, yet unimplemented by FOP.
The only workaround I have found so far is to sorround the position 
at which the line should be broken with non-break spaces.
(Example: this&#xA0;is&#xA0;a&#xA0;test <!-- intended break position 
--> this&#xA0;is&#xA0;a&#xA0;test.)

Has anyone found a better solution to this?

Cheers,
Matthias Brunner

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


Re: Manual line breaks

Posted by Joop Vriend <jo...@ddnh.nl>.
I haven't tried this myself yet, but see:

http://marc.theaimsgroup.com/?l=fop-user&m=102469565909328&w=2 :

'If you want to have your line breaks preserved, you
should set linefeed-treatment to preserve. Unfortunately,
FOP doesn't implement this. You can set white-space-collapse
to false, which will not only keep runs of spaces but also
the linefeeds intact (which is actually a bug).
If you want to have white space collapsed, you can
- do this at a transformation level
- use a transformation which transforms each run of characters
    between two line bbreaks into a separate fo:block
- translate the CR to &#x2028; (Unicode LINE SEPARATOR) which
    is apparently treated specially'

Good luck, Joop.


Matthias Brunner wrote:
> Hello!
> 
> In a perfect XML world content is always separatable from 
> presentation. Unfortunately, there are cases (at least in 
> publishing) when this is simply not possible. For example, we need 
> to provide the possibility to insert manual breaks into text 
> (especially titles).
> 
> Web research tells me that whitespace-treatment="preserve" is a 
> solution to this, yet unimplemented by FOP.
> The only workaround I have found so far is to sorround the position 
> at which the line should be broken with non-break spaces.
> (Example: this&#xA0;is&#xA0;a&#xA0;test <!-- intended break position 
> --> this&#xA0;is&#xA0;a&#xA0;test.)
> 
> Has anyone found a better solution to this?
> 
> Cheers,
> Matthias Brunner
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org


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