Bug 47139 - block extra top and bottom padding
Summary: block extra top and bottom padding
Status: CLOSED INVALID
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: 0.95
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-02 08:28 UTC by Simon J Xuereb
Modified: 2012-04-01 13:55 UTC (History)
0 users



Attachments
resulting pdf file with extra unwanted padding (4.82 KB, application/pdf)
2009-05-02 08:28 UTC, Simon J Xuereb
Details
shows extra space in block when placing image (12.42 KB, application/pdf)
2009-05-02 09:42 UTC, Simon J Xuereb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon J Xuereb 2009-05-02 08:28:47 UTC
Created attachment 23595 [details]
resulting pdf file with extra unwanted padding

I am getting extra top and bottom padding to my <fo:block>
I am not including this padding myself. Please see the following code. I attached the resulting pdf. As you see there is slight padding to the top and bottom of my text(and also with images) which i have not included.

<?xml version="1.0" encoding="ISO-8859-1"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="main" page-width="210mm" page-height="297mm">
     <fo:region-body/>
    </fo:simple-page-master>
  </fo:layout-master-set>

  <fo:page-sequence master-reference="main"> 
	<fo:flow flow-name="xsl-region-body">
	<fo:block background-color="pink">3</fo:block>
	</fo:flow>
  </fo:page-sequence>
</fo:root>
Comment 1 Manuel Mall 2009-05-02 08:56:20 UTC
This is normal and expected behaviour. Without this 'padding' characters in consecutive lines would touch or even overlap each other. This spacing between the lines is commonly called half-leading and is calculated from the line-height property which fop sets by default to 1.2em. This means the line height is 120% of the font size. In your example it looks like as if there is more padding at the bottom but again that is expected as room needs to be left for characters extending below the baseline, e.g. 'qpg'.
Comment 2 Simon J Xuereb 2009-05-02 09:42:31 UTC
Created attachment 23596 [details]
shows extra space in block when placing image

shows extra space in block when placing image
Comment 3 Simon J Xuereb 2009-05-02 09:44:29 UTC
The problem is i am getting this extra space even when using an external image.
This is becoming a problem in my layouts. 
Please see code below and attachment.

Thanks


<?xml version="1.0" encoding="ISO-8859-1"?>

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

  <fo:layout-master-set>
    <fo:simple-page-master master-name="main" page-width="210mm" page-height="297mm">
     <fo:region-body/>

    </fo:simple-page-master>
  </fo:layout-master-set>

  <fo:page-sequence master-reference="main">
	<fo:flow flow-name="xsl-region-body">
		<fo:block background-color="pink">
			 <fo:external-graphic src="villa.jpg"/>
		</fo:block>
	</fo:flow>
  </fo:page-sequence>
</fo:root>
Comment 4 Manuel Mall 2009-05-02 16:52:04 UTC
Same and correct behaviour. If you compare your to PDFs you see that the image sits vertically on the same position position as the digit '3' which is the font baseline. Just imagine you have images and text on the same line (and following line). Without the half-leading above and below you wouldn't get the appropriate line spacing. And this behaviour has been discussed many times on the fop-user mailing list as well. Set font-size='0' on your block and it should work.
Comment 5 Simon J Xuereb 2009-05-03 02:12:35 UTC
Yes thanks font-size="0" worked.
Comment 6 Glenn Adams 2012-04-01 13:55:16 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs