W3C home > Mailing lists > Public > www-xsl-fo@w3.org > November 2010

Re: Line height vs. line spacing

From: Tony Graham <Tony.Graham@MenteithConsulting.com>
Date: Thu, 11 Nov 2010 11:35:28 +0000
To: www-xsl-fo@w3.org
Message-ID: <87bp5whz3z.fsf@takai.menteithconsulting.com>
On Wed, Nov 10 2010 11:53:30 +0000, mcauthon1980@hotmail.com wrote:
> Trying to now map this onto the corresponding concepts from both the
> CSS and XSL-FO specification, I'm faced with the problem that (by
> defining an appropriate "line-height" on each of my regions and/or
> blocks) I seem to get an additional space at the very end of my
> surrounding block area:
>     First line 
>     [Gap] <---
>     First line 
>     [Gap] <---
>     First line 
>     [Gap] <---
> Though this seems consistent with the fact that "line-height" serves
> to define the height of each line area this block generates, I leaves
> me with the question of how I can get rid of this additional gap at
> the end of each of my blocks?!

Firstly, XSL FO is aligned with CSS2 (plus some CSS2 errata), and in
both, the concept (broadly speaking) is that the difference between the
font height and the line height is divided into two to give the
'half-leading' that can be added before and after each line, so the
notional gaps are more:

    [1/2 Gap] <---
    First line 
    [1/2 Gap] <---
    [1/2 Gap] <---
    First line 
    [1/2 Gap] <---
    [1/2 Gap] <---
    First line 
    [1/2 Gap] <---

Of course, if the line height is constant, the effect is pretty much the
same (except at the top or bottom of a reference area).

Line areas are defined in Section 4.5, Line-areas [1].  The most
applicable properties are font-size [2], line-height [4], and
line-stacking-strategy [4]

The half-leading applies when line-stacking-strategy is 'font-height' or
'max-height' (default).  The XSL formatter doesn't have to support the
'line-height' value, but if it does, you may still see the effect of the
half-leading, depending on what's on the line.

If you want to control the application of the half-leading between
blocks (and if your XSL formatter supports it), you can specify
line-height.precedence, since for a line-stacking-strategy of
'font-height' or 'max-height', the half-leading sets space-before and

If you want to discard the half-leading at the top or bottom of a
reference area, you can set line-height.conditionality (modulo your
other problems with application of .conditionality).


Tony Graham                         Tony.Graham@MenteithConsulting.com
Director                                  W3C XSL FO SG Invited Expert
Menteith Consulting Ltd                               XML Guild member
XML, XSL and XSLT consulting, programming and training
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
Registered in Ireland - No. 428599   http://www.menteithconsulting.com
  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
xmlroff XSL Formatter                               http://xmlroff.org
xslide Emacs mode                  http://www.menteith.com/wiki/xslide
Unicode: A Primer                               urn:isbn:0-7645-4625-2

[1] http://www.w3.org/TR/xsl11/#area-line
[2] http://www.w3.org/TR/xsl11/#font-size
[2] http://www.w3.org/TR/xsl11/#line-height
[2] http://www.w3.org/TR/xsl11/#line-stacking-strategy
Received on Thursday, 11 November 2010 11:35:58 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:58:33 UTC