Loading ...
Sorry, an error occurred while loading the content.

7275Making FO Lists look like HTML Lists

Expand Messages
  • Shawn
    Nov 3, 2006
    • 0 Attachment
      If you have text within a list-item-body that has a larger font size than
      the list item label (and the other text within the list-item) in FO, It
      aligns the tops of the label and text. Here's the fo:

      <fo:list-block provisional-label-seperation="5pt">
      <fo:list-item keep-with-next="always">
      <fo:list-item-label end-indent="label-end()"
      text-align="right">
      <fo:block>1. </fo:block>
      </fo:list-item-label>
      <fo:list-item-body start-indent="body-start()">
      <fo:block>One</fo:block>
      </fo:list-item-body>
      </fo:list-item>
      <fo:list-item>
      <fo:list-item-label end-indent="label-end()"
      text-align="right">
      <fo:block>2. </fo:block>
      </fo:list-item-label>
      <fo:list-item-body start-indent="body-start()">
      <fo:block>Two</fo:block>
      </fo:list-item-body>
      </fo:list-item>
      <fo:list-item keep-with-previous="always">
      <fo:list-item-label end-indent="label-end()"
      text-align="right">
      <fo:block>3. </fo:block>
      </fo:list-item-label>
      <fo:list-item-body start-indent="body-start()">
      <fo:block>
      <fo:inline>Three</fo:inline>
      <fo:inline font-size="36pt">Big</fo:inline>
      <fo:inline>Three</fo:inline>
      </fo:block>
      </fo:list-item-body>
      </fo:list-item>
      </fo:list-block>

      In HTML, it aligns the bottoms. Here's the html:
      <OL>
      <LI>One</LI>
      <LI>Two</LI>
      <LI>
      <Span>Three</Span><Span style="FONT-SIZE:
      36pt">Big</Span><Span>Three</Span>
      </LI>
      </OL>


      Does any one have any ideas on how to make the fo look like the html? I can
      do it by replacing the fo:block elements inside the list-item-body with
      fo:inline and putting the blocks inside the list-item (ex):

      <fo:list-item keep-with-previous="always">
      <fo:block>
      <fo:list-item-label end-indent="label-end()"
      text-align="right">
      <fo:inline>3. </fo:inline>
      </fo:list-item-label>
      <fo:list-item-body start-indent="body-start()">
      <fo:inline>
      <fo:inline>Three</fo:inline>
      <fo:inline font-size="36pt">Big</fo:inline>
      <fo:inline>Three</fo:inline>
      </fo:inline>
      </fo:list-item-body>
      </fo:block>
      </fo:list-item>

      But if I use embedded lists, it doesn't render correctly -- my fo renderer
      (ibex) says "fo:list-item-label contained in an fo:list-item-body,
      fo:list-item-label should be child of fo:list-item". The label is actually
      a child of the fo:block, which is a child of the list item. As I said, as
      long as I don't use an embedded list that works, but I realize it is bad fo.

      Any ideas on a work-around using proper fo?
    • Show all 7 messages in this topic