123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You 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$ -->
- <testcase>
- <info>
- <p>
- This test checks element generation for various spaces.
- </p>
- </info>
- <fo>
- <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
- <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">
- <fo:flow flow-name="xsl-region-body">
- <!-- for nbsp see block_white-space_2 and block_white-space_3 -->
- <fo:block>
- <fo:block background-color="yellow" id="l-sp">« text text »<fo:inline font-style="italic"> (normal space)</fo:inline></fo:block>
- <fo:block background-color="orange" id="l-thin-space">« text text »<fo:inline font-style="italic"> (thin space, &#x2009;)</fo:inline></fo:block>
- <fo:block background-color="yellow" id="l-hair-space">« text text »<fo:inline font-style="italic"> (hair space, &#x200A;)</fo:inline></fo:block>
- <fo:block background-color="orange" id="l-zwsp">«​text text​»<fo:inline font-style="italic"> (zero width space, &#x200B;)</fo:inline></fo:block>
- <fo:block background-color="yellow" id="l-nosp">«text text»<fo:inline font-style="italic"> (no spaces)</fo:inline></fo:block>
- </fo:block>
- <fo:block space-before="2mm" text-align="center">
- <fo:block background-color="yellow" id="c-sp">« text text »<fo:inline font-style="italic"> (normal space)</fo:inline></fo:block>
- <fo:block background-color="orange" id="c-thin-space">« text text »<fo:inline font-style="italic"> (thin space, &#x2009;)</fo:inline></fo:block>
- <fo:block background-color="yellow" id="c-hair-space">« text text »<fo:inline font-style="italic"> (hair space, &#x200A;)</fo:inline></fo:block>
- <fo:block background-color="orange" id="c-zwsp">«​text text​»<fo:inline font-style="italic"> (zero width space, &#x200B;)</fo:inline></fo:block>
- <fo:block background-color="yellow" id="c-nosp">«text text»<fo:inline font-style="italic"> (no spaces)</fo:inline></fo:block>
- </fo:block>
- <fo:block space-before="2mm" text-align="justify" text-align-last="justify">
- <fo:block background-color="yellow" id="j-sp">« text text »<fo:inline font-style="italic"> (normal space)</fo:inline></fo:block>
- <fo:block background-color="orange" id="j-thin-space">« text text »<fo:inline font-style="italic"> (thin space, &#x2009;)</fo:inline></fo:block>
- <fo:block background-color="yellow" id="j-hair-space">« text text »<fo:inline font-style="italic"> (hair space, &#x200A;)</fo:inline></fo:block>
- <fo:block background-color="orange" id="j-zwsp">«​text text​»<fo:inline font-style="italic"> (zero width space, &#x200B;)</fo:inline></fo:block>
- <fo:block background-color="yellow" id="j-nosp">«text text»<fo:inline font-style="italic"> (no spaces)</fo:inline></fo:block>
- </fo:block>
- <fo:block space-before="2mm" text-align="justify" text-align-last="justify" letter-spacing="2pt">
- <fo:block background-color="yellow" id="lsj-sp">« text text »<fo:inline font-style="italic"> (normal space)</fo:inline></fo:block>
- <fo:block background-color="orange" id="lsj-thin-space">« text text »<fo:inline font-style="italic"> (thin space, &#x2009;)</fo:inline></fo:block>
- <fo:block background-color="yellow" id="lsj-hair-space">« text text »<fo:inline font-style="italic"> (hair space, &#x200A;)</fo:inline></fo:block>
- <fo:block background-color="orange" id="lsj-zwsp">«​text text​»<fo:inline font-style="italic"> (zero width space, &#x200B;)</fo:inline></fo:block>
- <fo:block background-color="yellow" id="lsj-nosp">«text text»<fo:inline font-style="italic"> (no spaces)</fo:inline></fo:block>
- </fo:block>
- </fo:flow>
- </fo:page-sequence>
- </fo:root>
- </fo>
- <checks>
- <eval expected="62040" xpath="//block[@prod-id='l-sp']/lineArea/text/@ipd"/>
- <eval expected="word" xpath="local-name(//block[@prod-id='l-sp']/lineArea/text/*[1])"/>
- <eval expected="space" xpath="local-name(//block[@prod-id='l-sp']/lineArea/text/*[2])"/>
- <eval expected="word" xpath="local-name(//block[@prod-id='l-sp']/lineArea/text/*[3])"/>
- <eval expected="space" xpath="local-name(//block[@prod-id='l-sp']/lineArea/text/*[4])"/>
- <eval expected="word" xpath="local-name(//block[@prod-id='l-sp']/lineArea/text/*[5])"/>
- <eval expected="space" xpath="local-name(//block[@prod-id='l-sp']/lineArea/text/*[6])"/>
- <eval expected="word" xpath="local-name(//block[@prod-id='l-sp']/lineArea/text/*[7])"/>
- <true xpath="not(//block[@prod-id='l-sp']/lineArea/text/*[2]/@adj = 'false')"/>
- <true xpath="not(//block[@prod-id='l-sp']/lineArea/text/*[6]/@adj = 'false')"/>
-
- <eval expected="60168" xpath="//block[@prod-id='l-thin-space']/lineArea/text/@ipd"/>
- <eval expected="word" xpath="local-name(//block[@prod-id='l-thin-space']/lineArea/text/*[1])"/>
- <eval expected="space" xpath="local-name(//block[@prod-id='l-thin-space']/lineArea/text/*[2])"/>
- <eval expected="word" xpath="local-name(//block[@prod-id='l-thin-space']/lineArea/text/*[3])"/>
- <eval expected="space" xpath="local-name(//block[@prod-id='l-thin-space']/lineArea/text/*[4])"/>
- <eval expected="word" xpath="local-name(//block[@prod-id='l-thin-space']/lineArea/text/*[5])"/>
- <eval expected="space" xpath="local-name(//block[@prod-id='l-thin-space']/lineArea/text/*[6])"/>
- <eval expected="word" xpath="local-name(//block[@prod-id='l-thin-space']/lineArea/text/*[7])"/>
- <true xpath="//block[@prod-id='l-thin-space']/lineArea/text/*[2]/@adj = 'false'"/>
- <true xpath="//block[@prod-id='l-thin-space']/lineArea/text/*[6]/@adj = 'false'"/>
-
- <eval expected="57768" xpath="//block[@prod-id='l-hair-space']/lineArea/text/@ipd"/>
- <true xpath="//block[@prod-id='l-hair-space']/lineArea/text/*[2]/@adj = 'false'"/>
- <true xpath="//block[@prod-id='l-hair-space']/lineArea/text/*[6]/@adj = 'false'"/>
-
- <eval expected="55368" xpath="//block[@prod-id='l-zwsp']/lineArea/text/@ipd"/>
- <true xpath="//block[@prod-id='l-zwsp']/lineArea/text/*[2]/@adj = 'false'"/>
- <true xpath="//block[@prod-id='l-zwsp']/lineArea/text/*[6]/@adj = 'false'"/>
-
- <eval expected="55368" xpath="//block[@prod-id='l-nosp']/lineArea/text/@ipd"/>
-
- <eval expected="60168" xpath="//block[@prod-id='c-thin-space']/lineArea/text/@ipd"/>
- <eval expected="word" xpath="local-name(//block[@prod-id='c-thin-space']/lineArea/text/*[1])"/>
- <eval expected="space" xpath="local-name(//block[@prod-id='c-thin-space']/lineArea/text/*[2])"/>
- <eval expected="word" xpath="local-name(//block[@prod-id='c-thin-space']/lineArea/text/*[3])"/>
- <eval expected="space" xpath="local-name(//block[@prod-id='c-thin-space']/lineArea/text/*[4])"/>
- <eval expected="word" xpath="local-name(//block[@prod-id='c-thin-space']/lineArea/text/*[5])"/>
- <eval expected="space" xpath="local-name(//block[@prod-id='c-thin-space']/lineArea/text/*[6])"/>
- <eval expected="word" xpath="local-name(//block[@prod-id='c-thin-space']/lineArea/text/*[7])"/>
- <true xpath="//block[@prod-id='c-thin-space']/lineArea/text/*[2]/@adj = 'false'"/>
- <true xpath="//block[@prod-id='c-thin-space']/lineArea/text/*[6]/@adj = 'false'"/>
-
- <eval expected="190804" xpath="//block[@prod-id='j-sp']/lineArea/text/@ipd"/>
- <eval expected="42921" xpath="//block[@prod-id='j-sp']/lineArea/text/@twsadjust"/>
-
- <eval expected="104277" xpath="//block[@prod-id='j-thin-space']/lineArea/text/@ipd"/>
- <eval expected="44109" xpath="//block[@prod-id='j-thin-space']/lineArea/text/@twsadjust"/>
- <true xpath="//block[@prod-id='j-thin-space']/lineArea/text/*[2]/@adj = 'false'"/>
- <true xpath="//block[@prod-id='j-thin-space']/lineArea/text/*[6]/@adj = 'false'"/>
-
- <eval expected="84280" xpath="//block[@prod-id='j-zwsp']/lineArea/text/@ipd"/>
- <eval expected="28912" xpath="//block[@prod-id='j-zwsp']/lineArea/text/@twsadjust"/>
- <true xpath="//block[@prod-id='j-zwsp']/lineArea/text/*[2]/@adj = 'false'"/>
- <true xpath="//block[@prod-id='j-zwsp']/lineArea/text/*[6]/@adj = 'false'"/>
-
- <eval expected="182404" xpath="//block[@prod-id='lsj-sp']/lineArea/text/@ipd"/>
- <eval expected="32121" xpath="//block[@prod-id='lsj-sp']/lineArea/text/@twsadjust"/>
- <eval expected="2000" xpath="//block[@prod-id='lsj-sp']/lineArea/text/@tlsadjust"/>
-
- <eval expected="104777" xpath="//block[@prod-id='lsj-thin-space']/lineArea/text/@ipd"/>
- <eval expected="28609" xpath="//block[@prod-id='lsj-thin-space']/lineArea/text/@twsadjust"/>
- <eval expected="2000" xpath="//block[@prod-id='lsj-thin-space']/lineArea/text/@tlsadjust"/>
- <true xpath="//block[@prod-id='lsj-thin-space']/lineArea/text/*[2]/@adj = 'false'"/>
- <true xpath="//block[@prod-id='lsj-thin-space']/lineArea/text/*[6]/@adj = 'false'"/>
-
- <eval expected="85480" xpath="//block[@prod-id='lsj-zwsp']/lineArea/text/@ipd"/>
- <eval expected="14112" xpath="//block[@prod-id='lsj-zwsp']/lineArea/text/@twsadjust"/>
- <eval expected="2000" xpath="//block[@prod-id='lsj-zwsp']/lineArea/text/@tlsadjust"/>
- <true xpath="//block[@prod-id='lsj-zwsp']/lineArea/text/*[2]/@adj = 'false'"/>
- <true xpath="//block[@prod-id='lsj-zwsp']/lineArea/text/*[6]/@adj = 'false'"/>
-
- </checks>
- </testcase>
|