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

Re: [XSL-FO] vertical alignment in sidebar

Expand Messages
  • Eliot Kimber
    ... When I test your example with XSL Formatter V3 or XEP V4 the line height in the floats is as expected, so it looks like you re seeing a bug in your FO
    Message 1 of 8 , Apr 14, 2006
    • 0 Attachment
      laborde wrote:
      > Okay, sorry. Below I have pasted in the generated FO. I *think* I am
      > doing exactly what you're telling me, but apparently not because it
      > still isn't working. Here, the definition for first-term runs 3 lines in
      > the sidebar, and these lines are double spaced with same spacing between
      > lines as in paragraphs. (Not to mention that the second and third lines
      > of first definition are printing on top of the second definition.)

      When I test your example with XSL Formatter V3 or XEP V4 the line height
      in the floats is as expected, so it looks like you're seeing a bug in
      your FO implementation. You can try putting the property on the
      block-container instead of the float (which is probably the better place
      for it anyway).

      However, in testing this I noticed that unless the float was the first
      thing in the containing block that both XSL Formatter and XEP aligned
      the float with the top of the *next* line.

      I'm not sure why this is the case--I looked over the relevant stuff in
      the XSL and CSS specs and didn't see anything that appeared to obviously
      require this behavior but since both of them do it it's probably correct
      per the spec.

      I was able to put a negative space-before on the block container and
      pull it up to the start of the line I wanted, i.e.:

      space-before="-24pt"
      space-before.conditionality="retain"

      You need to set the conditionality because by default space before is
      conditional and the block container in the side float is the first thing
      in its containing reference area and therefore its space before would be
      discarded by default.

      The 24pt value is 200% of 12pt.

      Cheers,

      E.
      --
      W. Eliot Kimber
      Professional Services
      Innodata Isogen
      9390 Research Blvd, #410
      Austin, TX 78759
      (512) 372-8841

      ekimber@...
      www.innodata-isogen.com
    • laborde
      ... I tried but with no luck, and I m using XEP V4, so the bug has to be me. I apologize. I ve stripped my test files to bare bones, but I must have left
      Message 2 of 8 , Apr 14, 2006
      • 0 Attachment
        Eliot Kimber wrote:
        > When I test your example with XSL Formatter V3 or XEP V4 the line height
        > in the floats is as expected, so it looks like you're seeing a bug in
        > your FO implementation. You can try putting the property on the
        > block-container instead of the float (which is probably the better place
        > for it anyway).
        >
        I tried but with no luck, and I'm using XEP V4, so the bug has to be
        me. I apologize. I've stripped my test files to bare bones, but I must
        have left something that is interfering. I'll start from scratch and
        find it. But I'm very glad you tested this anyway because....
        > However, in testing this I noticed that unless the float was the first
        > thing in the containing block that both XSL Formatter and XEP aligned
        > the float with the top of the *next* line.
        >
        Yes, and I thought that was getting out of line because of the whole
        other line-height issue. I would never have figured out how to fix this.
        Your solution works perfectly. Thank you!
        > You need to set the conditionality because by default space before is
        > conditional and the block container in the side float is the first thing
        > in its containing reference area and therefore its space before would be
        > discarded by default.
        I didn't know and am very glad to learn that. Thanks so much for
        *all* your help.
        Susan
      • laborde
        Elliot, I got it! I was using , which caused the side float text to be double-spaced exactly like the body paragraph text. But the other problem was
        Message 3 of 8 , Apr 17, 2006
        • 0 Attachment
          Elliot, I got it! I was using <fo:inline>, which caused the side float
          text to be double-spaced exactly like the body paragraph text. But the
          other problem was that when 3 or more <term>s occur in one line, the
          side float definitions printed on top of each other. After reading your
          explanation, I realized that besides using the negative value for
          "space-before" to pull up the definition to the correct line, I then
          have to use a larger, positive, "space-after" value--and set the
          conditionality there too--to keep the definitions from running over each
          other. Until you told me, I didn't know about space getting discarded
          by default. Now all the spacing and alignment is perfect. Again, my
          sincere thanks!
          Susan

          ...maybe this is a no-brainer to everyone else, but in case it's useful
          to anyone, here's what I ended up with:

          <xsl:template match="term">
          <xsl:apply-templates/>
          <fo:float float="end" clear="end">
          <fo:block-container inline-progression-dimension="14em"
          font-family="Helvetica" font-size="8pt" font-style="italic"
          start-indent="1em" end-indent="-20em" line-height="8pt"
          space-before="-16pt" space-before.conditionality="retain"
          space-after="21pt" space-after.conditionality="retain">
          <fo:block>
          <xsl:for-each select="//item[@id=current()/@sameAs]">
          <xsl:apply-templates select="name"/>

          <xsl:apply-templates select="gloss"/>

          </xsl:for-each>
          </fo:block>
          </fo:block-container>
          </fo:float>
          </xsl:template>
        Your message has been successfully submitted and would be delivered to recipients shortly.