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

How is Baseline Position Determined?

Expand Messages
  • Eliot Kimber
    I m trying to translate design specs that specify baseline-to-baseline into reliable FO specifications and I m finding that it may not be possible. What I need
    Message 1 of 3 , Jan 24, 2006
    • 0 Attachment
      I'm trying to translate design specs that specify baseline-to-baseline
      into reliable FO specifications and I'm finding that it may not be possible.

      What I need to be able to do is predict where the baseline for a given
      line of text, usually the first line in a block, will fall relative to
      the before or after edge of the block.

      If I understand the spec, the "baseline start point" is formatter
      determined (Clause 4.5 Line-areas).

      If this is the case then there doesn't seem to be a reliable way to
      predict where the baseline will fall.

      I tried running these FO objects through XSL Formatter V3, XEP V4, and
      AltSoft XML2PDF V3 (Beta) and got slightly different results:


      <fo:block
      background-color="yellow"
      space-after="12pt">Block to give me something to measure
      against.</fo:block>
      <fo:block
      background-color="blue"
      line-height="4pc"
      font-size="16pt"
      color="white"
      >Where is the Baseline?</fo:block>

      Both XEP and XSL Formatter chose essentially identical baseline
      positions, which is slightly below the midpoint of the block and such
      that the midline of the lowercase characters was just above the midline
      of the block, which suggests that the baseline placement might be a
      function of the x-height of the font (which would make sense
      aesthetically but doesn't help me much as x-height varies among fonts
      for the same nominal font size).

      Is my analysis correct (that baseline is unpredicatable) or have I
      missed a subtlety somewhere?

      Thanks,

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

      ekimber@...
      www.innodata-isogen.com
    • G. Ken Holman
      ... The only quantity that has messed me up in the past is the half-leading, as the default leading value is implementation defined. I ve taken control by
      Message 2 of 3 , Jan 24, 2006
      • 0 Attachment
        At 2006-01-24 16:34 -0600, Eliot Kimber wrote:
        >I'm trying to translate design specs that specify baseline-to-baseline
        >into reliable FO specifications and I'm finding that it may not be possible.
        >
        >What I need to be able to do is predict where the baseline for a given
        >line of text, usually the first line in a block, will fall relative to
        >the before or after edge of the block.
        >
        >If I understand the spec, the "baseline start point" is formatter
        >determined (Clause 4.5 Line-areas).
        >
        >If this is the case then there doesn't seem to be a reliable way to
        >predict where the baseline will fall.

        The only quantity that has messed me up in the past is the
        half-leading, as the default leading value is implementation
        defined. I've taken control by specifying line height explicitly and
        then obtained closer results between tools.

        But I confess that I haven't had to count pixels, so I don't know if
        there is a nuance I've missed.

        >Is my analysis correct (that baseline is unpredicatable) or have I
        >missed a subtlety somewhere?

        Before and after each line the formatter will allocate half of the
        leading (a kewl method of accommodating successive lines with
        different font sizes).

        I wonder if you changed line height to "1" (scalars are allowed as
        indications of factor of the font size) if you would get closer
        results because there would then be no leading.

        I hope this helps.

        . . . . . . . . . . . . Ken

        --
        Upcoming XSLT/XSL-FO hands-on courses: Denver,CO March 13-17,2006
        World-wide on-site corporate, govt. & user group XML/XSL training.
        G. Ken Holman mailto:gkholman@...
        Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
        Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
        Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/f/bc
        Legal business disclaimers: http://www.CraneSoftwrights.com/legal
      • Eliot Kimber
        ... I just realized that it doesn t really matter where the baseline as long as you know the line-height of the lines in the blocks involved. For example,
        Message 3 of 3 , Jan 24, 2006
        • 0 Attachment
          Eliot Kimber wrote:
          > I'm trying to translate design specs that specify baseline-to-baseline
          > into reliable FO specifications and I'm finding that it may not be possible.

          I just realized that it doesn't really matter where the baseline as long
          as you know the line-height of the lines in the blocks involved.

          For example, imagine you have two blocks, one with a line height of 12
          points and one with a line height of 18 points and you want a nominal
          baseline-to-baseline distance of 36 points between the last line of the
          first block (block A) and the first line of the second block (B). I
          think that this formula will always work:

          b-to-b - (line-height-A/2 + line-height-B/2)

          This is because the relative positioning of the baselines of both lines
          involved will be the same, regardless of where they actually are placed.

          The bigger challenge would be when the layout is designed in terms of
          distances from a fixed edge to the baseline, top of x-height, or top of
          cap height of a line. That seems to still be unknowable.

          Cheers,

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

          ekimber@...
          www.innodata-isogen.com
        Your message has been successfully submitted and would be delivered to recipients shortly.