You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

block_white-space_4.xml 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- $Id$ -->
  17. <testcase>
  18. <info>
  19. <p>
  20. This test checks element generation for various spaces.
  21. </p>
  22. </info>
  23. <fo>
  24. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  25. <fo:layout-master-set>
  26. <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
  27. <fo:region-body/>
  28. </fo:simple-page-master>
  29. </fo:layout-master-set>
  30. <fo:page-sequence master-reference="normal">
  31. <fo:flow flow-name="xsl-region-body">
  32. <!-- for nbsp see block_white-space_2 and block_white-space_3 -->
  33. <fo:block>
  34. <fo:block background-color="yellow" id="l-sp">« text text »<fo:inline font-style="italic"> (normal space)</fo:inline></fo:block>
  35. <fo:block background-color="orange" id="l-thin-space">«&#x2009;text text&#x2009;»<fo:inline font-style="italic"> (thin space, &amp;#x2009;)</fo:inline></fo:block>
  36. <fo:block background-color="yellow" id="l-hair-space">«&#x200A;text text&#x200A;»<fo:inline font-style="italic"> (hair space, &amp;#x200A;)</fo:inline></fo:block>
  37. <fo:block background-color="orange" id="l-zwsp">«&#x200B;text text&#x200B;»<fo:inline font-style="italic"> (zero width space, &amp;#x200B;)</fo:inline></fo:block>
  38. <fo:block background-color="yellow" id="l-nosp">«text text»<fo:inline font-style="italic"> (no spaces)</fo:inline></fo:block>
  39. </fo:block>
  40. <fo:block space-before="2mm" text-align="center">
  41. <fo:block background-color="yellow" id="c-sp">« text text »<fo:inline font-style="italic"> (normal space)</fo:inline></fo:block>
  42. <fo:block background-color="orange" id="c-thin-space">«&#x2009;text text&#x2009;»<fo:inline font-style="italic"> (thin space, &amp;#x2009;)</fo:inline></fo:block>
  43. <fo:block background-color="yellow" id="c-hair-space">«&#x200A;text text&#x200A;»<fo:inline font-style="italic"> (hair space, &amp;#x200A;)</fo:inline></fo:block>
  44. <fo:block background-color="orange" id="c-zwsp">«&#x200B;text text&#x200B;»<fo:inline font-style="italic"> (zero width space, &amp;#x200B;)</fo:inline></fo:block>
  45. <fo:block background-color="yellow" id="c-nosp">«text text»<fo:inline font-style="italic"> (no spaces)</fo:inline></fo:block>
  46. </fo:block>
  47. <fo:block space-before="2mm" text-align="justify" text-align-last="justify">
  48. <fo:block background-color="yellow" id="j-sp">« text text »<fo:inline font-style="italic"> (normal space)</fo:inline></fo:block>
  49. <fo:block background-color="orange" id="j-thin-space">«&#x2009;text text&#x2009;»<fo:inline font-style="italic"> (thin space, &amp;#x2009;)</fo:inline></fo:block>
  50. <fo:block background-color="yellow" id="j-hair-space">«&#x200A;text text&#x200A;»<fo:inline font-style="italic"> (hair space, &amp;#x200A;)</fo:inline></fo:block>
  51. <fo:block background-color="orange" id="j-zwsp">«&#x200B;text text&#x200B;»<fo:inline font-style="italic"> (zero width space, &amp;#x200B;)</fo:inline></fo:block>
  52. <fo:block background-color="yellow" id="j-nosp">«text text»<fo:inline font-style="italic"> (no spaces)</fo:inline></fo:block>
  53. </fo:block>
  54. <fo:block space-before="2mm" text-align="justify" text-align-last="justify" letter-spacing="2pt">
  55. <fo:block background-color="yellow" id="lsj-sp">« text text »<fo:inline font-style="italic"> (normal space)</fo:inline></fo:block>
  56. <fo:block background-color="orange" id="lsj-thin-space">«&#x2009;text text&#x2009;»<fo:inline font-style="italic"> (thin space, &amp;#x2009;)</fo:inline></fo:block>
  57. <fo:block background-color="yellow" id="lsj-hair-space">«&#x200A;text text&#x200A;»<fo:inline font-style="italic"> (hair space, &amp;#x200A;)</fo:inline></fo:block>
  58. <fo:block background-color="orange" id="lsj-zwsp">«&#x200B;text text&#x200B;»<fo:inline font-style="italic"> (zero width space, &amp;#x200B;)</fo:inline></fo:block>
  59. <fo:block background-color="yellow" id="lsj-nosp">«text text»<fo:inline font-style="italic"> (no spaces)</fo:inline></fo:block>
  60. </fo:block>
  61. </fo:flow>
  62. </fo:page-sequence>
  63. </fo:root>
  64. </fo>
  65. <checks>
  66. <eval expected="62040" xpath="//block[@prod-id='l-sp']/lineArea/text/@ipd"/>
  67. <eval expected="word" xpath="local-name(//block[@prod-id='l-sp']/lineArea/text/*[1])"/>
  68. <eval expected="space" xpath="local-name(//block[@prod-id='l-sp']/lineArea/text/*[2])"/>
  69. <eval expected="word" xpath="local-name(//block[@prod-id='l-sp']/lineArea/text/*[3])"/>
  70. <eval expected="space" xpath="local-name(//block[@prod-id='l-sp']/lineArea/text/*[4])"/>
  71. <eval expected="word" xpath="local-name(//block[@prod-id='l-sp']/lineArea/text/*[5])"/>
  72. <eval expected="space" xpath="local-name(//block[@prod-id='l-sp']/lineArea/text/*[6])"/>
  73. <eval expected="word" xpath="local-name(//block[@prod-id='l-sp']/lineArea/text/*[7])"/>
  74. <true xpath="not(//block[@prod-id='l-sp']/lineArea/text/*[2]/@adj = 'false')"/>
  75. <true xpath="not(//block[@prod-id='l-sp']/lineArea/text/*[6]/@adj = 'false')"/>
  76. <eval expected="60168" xpath="//block[@prod-id='l-thin-space']/lineArea/text/@ipd"/>
  77. <eval expected="word" xpath="local-name(//block[@prod-id='l-thin-space']/lineArea/text/*[1])"/>
  78. <eval expected="space" xpath="local-name(//block[@prod-id='l-thin-space']/lineArea/text/*[2])"/>
  79. <eval expected="word" xpath="local-name(//block[@prod-id='l-thin-space']/lineArea/text/*[3])"/>
  80. <eval expected="space" xpath="local-name(//block[@prod-id='l-thin-space']/lineArea/text/*[4])"/>
  81. <eval expected="word" xpath="local-name(//block[@prod-id='l-thin-space']/lineArea/text/*[5])"/>
  82. <eval expected="space" xpath="local-name(//block[@prod-id='l-thin-space']/lineArea/text/*[6])"/>
  83. <eval expected="word" xpath="local-name(//block[@prod-id='l-thin-space']/lineArea/text/*[7])"/>
  84. <true xpath="//block[@prod-id='l-thin-space']/lineArea/text/*[2]/@adj = 'false'"/>
  85. <true xpath="//block[@prod-id='l-thin-space']/lineArea/text/*[6]/@adj = 'false'"/>
  86. <eval expected="57768" xpath="//block[@prod-id='l-hair-space']/lineArea/text/@ipd"/>
  87. <true xpath="//block[@prod-id='l-hair-space']/lineArea/text/*[2]/@adj = 'false'"/>
  88. <true xpath="//block[@prod-id='l-hair-space']/lineArea/text/*[6]/@adj = 'false'"/>
  89. <eval expected="55368" xpath="//block[@prod-id='l-zwsp']/lineArea/text/@ipd"/>
  90. <true xpath="//block[@prod-id='l-zwsp']/lineArea/text/*[2]/@adj = 'false'"/>
  91. <true xpath="//block[@prod-id='l-zwsp']/lineArea/text/*[6]/@adj = 'false'"/>
  92. <eval expected="55368" xpath="//block[@prod-id='l-nosp']/lineArea/text/@ipd"/>
  93. <eval expected="60168" xpath="//block[@prod-id='c-thin-space']/lineArea/text/@ipd"/>
  94. <eval expected="word" xpath="local-name(//block[@prod-id='c-thin-space']/lineArea/text/*[1])"/>
  95. <eval expected="space" xpath="local-name(//block[@prod-id='c-thin-space']/lineArea/text/*[2])"/>
  96. <eval expected="word" xpath="local-name(//block[@prod-id='c-thin-space']/lineArea/text/*[3])"/>
  97. <eval expected="space" xpath="local-name(//block[@prod-id='c-thin-space']/lineArea/text/*[4])"/>
  98. <eval expected="word" xpath="local-name(//block[@prod-id='c-thin-space']/lineArea/text/*[5])"/>
  99. <eval expected="space" xpath="local-name(//block[@prod-id='c-thin-space']/lineArea/text/*[6])"/>
  100. <eval expected="word" xpath="local-name(//block[@prod-id='c-thin-space']/lineArea/text/*[7])"/>
  101. <true xpath="//block[@prod-id='c-thin-space']/lineArea/text/*[2]/@adj = 'false'"/>
  102. <true xpath="//block[@prod-id='c-thin-space']/lineArea/text/*[6]/@adj = 'false'"/>
  103. <eval expected="190804" xpath="//block[@prod-id='j-sp']/lineArea/text/@ipd"/>
  104. <eval expected="42921" xpath="//block[@prod-id='j-sp']/lineArea/text/@twsadjust"/>
  105. <eval expected="104277" xpath="//block[@prod-id='j-thin-space']/lineArea/text/@ipd"/>
  106. <eval expected="44109" xpath="//block[@prod-id='j-thin-space']/lineArea/text/@twsadjust"/>
  107. <true xpath="//block[@prod-id='j-thin-space']/lineArea/text/*[2]/@adj = 'false'"/>
  108. <true xpath="//block[@prod-id='j-thin-space']/lineArea/text/*[6]/@adj = 'false'"/>
  109. <eval expected="84280" xpath="//block[@prod-id='j-zwsp']/lineArea/text/@ipd"/>
  110. <eval expected="28912" xpath="//block[@prod-id='j-zwsp']/lineArea/text/@twsadjust"/>
  111. <true xpath="//block[@prod-id='j-zwsp']/lineArea/text/*[2]/@adj = 'false'"/>
  112. <true xpath="//block[@prod-id='j-zwsp']/lineArea/text/*[6]/@adj = 'false'"/>
  113. <eval expected="182404" xpath="//block[@prod-id='lsj-sp']/lineArea/text/@ipd"/>
  114. <eval expected="32121" xpath="//block[@prod-id='lsj-sp']/lineArea/text/@twsadjust"/>
  115. <eval expected="2000" xpath="//block[@prod-id='lsj-sp']/lineArea/text/@tlsadjust"/>
  116. <eval expected="104777" xpath="//block[@prod-id='lsj-thin-space']/lineArea/text/@ipd"/>
  117. <eval expected="28609" xpath="//block[@prod-id='lsj-thin-space']/lineArea/text/@twsadjust"/>
  118. <eval expected="2000" xpath="//block[@prod-id='lsj-thin-space']/lineArea/text/@tlsadjust"/>
  119. <true xpath="//block[@prod-id='lsj-thin-space']/lineArea/text/*[2]/@adj = 'false'"/>
  120. <true xpath="//block[@prod-id='lsj-thin-space']/lineArea/text/*[6]/@adj = 'false'"/>
  121. <eval expected="85480" xpath="//block[@prod-id='lsj-zwsp']/lineArea/text/@ipd"/>
  122. <eval expected="14112" xpath="//block[@prod-id='lsj-zwsp']/lineArea/text/@twsadjust"/>
  123. <eval expected="2000" xpath="//block[@prod-id='lsj-zwsp']/lineArea/text/@tlsadjust"/>
  124. <true xpath="//block[@prod-id='lsj-zwsp']/lineArea/text/*[2]/@adj = 'false'"/>
  125. <true xpath="//block[@prod-id='lsj-zwsp']/lineArea/text/*[6]/@adj = 'false'"/>
  126. </checks>
  127. </testcase>