5.4 Leaders

5.4 Leaders

5.4.1 Elastic and inelastic inline areas

A leader provides the stylesheet writer with a number of basic features

  • fixed-length horizontal rules or patterns, typically used as separators between information,

  • elastic leader rules or patterns, used in tables of contents to aid the eye movement across a page,

  • elastic inline gaps, used to push away adjacent areas.

Example 5-7 Link constructs in example
 Line 01 <block text-align-last="justify"       02        end-indent="1cm" start-indent="1cm">      03  <basic-link internal-destination="N66">Third Title</basic-link>  04   <leader leader-pattern="dots"/>       05  <basic-link internal-destination="N66">  06     <page-number-citation ref-id="N66"/>      07  </basic-link>  08 </block>      09 ...      10 <block space-before="10pt" text-align-last="justify"       11        end-indent="1cm" start-indent="1cm">      12  <basic-link internal-destination="N1">Page count</basic-link>  13   <leader leader-pattern="dots"/>       14  <basic-link internal-destination="N1">  15     <page-number-citation ref-id="N1"/>      16  </basic-link>  17 </block>      18 ...      19 <page-sequence master-reference="bookpage">      20   <title>The Third Chapter Title</title>      21   <flow flow-name="bookpage-body">      22     <block id="N66" font-size="16pt * 1.5">Third Title</block>      23       24     <block space-before="16pt">Third entry is very short.</block>      25     <block id="N1"/>      26   </flow>      27 </page-sequence> 

leader is an inline construct that stretches a leader along the text baseline of the line.

  • It must be put into a standalone block to act as a block construct.

    • Note that the default line height of the block is the font size, not the line height of the highest construct;

    • without specifying a small line height on the block, adjacent blocked lines will not appear close together.

  • All leaders on a justified line are expanded before any space character or inter-character space on the line is expanded.

    • Expansion grows evenly across all leaders on the line until the line is full.

    • No justification expansion is done on any space characters or inter-character spacing.

When running a leader from one margin to the other margin, you must use the text-align-last property on the containing block.

  • Using text-align with the value " justify " is insufficient because the line of a single-line block is considered the last line of the block.

  • The leader grows between the information at the start of the line and the information at the end of the line, e.g.:

    • a dot leader, as used in table of contents entries,

    • an empty leader, used to push two pieces of information to the ends of a line.

Figure 5-2 illustrates leaders;

  • block-level leaders are used as separators and decoration;

    • there are special block-level considerations for tightly- spaced leaders;

    • block-level leaders need not be full block width;

  • title entries are short;

    • leaders expand between end of title and start of page number.

Figure 5-10 illustrates formatting requirements for a complex table of contents.

  • The author of the XML being formatted is responsible for the length of titles.

  • The stylesheet is collecting and presenting the titles in a table of contents.

  • Short titles are easily accommodated through simple margin specifications.

  • If the user could possibly create long titles, the stylesheet writer should be prepared to accommodate wrapping conditions to avoid confusion when reading the table.

    • Wrapping at the start of the line could make it difficult to count the entries in the table of contents;

      • the wrapping point should be indented on the start side.

    • Wrapping at the end of the line could clash with the presentation of page numbers ;

      • the wrapping point should be indented on the end side.

  • A block's first and last lines can be hanging in respective outdents to give the desired unambiguous presentation at the starts and ends of the lines.

Figure 5-10. Example for long leaders

graphics/05fig10.gif

Note that the borders of the block are shown only to illustrate the size of the block construct itself; this was done simply by turning on the border-style ="solid" property.

  • The indents of the first and last lines of the block are clearly shown to be outside the dimensions of the block.

Multiple-line table-of-contents-entry blocks are more complex than single-line blocks, as shown in Figure 5-11.

  • There are special considerations for overhanging first and last lines of block;

    • negative values for indents specify outdents and allow the content to go beyond the boundaries of the box.

  • You can also specify text alignment for the body of the block.

Figure 5-11. Properties of blocks utilizing leaders

graphics/05fig11.gif

Of note:

  • the last line is justified in order to grow the leader to the complete width of the last line including the outdent;

  • the net indents of the first and last line are the differences between the indents of the block and the respective outdents of the first and last line.

5.4.2 Multiple leaders on a single line

When using multiple leaders on a single line, the length of each leader grows evenly in tandem, as shown in Figure 5-12.

  • The length of all leaders on a single justified line is the same.

  • Lengths grow until the line is filled.

  • This cannot be used to reliably position a middle area of content to the center of the line;

    • this only positions a middle area of content to the center of the closest edges of the two surrounding areas;

    • The middle area will then only be centered on the page if the content at the start and end edges happens to be of equal length.

Figure 5-12. Using multiple leaders on a single line

graphics/05fig12.gif

5.4.3 Controlling the distance between leaders

The intuitive approach to controlling the distance between lines does not apply, as shown in Figure 5-13.

  • Consider two standalone leaders that necessarily require two standalone blocks, one leader in each block, as in Figure 5-2.

  • The line height of the block is governed by block properties and by default is the maximum of the font size and any inline constructs found on the line.

  • It is intuitive to adjust the line height of the leader, but if that line height is less than the line height of the block, there will be no change in the result because the line height of the block will govern the placement of the leaders.

Figure 5-13. Controlling the distance between leaders

