Leader examples
fo:leader is mainly used a) in table-of-contents to generate sequences of "." glyphs that separate titles from page numbers
b) to create entry fields in fill-in-the-blank forms c) to create horizontal rules for use as separators. You
define the look and use of fo:leader with the property "leader-pattern". It can have the following values: a) space. This
just creates an space. b) dots. This creates a sequence of "." c) rule. This creates a line. d) use-content. This creates a
repeating pattern of the content of fo:leader.
The dimensions of fo:leader are determined by the compound property leader-length. It consists of the
3 sub values: leader-length.minimum (default = 0), leader-length.optimum (default = 12pt), leader-length.maximum
(default = 100%). If you want to make sure, that leader-length has a fixed size, you should use the compound
property (p.e. leader-length="5cm"). If you want to fill the rest of the remaining space with dots in a table of
content, you can use the default values.
leader with leader-pattern="space"
Entry 1
p. 12
Entry 2
p. 24
Left side
middle
right side
Using fo:leader with leader-pattern="dots"
There are two properties which allow you to specify the looks of the dotted line. First
"leader-pattern-width". It specifies the length of one dot and the space up to the next dot.
Second leader-alignment. It can be used to make sure, the dots in different lines are parallel (only value "reference-area"
is supported).
Entry 1
p. 12
Entry 2
p. 24
Using fo:leader with leader-pattern="dots" and leader-pattern-width="5pt" and "8pt"
Entry 1
p. 12
Entry 2
p. 24
Entry 1
p. 12
Entry 2
p. 24
Using fo:leader with leader-pattern="dots" in a list
Using fo:leader with leader-pattern="dots", leader-pattern-width="5pt" and "8pt", leader-alignment="reference-area"
Entry 1
p. 12
Entry 2
p. 24
Entry 3 is longer
p. 36
Entry 4 is even longer
p. 48
1
p. 12
Entry 2
p. 24
Entry 3 is longer
p. 36
Entry 4 is even longer
p. 48
·Entry 1
p. 12
·Entry 2
p. 24
Using fo:leader with leader-pattern="dots" in a table
Entry 1p. 12Entry 2 p. 24Entry 3 p. 36
Table of Content
shows the use of leader properties in combination to build a table of content.
Following values are used for the leader:
leader-pattern="dots"
leader-pattern-width="8pt"
leader-alignment="reference-area"
no leader-length is specified, so the default values are used (min: 0, opt: 12pt, max: 100%)
A) This is some longer sample text1B) Some text2C) Text3D) This text is even longer than the first entry 4E) Shorter text example5
Leader with leader-pattern="rule"
text before the rule (start)
text after the rule
text before the rule (center)
text after the rule
text before the rule (end)
text after the rule
Here are some fo:leader with the property rule and different rule styles
(solid, dashed, dotted, double, groove, ridge the last one with colored backgrounds
to the effect)
Here are 4 fo:leader with increasing rule-thickness (1pt, 2pt, 3pt, 4pt)
Here are 4 fo:leader with increasing rule-thickness (1pt, 2pt, 3pt, 4pt) and leader-length: 25%, 50%, 75%, 100%
Using leader in combination with justified text
Here is some longer text. Here is some longer text.
Here is some longer text. Here comes the leader (dots width 8pt):
Here is some longer text. Here is some longer text.
Here is some longer text. Here is some longer text. Here is some longer text.
Here is some longer text. Here is some longer text.
Here is some longer text. Here comes the leader (dots width 5pt):
Here is some longer text. Here is some longer text.
Here is some longer text. Here is some longer text. Here is some longer text.
Here is some longer text. Here is some longer text.
Here is some longer text. Here comes the leader (dots):
Here is some longer text. Here is some longer text.
Here is some longer text. Here is some longer text. Here is some longer text.
Here is some longer text. Here is some longer text.
Here is some longer text. Here comes the leader (rule):
Here is some longer text. Here is some longer text.
Here is some longer text. Here is some longer text. Here is some longer text.
Here is some longer text. Here is some longer text.
Here is some longer text. Here comes the leader (space):
Here is some longer text. Here is some longer text.
Here is some longer text. Here is some longer text. Here is some longer text.
Use-Content
The following examples show Leader with "use-content".
The inline areas from the context of the leader are
repeated until the length of the leader. The
"leader-pattern-width" can be used to set the width
of each repeated pattern element.
If this width is less than the inline areas then the width
of the inline areas is used.Characters:
abcdEnd
Set width:
abcdEnd
Small Width:
abcdEnd
SVG:
End
Mixed:
abc
End
Mixed:
abc
def
End