You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by James Tauber <jt...@jtauber.com> on 1999/11/30 04:03:44 UTC
basic padding added
I've added very basic support for the padding-{top,left,bottom,right}
properties on blocks.
Padding is necessary, IMO, for good use of background colour.
Here's an example of what you would use in a formatting object tree:
<fo:block
start-indent="20pt"
end-indent="20pt"
space-before.optimum="20pt"
space-after.optimum="20pt"
padding-top="10pt"
padding-bottom="10pt"
padding-left="20pt"
padding-right="20pt"
>...</fo:block>
NOTE:
1. padding works in conjunction with indents and spaces
2. I've only implemented this for blocks
3. at the moment padding can't be used to make extra space (indents+spaces
must be used) only to control how much the background-color extends beyond
the content rectangle.
James
Re: basic padding added
Posted by James Tauber <jt...@jtauber.com>.
> I don't really understand the XSL Spec point of view on padding
> implementation :
> should padding properties decrease the content width ?
I think the spec says yes if indents are specified but no if margins are
specified.
For a top-level block area (one that is directly inside an area container):
start-indent = margin-start + border-start-width + padding-start
start-indent is worked out from the margin, border and padding *or* margin
is worked out from indent, border and padding.
James
Re: basic padding added
Posted by Eric SCHAEFFER <es...@posterconseil.com>.
----- Original Message -----
From: Eric SCHAEFFER <es...@posterconseil.com>
To: <fo...@xml.apache.org>
Sent: Tuesday, November 30, 1999 11:43 AM
Subject: Re: basic padding added
> If it's the case, I think this could be good.
>
> PS : Be careful. When block is in a table, don't override the endIndent
> property...
>
Youps, this is better (I'm doing it in tables too) :
Index: ./src/org/apache/fop/fo/flow/Block.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/org/apache/fop/fo/flow/Block.java,v
retrieving revision 1.8
diff -r1.8 Block.java
155c155,161
< }
---
> }
>
> //// TEST Padding ////
> startIndent += this.paddingLeft;
> endIndent += this.paddingRight;
> //// TEST Padding ////
>
169c175
< endIndent = area.getAllocationWidth() - forcedWidth -
---
> endIndent += area.getAllocationWidth() - forcedWidth -
195c201
<
---
>
205a212,215
> //// TEST Padding ////
> area.addDisplaySpace(this.paddingTop);
> //// TEST Padding ////
>
234a245,248
> //// TEST Padding ////
> area.addDisplaySpace(this.paddingBottom);
> //// TEST Padding ////
>
The command completed successfully.
_______________________________________
Eric SCHAEFFER
eschaeffer@posterconseil.com
POSTER CONSEIL
118 rue de Tocqueville
75017 PARIS
FRANCE
Tel. : 33-140541058
Fax : 33-140541059
_______________________________________
Re: basic padding added
Posted by Eric SCHAEFFER <es...@posterconseil.com>.
If it's the case, I think this could be good.
PS : Be careful. When block is in a table, don't override the endIndent
property...
Eric.
Index: ./src/org/apache/fop/fo/flow/Block.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/org/apache/fop/fo/flow/Block.java,v
retrieving revision 1.8
diff -r1.8 Block.java
155c155,161
< }
---
> }
>
> //// TEST Padding ////
> startIndent += this.paddingLeft;
> endIndent += this.paddingRight;
> //// TEST Padding ////
>
169c175
< endIndent = area.getAllocationWidth() - forcedWidth -
---
> endIndent += area.getAllocationWidth() - forcedWidth -
195c201
<
---
>
205a212,215
> //// TEST Padding ////
> blockArea.addDisplaySpace(this.paddingTop);
> //// TEST Padding ////
>
231a242,245
> //// TEST Padding ////
> blockArea.addDisplaySpace(this.paddingBottom);
> //// TEST Padding ////
>
The command completed successfully.
_______________________________________
Eric SCHAEFFER
eschaeffer@posterconseil.com
POSTER CONSEIL
118 rue de Tocqueville
75017 PARIS
FRANCE
Tel. : 33-140541058
Fax : 33-140541059
_______________________________________
----- Original Message -----
From: Eric SCHAEFFER <es...@posterconseil.com>
To: <fo...@xml.apache.org>
Sent: Tuesday, November 30, 1999 11:30 AM
Subject: Re: basic padding added
> I don't really understand the XSL Spec point of view on padding
> implementation :
> should padding properties decrease the content width ?
>
> Eric.
>
> _______________________________________
>
> Eric SCHAEFFER
> eschaeffer@posterconseil.com
>
> POSTER CONSEIL
> 118 rue de Tocqueville
> 75017 PARIS
> FRANCE
> Tel. : 33-140541058
> Fax : 33-140541059
> _______________________________________
>
> ----- Original Message -----
> From: James Tauber <jt...@jtauber.com>
> To: <fo...@xml.apache.org>
> Sent: Tuesday, November 30, 1999 4:03 AM
> Subject: basic padding added
>
>
> > I've added very basic support for the padding-{top,left,bottom,right}
> > properties on blocks.
> >
> > Padding is necessary, IMO, for good use of background colour.
> >
> > Here's an example of what you would use in a formatting object tree:
> >
> > <fo:block
> > start-indent="20pt"
> > end-indent="20pt"
> > space-before.optimum="20pt"
> > space-after.optimum="20pt"
> > padding-top="10pt"
> > padding-bottom="10pt"
> > padding-left="20pt"
> > padding-right="20pt"
> > >...</fo:block>
> >
> > NOTE:
> >
> > 1. padding works in conjunction with indents and spaces
> > 2. I've only implemented this for blocks
> > 3. at the moment padding can't be used to make extra space
(indents+spaces
> > must be used) only to control how much the background-color extends
beyond
> > the content rectangle.
> >
> > James
> >
>
Re: basic padding added
Posted by Eric SCHAEFFER <es...@posterconseil.com>.
I don't really understand the XSL Spec point of view on padding
implementation :
should padding properties decrease the content width ?
Eric.
_______________________________________
Eric SCHAEFFER
eschaeffer@posterconseil.com
POSTER CONSEIL
118 rue de Tocqueville
75017 PARIS
FRANCE
Tel. : 33-140541058
Fax : 33-140541059
_______________________________________
----- Original Message -----
From: James Tauber <jt...@jtauber.com>
To: <fo...@xml.apache.org>
Sent: Tuesday, November 30, 1999 4:03 AM
Subject: basic padding added
> I've added very basic support for the padding-{top,left,bottom,right}
> properties on blocks.
>
> Padding is necessary, IMO, for good use of background colour.
>
> Here's an example of what you would use in a formatting object tree:
>
> <fo:block
> start-indent="20pt"
> end-indent="20pt"
> space-before.optimum="20pt"
> space-after.optimum="20pt"
> padding-top="10pt"
> padding-bottom="10pt"
> padding-left="20pt"
> padding-right="20pt"
> >...</fo:block>
>
> NOTE:
>
> 1. padding works in conjunction with indents and spaces
> 2. I've only implemented this for blocks
> 3. at the moment padding can't be used to make extra space (indents+spaces
> must be used) only to control how much the background-color extends beyond
> the content rectangle.
>
> James
>