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_line-stacking-strategy_1.xml 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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 line-stacking-strategy font-height against inlines of different sizes.
  21. </p>
  22. </info>
  23. <fo>
  24. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
  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" white-space-collapse="true">
  31. <fo:flow flow-name="xsl-region-body">
  32. <fo:block line-stacking-strategy="font-height" background-color="silver" margin="5pt 0pt 5pt 0pt" font-size="14pt">
  33. Before
  34. <fo:inline font-size="20pt"
  35. background-color="yellow">bigger
  36. </fo:inline>
  37. After
  38. </fo:block>
  39. <fo:block line-stacking-strategy="font-height" background-color="silver" margin="5pt 0pt 5pt 0pt" font-size="14pt">
  40. Before
  41. <fo:inline font-size="20pt"
  42. border="solid 2pt red"
  43. padding="3pt"
  44. background-color="yellow">bigger with b &amp; p
  45. </fo:inline>
  46. After
  47. </fo:block>
  48. <fo:block line-stacking-strategy="font-height" background-color="silver" margin="5pt 0pt 5pt 0pt" font-size="14pt">
  49. Before
  50. <fo:inline font-size="10pt"
  51. baseline-shift="sub"
  52. background-color="yellow">sub
  53. <fo:inline font-size="8pt"
  54. baseline-shift="sub"
  55. background-color="red">sub
  56. </fo:inline>sub
  57. </fo:inline>
  58. After
  59. </fo:block>
  60. <fo:block line-stacking-strategy="font-height" background-color="silver" margin="5pt 0pt 5pt 0pt" font-size="14pt">
  61. Before
  62. <fo:inline font-size="10pt"
  63. baseline-shift="super"
  64. background-color="yellow">super
  65. <fo:inline font-size="8pt"
  66. baseline-shift="super"
  67. background-color="red">super
  68. </fo:inline>super
  69. </fo:inline>
  70. After
  71. </fo:block>
  72. <fo:block line-stacking-strategy="font-height" background-color="silver" margin="5pt 0pt 5pt 0pt" font-size="14pt">
  73. Before
  74. <fo:inline font-size="18pt"
  75. baseline-shift="super"
  76. background-color="yellow">super
  77. <fo:inline font-size="24pt"
  78. baseline-shift="sub"
  79. background-color="red">sub
  80. <fo:inline font-size="30pt"
  81. baseline-shift="super"
  82. background-color="green">super
  83. </fo:inline>sub
  84. </fo:inline>super
  85. </fo:inline>
  86. After
  87. </fo:block>
  88. <fo:block line-stacking-strategy="font-height" background-color="silver" margin="5pt 0pt 5pt 0pt" font-size="14pt">
  89. Before
  90. <fo:inline font-size="18pt"
  91. baseline-shift="sub"
  92. background-color="yellow">sub
  93. <fo:inline font-size="24pt"
  94. baseline-shift="super"
  95. background-color="red">super
  96. <fo:inline font-size="36pt"
  97. baseline-shift="sub"
  98. background-color="green">sub
  99. </fo:inline>super
  100. </fo:inline>sub
  101. </fo:inline>
  102. After
  103. </fo:block>
  104. </fo:flow>
  105. </fo:page-sequence>
  106. </fo:root>
  107. </fo>
  108. <checks>
  109. <eval expected="12950" xpath="//flow/block[1]/lineArea[1]/@bpd"/>
  110. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/text[1]/@offset"/>
  111. <eval expected="-4308" xpath="//flow/block[1]/lineArea[1]/inlineparent/@offset"/>
  112. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/inlineparent/text[1]/@offset"/>
  113. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/text[2]/@offset"/>
  114. <eval expected="12950" xpath="//flow/block[2]/lineArea[1]/@bpd"/>
  115. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[1]/@offset"/>
  116. <eval expected="-4308" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
  117. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/text[1]/@offset"/>
  118. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[2]/@offset"/>
  119. <eval expected="12950" xpath="//flow/block[3]/lineArea[1]/@bpd"/>
  120. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/text[1]/@offset"/>
  121. <eval expected="5487" xpath="//flow/block[3]/lineArea[1]/inlineparent/@offset"/>
  122. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/text[1]/@offset"/>
  123. <eval expected="3528" xpath="//flow/block[3]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  124. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  125. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/text[2]/@offset"/>
  126. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/text[2]/@offset"/>
  127. <eval expected="12950" xpath="//flow/block[4]/lineArea[1]/@bpd"/>
  128. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/text[1]/@offset"/>
  129. <eval expected="-4450" xpath="//flow/block[4]/lineArea[1]/inlineparent/@offset"/>
  130. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/text[1]/@offset"/>
  131. <eval expected="-3794" xpath="//flow/block[4]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  132. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  133. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/text[2]/@offset"/>
  134. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/text[2]/@offset"/>
  135. <eval expected="12950" xpath="//flow/block[5]/lineArea[1]/@bpd"/>
  136. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[1]/@offset"/>
  137. <eval expected="-10194" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
  138. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[1]/@offset"/>
  139. <eval expected="1968" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  140. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
  141. <eval expected="-16860" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
  142. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
  143. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/text[2]/@offset"/>
  144. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[2]/@offset"/>
  145. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[2]/@offset"/>
  146. <eval expected="12950" xpath="//flow/block[6]/lineArea[1]/@bpd"/>
  147. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/text[1]/@offset"/>
  148. <eval expected="1835" xpath="//flow/block[6]/lineArea[1]/inlineparent/@offset"/>
  149. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/text[1]/@offset"/>
  150. <eval expected="-13722" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  151. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
  152. <eval expected="798" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
  153. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
  154. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
  155. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/text[2]/@offset"/>
  156. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/text[2]/@offset"/>
  157. </checks>
  158. </testcase>