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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Copyright 2005 The Apache Software Foundation
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. -->
  14. <!-- $Id$ -->
  15. <testcase>
  16. <info>
  17. <p>
  18. This test checks line-stacking-strategy font-height against inlines of different sizes.
  19. </p>
  20. </info>
  21. <fo>
  22. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
  23. <fo:layout-master-set>
  24. <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
  25. <fo:region-body/>
  26. </fo:simple-page-master>
  27. </fo:layout-master-set>
  28. <fo:page-sequence master-reference="normal" white-space-collapse="true">
  29. <fo:flow flow-name="xsl-region-body">
  30. <fo:block line-stacking-strategy="font-height" background-color="silver" margin="5pt 0pt 5pt 0pt" font-size="14pt">
  31. Before
  32. <fo:inline font-size="20pt"
  33. background-color="yellow">bigger
  34. </fo:inline>
  35. After
  36. </fo:block>
  37. <fo:block line-stacking-strategy="font-height" background-color="silver" margin="5pt 0pt 5pt 0pt" font-size="14pt">
  38. Before
  39. <fo:inline font-size="20pt"
  40. border="solid 2pt red"
  41. padding="3pt"
  42. background-color="yellow">bigger with b &amp; p
  43. </fo:inline>
  44. After
  45. </fo:block>
  46. <fo:block line-stacking-strategy="font-height" background-color="silver" margin="5pt 0pt 5pt 0pt" font-size="14pt">
  47. Before
  48. <fo:inline font-size="10pt"
  49. baseline-shift="sub"
  50. background-color="yellow">sub
  51. <fo:inline font-size="8pt"
  52. baseline-shift="sub"
  53. background-color="red">sub
  54. </fo:inline>sub
  55. </fo:inline>
  56. After
  57. </fo:block>
  58. <fo:block line-stacking-strategy="font-height" background-color="silver" margin="5pt 0pt 5pt 0pt" font-size="14pt">
  59. Before
  60. <fo:inline font-size="10pt"
  61. baseline-shift="super"
  62. background-color="yellow">super
  63. <fo:inline font-size="8pt"
  64. baseline-shift="super"
  65. background-color="red">super
  66. </fo:inline>super
  67. </fo:inline>
  68. After
  69. </fo:block>
  70. <fo:block line-stacking-strategy="font-height" background-color="silver" margin="5pt 0pt 5pt 0pt" font-size="14pt">
  71. Before
  72. <fo:inline font-size="18pt"
  73. baseline-shift="super"
  74. background-color="yellow">super
  75. <fo:inline font-size="24pt"
  76. baseline-shift="sub"
  77. background-color="red">sub
  78. <fo:inline font-size="30pt"
  79. baseline-shift="super"
  80. background-color="green">super
  81. </fo:inline>sub
  82. </fo:inline>super
  83. </fo:inline>
  84. After
  85. </fo:block>
  86. <fo:block line-stacking-strategy="font-height" background-color="silver" margin="5pt 0pt 5pt 0pt" font-size="14pt">
  87. Before
  88. <fo:inline font-size="18pt"
  89. baseline-shift="sub"
  90. background-color="yellow">sub
  91. <fo:inline font-size="24pt"
  92. baseline-shift="super"
  93. background-color="red">super
  94. <fo:inline font-size="36pt"
  95. baseline-shift="sub"
  96. background-color="green">sub
  97. </fo:inline>super
  98. </fo:inline>sub
  99. </fo:inline>
  100. After
  101. </fo:block>
  102. </fo:flow>
  103. </fo:page-sequence>
  104. </fo:root>
  105. </fo>
  106. <checks>
  107. <eval expected="12950" xpath="//flow/block[1]/lineArea[1]/@bpd"/>
  108. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/text[1]/@offset"/>
  109. <eval expected="-4308" xpath="//flow/block[1]/lineArea[1]/inlineparent/@offset"/>
  110. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/inlineparent/text[1]/@offset"/>
  111. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/text[2]/@offset"/>
  112. <eval expected="12950" xpath="//flow/block[2]/lineArea[1]/@bpd"/>
  113. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[1]/@offset"/>
  114. <eval expected="-4308" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
  115. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/text[1]/@offset"/>
  116. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[2]/@offset"/>
  117. <eval expected="12950" xpath="//flow/block[3]/lineArea[1]/@bpd"/>
  118. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/text[1]/@offset"/>
  119. <eval expected="5487" xpath="//flow/block[3]/lineArea[1]/inlineparent/@offset"/>
  120. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/text[1]/@offset"/>
  121. <eval expected="3528" xpath="//flow/block[3]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  122. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  123. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/text[2]/@offset"/>
  124. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/text[2]/@offset"/>
  125. <eval expected="12950" xpath="//flow/block[4]/lineArea[1]/@bpd"/>
  126. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/text[1]/@offset"/>
  127. <eval expected="-4450" xpath="//flow/block[4]/lineArea[1]/inlineparent/@offset"/>
  128. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/text[1]/@offset"/>
  129. <eval expected="-3794" xpath="//flow/block[4]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  130. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  131. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/text[2]/@offset"/>
  132. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/text[2]/@offset"/>
  133. <eval expected="12950" xpath="//flow/block[5]/lineArea[1]/@bpd"/>
  134. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[1]/@offset"/>
  135. <eval expected="-10194" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
  136. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[1]/@offset"/>
  137. <eval expected="1968" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  138. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
  139. <eval expected="-16860" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
  140. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
  141. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/text[2]/@offset"/>
  142. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[2]/@offset"/>
  143. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[2]/@offset"/>
  144. <eval expected="12950" xpath="//flow/block[6]/lineArea[1]/@bpd"/>
  145. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/text[1]/@offset"/>
  146. <eval expected="1835" xpath="//flow/block[6]/lineArea[1]/inlineparent/@offset"/>
  147. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/text[1]/@offset"/>
  148. <eval expected="-13722" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  149. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
  150. <eval expected="798" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
  151. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
  152. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
  153. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/text[2]/@offset"/>
  154. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/text[2]/@offset"/>
  155. </checks>
  156. </testcase>