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 Stuart Turner <st...@salmon.com> on 2009/06/09 16:39:57 UTC
Upgrade 0.20.5 to 0.95: line spacing increased?
Hi
I've upgraded our application to use 0.95 and I have the problem that
documents that were formatted to fit on one page are now overflowing onto a
second page. It seems that the spacing between lines of text, (and also
between other elements), has increased in this version of FOP. I've searched
for some kind of parameter that might let me control this but not found any.
Is this just a consequence of the rewrite for 0.95 and is there anything I
can do about it ? (I notice there are some known issues regarding white
space.)
Also, centre justification seems to work differently in that words are split
differently across lines. In the example documents 0.20.5 fits more words
into the first line whereas 0.95 spreads words evenly across all lines.
I've attached a sample document that displays both behaviours:
quote.fo - the source generated by RTF2FO from a Word RTF document
keyfacts.png - included image
quote0.20.5.pdf - generated by 0.20.5
quote0.95.pdf - generated by 0.95
Any help would be appreciated as our users are insisting the spacing issue
is solved without changing the original documents. At the moment the only
solution I have is to revert to 0.20.5. :(
Thanks,
Stuart
http://www.nabble.com/file/p23944243/quote.fo quote.fo
http://www.nabble.com/file/p23944243/keyfacts.png keyfacts.png
http://www.nabble.com/file/p23944243/quote0.20.5.pdf quote0.20.5.pdf
http://www.nabble.com/file/p23944243/quote0.95.pdf quote0.95.pdf
--
View this message in context: http://www.nabble.com/Upgrade-0.20.5-to-0.95%3A-line-spacing-increased--tp23944243p23944243.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Upgrade 0.20.5 to 0.95: line spacing increased?
Posted by Manuel Mall <ma...@apache.org>.
Stuart,
very interesting - one of the core changes between 0.20.5 and 0.95 is the
line breaking algorithm which is now based on a model that can described as
"best fit" while 0.20.5 uses "first fit". With "best fit" you get a result
that is suppose to be more aesthetically pleasing by avoiding lines with
uneven length, avoiding large gaps when justifying etc.. You can see that
effect by looking at the center aligned paragraphs in your box labelled
"Cover". In 0.95 the lines in each center aligned paragraph are much more
equal in length giving each paragraph a much more balanced appearance.
However, the sequence of the 3 center aligned paragraphs is now looking very
different compared to 0.20.5 (and not necessarily 'better') as in 0.20.5 the
3 paragraphs together are much more similar (first line of each paragraph as
roughly the same length) to each other which is probably desirable in this
particular case.
I have no solution how to exactly replicate 0.20.5 layout behaviour in 0.95.
Of course you could use hard line breaks to produce the same output.
Regarding the vertical space this is most likely caused by 0.95 implementing
the XSL-FO specification much more accurately in this respect. The setting
of line-height comes to mind as a parameter to play with. You may have to go
through your fo file paragraph by paragraph (fo:block by fo:block) and make
adjustments until you get the line spacing as you want it.
Stuart Turner wrote:
>
> Hi
>
> I've upgraded our application to use 0.95 and I have the problem that
> documents that were formatted to fit on one page are now overflowing onto
> a second page. It seems that the spacing between lines of text, (and also
> between other elements), has increased in this version of FOP. I've
> searched for some kind of parameter that might let me control this but not
> found any. Is this just a consequence of the rewrite for 0.95 and is there
> anything I can do about it ? (I notice there are some known issues
> regarding white space.)
>
> Also, centre justification seems to work differently in that words are
> split differently across lines. In the example documents 0.20.5 fits more
> words into the first line whereas 0.95 spreads words evenly across all
> lines.
>
> I've attached a sample document that displays both behaviours:
>
> quote.fo - the source generated by RTF2FO from a Word RTF document
> keyfacts.png - included image
> quote0.20.5.pdf - generated by 0.20.5
> quote0.95.pdf - generated by 0.95
>
> Any help would be appreciated as our users are insisting the spacing issue
> is solved without changing the original documents. At the moment the only
> solution I have is to revert to 0.20.5. :(
>
> Thanks,
> Stuart
>
> http://www.nabble.com/file/p23944243/quote.fo quote.fo
> http://www.nabble.com/file/p23944243/keyfacts.png keyfacts.png
> http://www.nabble.com/file/p23944243/quote0.20.5.pdf quote0.20.5.pdf
> http://www.nabble.com/file/p23944243/quote0.95.pdf quote0.95.pdf
>
--
View this message in context: http://www.nabble.com/Upgrade-0.20.5-to-0.95%3A-line-spacing-increased--tp23944243p23946312.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Upgrade 0.20.5 to 0.95: line spacing increased?
Posted by Stuart Turner <st...@salmon.com>.
Hi Skhay,
We use RTF2FO to generate our FO files from RTF documents, we don't use XSL.
line-height-stretch is a configuration option for RTF2FO and not an XSL-FO
property so you won't be able to use it.
My knowledgeof XSL is not great but I assume you could apply a scaling
factor yourself via your XSL, something like
<xsl:value-of select="originallineheight * 0.9"/>
maybe?
Hope you find a solution,
Stuart
--
View this message in context: http://old.nabble.com/Upgrade-0.20.5-to-0.95%3A-line-spacing-increased--tp23944243p29181168.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Upgrade 0.20.5 to 0.95: line spacing increased?
Posted by Pascal Sancho <pa...@takoma.fr>.
Hi,
line-height-stretch is not a valid XSL-FO property, but seems to be a
RTF2FO configuration property.
You should visit RTF2FO site or googlize for line-height-stretch, this
list is only for FOP usage.
Note that XSL-FO line-height defaults to 1.2, but you can change this by
specifying line-height directly on fo:root, since this property is
inherited when a numerical value is used.
Pascal
Le 15/07/2010 23:56, Skhay a écrit :
>
> Hi Stuart,
>
> Even im facing the same issue as you have mentioned.
>
> I have upgraded to FOP 0.95 and the new form generated has some of the text
> moved to second page becos of bigger line space.
>
> I noticed your resolution of setting line-height-stretch property.
> So can you please let me know how you were able to set this property to the
> value 1.13?
>
> In my xsl, line-height is given in <fo:block> and when i try adding
> line-height-stretch property, it errors out.
>
>
> Thanks in advance,
> Skhay
>
>
>
>
>
> Stuart Turner wrote:
>
>> Hi
>>
>> Thanks for your quick replies. Thought I'd let you know how I got on. I
>> was resigned to trying different options as suggested until I took another
>> look at the RTF2FO configuration files. The file options.xml contains
>> compatibility settings to tailor the fo output for the different fo to pdf
>> converters supported by RTF2FO. Don't know how I missed it the first time
>> around but the setting line-height-stretch was exactly what I was looking
>> for. I decreased this value for FOP, (from 1.23 to 1.13 in case anyone is
>> interested), and the fo output produced now has a correspondingly
>> decreased line-height value. Vertical spacing is now virtually the same as
>> 0.20.5.
>>
>> As Manuel says the differences with the centre justification are to do
>> with core changes to FOP and so our users are going to have to live with
>> them. I'm sure in some cases the line breaking will look better and in
>> others not so. Hard line breaks definitely provide some level of control
>> over this.
>>
>> Thanks for your help,
>> Stuart
>>
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Upgrade 0.20.5 to 0.95: line spacing increased?
Posted by Skhay <kh...@gmail.com>.
Hi Stuart,
Even im facing the same issue as you have mentioned.
I have upgraded to FOP 0.95 and the new form generated has some of the text
moved to second page becos of bigger line space.
I noticed your resolution of setting line-height-stretch property.
So can you please let me know how you were able to set this property to the
value 1.13?
In my xsl, line-height is given in <fo:block> and when i try adding
line-height-stretch property, it errors out.
Thanks in advance,
Skhay
Stuart Turner wrote:
>
> Hi
>
> Thanks for your quick replies. Thought I'd let you know how I got on. I
> was resigned to trying different options as suggested until I took another
> look at the RTF2FO configuration files. The file options.xml contains
> compatibility settings to tailor the fo output for the different fo to pdf
> converters supported by RTF2FO. Don't know how I missed it the first time
> around but the setting line-height-stretch was exactly what I was looking
> for. I decreased this value for FOP, (from 1.23 to 1.13 in case anyone is
> interested), and the fo output produced now has a correspondingly
> decreased line-height value. Vertical spacing is now virtually the same as
> 0.20.5.
>
> As Manuel says the differences with the centre justification are to do
> with core changes to FOP and so our users are going to have to live with
> them. I'm sure in some cases the line breaking will look better and in
> others not so. Hard line breaks definitely provide some level of control
> over this.
>
> Thanks for your help,
> Stuart
>
>
--
View this message in context: http://old.nabble.com/Upgrade-0.20.5-to-0.95%3A-line-spacing-increased--tp23944243p29178115.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Upgrade 0.20.5 to 0.95: line spacing increased?
Posted by Stuart Turner <st...@salmon.com>.
Hi
Thanks for your quick replies. Thought I'd let you know how I got on. I was
resigned to trying different options as suggested until I took another look
at the RTF2FO configuration files. The file options.xml contains
compatibility settings to tailor the fo output for the different fo to pdf
converters supported by RTF2FO. Don't know how I missed it the first time
around but the setting line-height-stretch was exactly what I was looking
for. I decreased this value for FOP, (from 1.23 to 1.13 in case anyone is
interested), and the fo output produced now has a correspondingly decreased
line-height value. Vertical spacing is now virtually the same as 0.20.5.
As Manuel says the differences with the centre justification are to do with
core changes to FOP and so our users are going to have to live with them.
I'm sure in some cases the line breaking will look better and in others not
so. Hard line breaks definitely provide some level of control over this.
Thanks for your help,
Stuart
--
View this message in context: http://www.nabble.com/Upgrade-0.20.5-to-0.95%3A-line-spacing-increased--tp23944243p23966290.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Upgrade 0.20.5 to 0.95: line spacing increased?
Posted by Pascal SANCHO <pa...@takoma.fr>.
Pascal SANCHO a écrit :
> Hi,
>
> Stuart Turner a écrit :
>> Hi
>>
>> I've upgraded our application to use 0.95 and I have the problem that
>> documents that were formatted to fit on one page are now overflowing
>> onto a
>> second page. It seems that the spacing between lines of text, (and also
>> between other elements), has increased in this version of FOP. I've
>> searched
>> for some kind of parameter that might let me control this but not
>> found any.
>> Is this just a consequence of the rewrite for 0.95 and is there
>> anything I
>> can do about it ? (I notice there are some known issues regarding white
>> space.)
>>
>> Also, centre justification seems to work differently in that words
>> are split
>> differently across lines. In the example documents 0.20.5 fits more
>> words
>> into the first line whereas 0.95 spreads words evenly across all lines.
>>
>> I've attached a sample document that displays both behaviours:
>>
>> quote.fo - the source generated by RTF2FO from a Word RTF document
>> keyfacts.png - included image
>> quote0.20.5.pdf - generated by 0.20.5
>> quote0.95.pdf - generated by 0.95
>>
>> Any help would be appreciated as our users are insisting the spacing
>> issue
>> is solved without changing the original documents. At the moment the
>> only
>> solution I have is to revert to 0.20.5. :(
>>
>> Thanks,
>> Stuart
>>
>> http://www.nabble.com/file/p23944243/quote.fo quote.fo
>> http://www.nabble.com/file/p23944243/keyfacts.png keyfacts.png
>> http://www.nabble.com/file/p23944243/quote0.20.5.pdf quote0.20.5.pdf
>> http://www.nabble.com/file/p23944243/quote0.95.pdf quote0.95.pdf
> FOP 0.20.5 is buggy when computing vertical stacking, height and
> Y-coordinate. Each box is not exactly at the place it should.
> This often result in an unexpected overflow at the bottom of the body,
> worked around by increasing the margin-bottom property.
> FOP 0.9x is more accurate in this area.
> As a test, you can stack 11 lines with a measurable font-size.
> Between the first and the 11th baselines (= 10*line-height), you
> should exactly have 12*font-size (assuming the default line-height is
> unchanged (1.2) and there is no border/space-*/padding between lines).
>
> Pascal
In addition, you cannot have exactly the same output.
You can only play with some properties in order to have approximatively
the same result, with many "try and compare"
- change default line-height
- change space-before/space-after
- use "elastic spacings", with space-*.minimum, .optimum and .maximum
- etc.
Good luck
Pascal
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Upgrade 0.20.5 to 0.95: line spacing increased?
Posted by Pascal SANCHO <pa...@takoma.fr>.
Hi,
Stuart Turner a écrit :
> Hi
>
> I've upgraded our application to use 0.95 and I have the problem that
> documents that were formatted to fit on one page are now overflowing onto a
> second page. It seems that the spacing between lines of text, (and also
> between other elements), has increased in this version of FOP. I've searched
> for some kind of parameter that might let me control this but not found any.
> Is this just a consequence of the rewrite for 0.95 and is there anything I
> can do about it ? (I notice there are some known issues regarding white
> space.)
>
> Also, centre justification seems to work differently in that words are split
> differently across lines. In the example documents 0.20.5 fits more words
> into the first line whereas 0.95 spreads words evenly across all lines.
>
> I've attached a sample document that displays both behaviours:
>
> quote.fo - the source generated by RTF2FO from a Word RTF document
> keyfacts.png - included image
> quote0.20.5.pdf - generated by 0.20.5
> quote0.95.pdf - generated by 0.95
>
> Any help would be appreciated as our users are insisting the spacing issue
> is solved without changing the original documents. At the moment the only
> solution I have is to revert to 0.20.5. :(
>
> Thanks,
> Stuart
>
> http://www.nabble.com/file/p23944243/quote.fo quote.fo
> http://www.nabble.com/file/p23944243/keyfacts.png keyfacts.png
> http://www.nabble.com/file/p23944243/quote0.20.5.pdf quote0.20.5.pdf
> http://www.nabble.com/file/p23944243/quote0.95.pdf quote0.95.pdf
>
FOP 0.20.5 is buggy when computing vertical stacking, height and
Y-coordinate. Each box is not exactly at the place it should.
This often result in an unexpected overflow at the bottom of the body,
worked around by increasing the margin-bottom property.
FOP 0.9x is more accurate in this area.
As a test, you can stack 11 lines with a measurable font-size.
Between the first and the 11th baselines (= 10*line-height), you should
exactly have 12*font-size (assuming the default line-height is unchanged
(1.2) and there is no border/space-*/padding between lines).
Pascal
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org