I have attached an fo file (actually a testcase) and the generated pdf. 
It exercises some more involved alignment-baseline, nested inlines and 
baseline table rescaling combinations.

I would appreciate if others could cast their eye over it and check it 
for possible mistakes or different interpretations. It looks OK to me 
but as the discussions on the space resolution shows there is always 
the possibility of different views how the spec is to be understood.

Thanks

Manuel
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2005 The Apache Software Foundation

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- $Id: inline_letter-spacing.xml 265720 2005-09-01 13:29:28Z jeremias $ -->
<testcase>
  <info>
    <p>
      This test checks inline level alignment-baseline for nested inlines.
    </p>
  </info>
  <fo>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"; xmlns:svg="http://www.w3.org/2000/svg";>
      <fo:layout-master-set>
        <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
          <fo:region-body/>
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="normal" white-space-collapse="true" font-family="sans-serif">
        <fo:flow flow-name="xsl-region-body">
          <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
            <fo:inline font-size="50%" 
                background-color="yellow">alphabetic
              <fo:inline font-size="150%" background-color="red">alphabetic</fo:inline>
            </fo:inline>
             Big <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
          </fo:block>
          <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
            <fo:inline font-size="50%" 
                dominant-baseline="reset-size"
                background-color="yellow">alphabetic
              <fo:inline font-size="150%" background-color="red">alphabetic</fo:inline>
            </fo:inline>
            Big <fo:inline font-size="8pt">Baseline table changed</fo:inline>
          </fo:block>
          <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
            <fo:inline font-size="50%"
                alignment-baseline="hanging" 
                background-color="yellow">hanging
              <fo:inline font-size="50%" background-color="red" alignment-baseline="middle">middle</fo:inline>
            </fo:inline>
            Big <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
          </fo:block>
          <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
            <fo:inline font-size="50%"
               dominant-baseline="reset-size"
               alignment-baseline="hanging"
               background-color="yellow">hanging
              <fo:inline font-size="50%" background-color="red" alignment-baseline="middle">middle</fo:inline>
            </fo:inline>
            Big <fo:inline font-size="8pt">Baseline table changed</fo:inline>
          </fo:block>
          <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
            <fo:inline font-size="50%" 
                alignment-baseline="text-before-edge"
                background-color="yellow">text-before-edge
              <fo:inline font-size="150%" background-color="red" alignment-baseline="after-edge">after-edge</fo:inline>
            </fo:inline>
             Big <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
          </fo:block>
          <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
            <fo:inline font-size="50%" 
                dominant-baseline="reset-size"
                alignment-baseline="text-before-edge" 
                background-color="yellow">text-before-edge
              <fo:inline font-size="150%" background-color="red" alignment-baseline="after-edge">after-edge</fo:inline>
            </fo:inline>
            Big <fo:inline font-size="8pt">Baseline table changed</fo:inline>
          </fo:block>
          <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
            <fo:inline font-size="25%" 
                alignment-baseline="central"
                background-color="yellow">central
              <fo:inline font-size="150%"
                  alignment-baseline="text-before-edge"
                  background-color="red">text-before-edge
                <fo:inline font-size="200%" background-color="green">alphabetic</fo:inline>
              </fo:inline>
            </fo:inline>
            Big <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
          </fo:block>
          <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
            <fo:inline font-size="25%" 
                dominant-baseline="reset-size"
                alignment-baseline="central"
                background-color="yellow">central
              <fo:inline font-size="150%"
                  alignment-baseline="text-before-edge"
                  background-color="red">text-before-edge
                <fo:inline font-size="200%" background-color="green">alphabetic</fo:inline>
              </fo:inline>
            </fo:inline>
            Big <fo:inline font-size="8pt">Baseline table changed</fo:inline>
          </fo:block>
          <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
            <fo:inline font-size="25%" 
                dominant-baseline="reset-size"
                alignment-baseline="central"
                background-color="yellow">central
              <fo:inline font-size="150%"
                  dominant-baseline="reset-size"
                  alignment-baseline="text-before-edge"
                  background-color="red">text-before-edge
                <fo:inline font-size="200%" background-color="green">alphabetic</fo:inline>
              </fo:inline>
            </fo:inline>
            Big <fo:inline font-size="8pt">Baseline table changed twice</fo:inline>
          </fo:block>
          <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
            <fo:inline font-size="50%" 
                dominant-baseline="reset-size"
                alignment-baseline="before-edge" 
                background-color="yellow">before-edge
              <fo:inline font-size="150%" background-color="red" alignment-baseline="after-edge">after-edge</fo:inline>
            </fo:inline>
            Big <fo:inline font-size="8pt">This is over constraint</fo:inline>
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </fo>
  <checks>
  <!-- Dummy check only -->
    <eval expected="360000" xpath="//flow/block[1]/@ipd"/>
  </checks>
</testcase>

Attachment: inline_alignment-baseline_4.xml.pdf
Description: Adobe PDF document

Reply via email to