graphics/05fig13.gif

It is important to keep font size consistent when positioning adjacent lines.

  • Leaders are drawn along the font baseline.

  • Changing the line height does not change the font size.

  • Changing the font size will change both the distance between the alignment point and the baseline and the height of the line in the block.

  • Changing only the line height will not change the distance between the alignment point and the baseline.

  • More consistent distances are rendered when only changing one variable instead of two.

5.4.4 The leader object

Purpose
  • This is the inline display of a rule or a sequence of glyphs.

    • This object can be placed in a block object for block-level display.

Content
  • ( 6.6.9 ) (#PCDATA %inline;)* ,

  • child object:

    • %inline; ( 6.2 ; 70),

  • no leader , inline-container , block-container , float , footnote , or marker objects as a child or descendant.

Property sets
  • Common accessibility properties ( 7.4 ; 326),

  • common aural properties ( 7.6 ; 327),

  • common border, padding, and background properties ( 7.7 ; 328),

  • common font properties ( 7.8 ; 331),

  • common margin properties inline ( 7.11 ; 333),

  • common relative position properties ( 7.12 ; 333).

Other optional properties
  • alignment-adjust ( 7.13.1 ; 346),

  • alignment-baseline ( 7.13.2 ; 346),

  • baseline-shift ( 7.13.3 ; 351),

  • color ( 7.17.1 ; 369),

  • dominant-baseline ( 7.13.5 ; 374),

  • id ( 7.28.2 ; 384),

  • keep-with- next ( 7.19.4 ; 386),

  • keep-with-previous ( 7.19.5 ; 387),

  • leader-alignment ( 7.21.1 ; 388),

  • leader-length ( 7.21.4 ; 388),

  • leader-pattern ( 7.21.2 ; 388),

  • leader-pattern-width ( 7.21.3 ; 389),

  • letter-spacing ( 7.16.2 ; 389),

  • line-height ( 7.15.4 ; 390),

  • rule-style ( 7.21.5 ; 411),

  • rule- thickness ( 7.21.6 ; 411),

  • text-altitude ( 7.27.4 ; 421),

  • text-depth ( 7.27.5 ; 422),

  • text-shadow ( 7.16.5 ; 423),

  • visibility ( 7.28.8 ; 425),

  • word-spacing ( 7.16.8 ; 428).

Shorthands influencing the above properties
  • font ( 7.29.13 ; 377),

  • page-break-after ( 7.29.16 ; 401),

  • page-break-before ( 7.29.17 ; 401),

  • vertical-align ( 7.29.22 ; 424).

Property of note
  • The line-height property of the leader does not impact the line-height property of the containing block.

    • It may be necessary to adjust the line-height property of the block to achieve the desired result.

An excerpt from Figure 5-2 is shown in Example 5-8.

Example 5-8 Leader constructs in Figure 5-2
 Line 01 <block font-weight="bold" font-size="16pt * 2"       02   text-align="center">The Leader/Link/Graphic Example</block>      03       04 <block line-height="3px">      05  <leader leader-pattern="rule" leader-length="100%"/>  06 </block>      07 <block line-height="3px">      08  <leader leader-pattern="rule" leader-length="100%"/>  09 </block>      10 <block>      11  <leader leader-pattern="rule" leader-length="100%"/>  12 </block>      13 <block line-height="3px">      14  <leader leader-pattern="rule" leader-length="100%"/>  15 </block>      16 <block line-height="3px">      17  <leader leader-pattern="rule" leader-length="100%"/>  18 </block>      19 ...      20 <block text-align-last="justify" end-indent="1cm" start-indent="1cm">      21   <basic-link internal-destination="N9">First Title</basic-link>      22  <leader leader-pattern="dots"/>  23   <basic-link internal-destination="N9">      24     <page-number-citation ref-id="N9"/>      25   </basic-link>      26 </block>      27 ...      28 <block space-before="10pt" text-align="center">      29  <leader leader-pattern="rule" leader-length="60%"/>  30 </block> 

An excerpt from Figure 5-10 is shown in Example 5-9.

Example 5-9 Complex leader example
 Line 01 <block text-align-last="justify" border-style="solid"       02        start-indent="5cm" end-indent="5cm"      03        text-indent="-2cm" last-line-end-indent="-2cm">      04   <inline>This is another very long title that will be       05 wrapping over at least three lines in order to indicate a       06 very long title</inline>      07  <leader leader-pattern="dots"/>  08   <inline>2</inline>      09 </block>      10       11 <block text-align-last="justify"       12        start-indent="5cm" end-indent="5cm"      13        text-indent="-2cm" last-line-end-indent="-2cm">      14   <inline>This is short</inline>      15  <leader leader-pattern="dots"/>  16   <inline>3</inline>      17 </block>      18       19 <block text-align-last="justify" text-align="justify"      20        start-indent="5cm" end-indent="5cm"      21        text-indent="-2cm" last-line-end-indent="-2cm">      22   <inline>This is a final very long title that will be       23 wrapping over at least three lines in order to indicate a       24 very long title</inline>      25  <leader leader-pattern="dots"/>  26   <inline>4</inline>      27 </block> 


Definitive XSL-FO
Definitive XSL-FO
ISBN: 0131403745
EAN: 2147483647
Year: 2002
Pages: 99
Authors: G. Ken Holman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net