Re: [xep-support] Padding on blocks

From: W. Eliot Kimber (eliot@isogen.com)
Date: Tue Nov 12 2002 - 03:25:50 PST


Gustaf Liljegren wrote:
> Here's a very basic question. I've hever been able to understand the
> reasoning behind padding on blocks. Here's a template for boxed text:
>
> <xsl:template match="note">
> <fo:block
> padding="2mm"
> border="0.5pt solid black"
> keep-together.within-page="always">
> <xsl:apply-templates/>
> </fo:block>
> </xsl:template>
>
> I'd expect the border around to be aligned with the region boundaries
> (typically region-body), but instead, the text is aligned with the region
> while the border is outside. The border is the outmost part of the block.
> What says it can go outside the region?

This is the subtle interplay of *-indent and margin-*. If you do not
specify an explicit value for the margins, then the content region of
the block is aligned with in the content region of its containing
reference area (e.g., the region body). That means that border and
padding will be outside the content rectangle of the containing region.

If you specify margin-*="0" or specify a value for *-indent, then this
behavior is turned off and the outside of the border rectangle will be
adjacent to the inside of the containing region's content rectangle. The
attached sample FO demonstrates this behavior.

This behavior makes some kind of twisted sense--for example, if in your
layout design, the width of the body region is intended to be the width
of text in the body, then any border-based decoration will not throw off
the positioning of the text. For example, consider the case where you
use border-start on some paragraph blocks to indicate revisions in that
paragraph (a crude form of revision bars):

<fo:block>No border</fo:block>
<fo:block border-start-style="solid" padding-start="6pt"
border-start-width="1pt">Border</fo:block>

With the default behavior (margin and start-indent unspecified) the text
of both blocks will be aligned on the start edge--the border on the
second block will not throw off the indention.

Cheers,

Eliot

-- 
W. Eliot Kimber, eliot@isogen.com
Consultant, ISOGEN International
1016 La Posada Dr., Suite 240
Austin, TX  78752 Phone: 512.656.4139

-------------------
By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html




This archive was generated by hypermail 2.1.5 : Wed Dec 18 2002 - 08:41:28 PST