leaders

1. leader alignment, inline direction.
2. Drawing a vertical line
3. Table of contents using fo:leader
4. Dot leaders, as found in index
5. Line breaks in the right place

1.

leader alignment, inline direction.

Ken Holman


>In my XSL file I have defined a leader, this leader appears at the bottom 
>of a line,
>but I like it to appear at the top of the line.
>I tried the attributes leader-alignment="middle" and 
>"top"  alignment-baseline="middle" and "top" but it does not work.

To align inline-level constructs, one uses alignment-adjust= ... The third leader is drawn at the top of line.


   <block>This is a test</block>
   <block text-align-last="justify">
     ABC<leader leader-pattern="rule"/>DEF
   </block>
   <block>This is a test</block>
   <block text-align-last="justify">
     ABC<leader leader-pattern="rule" alignment-adjust="after-edge"/>DEF
   </block>
   <block>This is a test</block>
   <block text-align-last="justify">
     ABC<leader leader-pattern="rule" alignment-adjust="before-edge"/>DEF
   </block>
   <block>This is a test</block>

2.

Drawing a vertical line

Eliot Kimber

You can try using a leader w/in a rotated block container, e.g.:

<fo:block-container
     position="absolute"
     reference-orientation="90"
     inline-progression-dimension="15.2cm"
     block-progression-dimension="12mm"
 >
  <fo:block>
   <fo:leader leader-pattern="rule"
       leader-length="15cm"
       rule-style="solid"
       rule-thickness="1cm"/>
  </fo:block>
</fo:block-container>

When I render this example with XSL Formatter 2.5 and measure the resulting rule in Acrobat using PitStop Pro, I get a 15cm x 1cm vertical box.

3.

Table of contents using fo:leader

Eliot Kimber



  >I am having a tough time getting the page number references to work in
  >a table of contents. Within the contents I am formatting it like this:
  >
  ><fo:block start-indent="10pt"
  >       text-align-last="justify">Modeling Applications
  >       <fo:leader leader-pattern="dots"
  >           leader-alignment="reference-area">
  >         <fo:page-number-citation ref-id="IntroModel"/>
  >       </fo:leader>
  ></fo:block>

You've put the page number citation inside the leader. You want this:

<fo:leader leader-pattern="dots"
	leader-alignment="reference-area"/>
<fo:page-number-citation ref-id="IntroModel"/>

fo:leader only uses its content if you specify leader-patter="use-content".

4.

Dot leaders, as found in index

Ken Holman



>Desired layout is
>
>[date][free text field, long or short][leader][amount] I.e. typical 
>index formatting.
>
>E.g.
>
>12 Nov short free text ................... 12.50
>13 Nov long free text which causes a wrap
>        to here ........................... 13.50
>14 Nov the nasty one with just enough txt.
>                                            14.50
>
>I.e. the text is just enough to cause the wrap,
>     yet the leader is on the first line.
>
>Problem,
>
>How to manage the line wrap.
>...

I recommend using outdents on both the first and last line, using indents for the wrap edge positions, thus ensuring your desired gaps in a single formatting object:

For example, the simplest would be:

<fo:block font-size="18pt" font-weight="normal"
          space-before="1em" start-indent="4.5em" text-indent="-4.5em"
          text-align-last="justify" end-indent="4.5em"
          last-line-end-indent="-4.5em">19NOV<fo:inline 
          padding-end="1em"/>PAYMENT,  THANK YOU. Add lots more
          content 
       to make it flow<fo:leader font-size="8pt"
        leader-pattern="use-content">.</fo:leader>600.00</fo:block>
      </fo:block>

5.

Line breaks in the right place

Suyoshi Shirotori

> When the title is too long to have the text fit, I want the long word
> that is the identifier pushed onto the next line, e.g.:

> A very very very very very very very..............................
> .............................ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789

Use two fo:leader as follows.

<fo:block start-indent="5pc" text-align="justify" 
   text-align-last="justify">
    <fo:wrapper>
A very very very very very very very very long label</fo:wrapper>
    <fo:leader leader-pattern="dots"/>
    <fo:inline keep-together.within-line="always">
        <fo:leader leader-pattern="dots"/>
        <fo:wrapper>ABCDEFGHIJKLMNOPQRSTUVWYZ:0123456789</fo:wrapper>
 </fo:inline>
  </fo:block>

> Can you tell me why I need 2 leaders? I want to understand
> the XSL-FO spec. About fo:leader, the spec says that the leader object
> "generates and returns a single normal inline-area". Do lines always
> break between normal inline-areas?

fo:leader generates inline-area. Note that it is not line area. Therefore, line break is not performed in inline area.