[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fop-user
Subject:    Re: How to do program listings?
From:       Andreas L Delmelle <a_l.delmelle () pandora ! be>
Date:       2007-10-31 17:36:51
Message-ID: 25448361-CB2B-4EAF-9B7F-B78ADEDE0CEA () pandora ! be
[Download RAW message or body]

On Oct 29, 2007, at 07:22, Manuel Mall wrote:

Hi

Just to confirm:

>> When I use FOP 0.96, however, the tag causes my java source code  
>> to appear
>> filled and wrapped? Am I doing something wrong or is there a  
>> problem with
>> 0.96?

> I am not sure I understand what you mean by "filled". However, the  
> handling
> of white space has changed significantly between 0.20.5 and 0.96. 0.96
> behaves much more in accordance with the XSL-FO specification. Try to
> specify linefeed-treatment="preserve" in addition to
> white-space-collapse="false" when using 0.96. Hopefully this will  
> give you
> the result you want.

This should work nicely (with 0.94; 0.96 does not exist yet ;-))

<fo:block linefeed-treatment="preserve"
           white-space-treatment="preserve"
           white-space-collapse="false">
{A Java class}
</fo:block>

white-space-treatment is equally important to preserve the leading  
spaces of the lines. If this reverts to its initial value of "ignore- 
if-surrounding-linefeed", those will be removed, leading to all lines  
starting at the same offset from the page-edge. I assume it's this  
latter effect Siegfried is referring to as "filled". All indentation  
(most likely inserted as spaces) in the source file will be lost.

Without preserved linefeeds, the linebreaks are calculated as if the  
block's text were prose. For poetry (and incidentally also source  
code ;-)), you need the above properties.

Cheers

Andreas


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic