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.

inline_baseline-shift_3.xml 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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 inline level baseline-shift.
  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 background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
  33. Before
  34. <fo:inline font-size="10pt"
  35. alignment-baseline="middle"
  36. dominant-baseline="middle"
  37. background-color="yellow">middle
  38. <fo:inline font-size="8pt"
  39. baseline-shift="sub"
  40. background-color="red">sub
  41. </fo:inline>middle
  42. </fo:inline>
  43. After <fo:inline font-size="8pt">Baseline table changed</fo:inline>
  44. </fo:block>
  45. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
  46. Before
  47. <fo:inline font-size="10pt"
  48. alignment-baseline="middle"
  49. dominant-baseline="middle"
  50. background-color="yellow">middle
  51. <fo:inline font-size="8pt"
  52. baseline-shift="super"
  53. background-color="red">super
  54. </fo:inline>middle
  55. </fo:inline>
  56. After <fo:inline font-size="8pt">Baseline table changed</fo:inline>
  57. </fo:block>
  58. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
  59. Before
  60. <fo:inline font-size="10pt"
  61. alignment-baseline="text-after-edge"
  62. dominant-baseline="text-after-edge"
  63. background-color="yellow">text-after-edge
  64. <fo:inline font-size="8pt"
  65. baseline-shift="30%"
  66. background-color="red">30%
  67. </fo:inline>text-after-edge
  68. </fo:inline>
  69. After <fo:inline font-size="8pt">Baseline table changed</fo:inline>
  70. </fo:block>
  71. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
  72. Before
  73. <fo:inline font-size="10pt"
  74. alignment-baseline="text-before-edge"
  75. dominant-baseline="text-before-edge"
  76. background-color="yellow">text-before-edge
  77. <fo:inline font-size="8pt"
  78. baseline-shift="-50%"
  79. background-color="red">-50%
  80. </fo:inline>text-before-edge
  81. </fo:inline>
  82. After <fo:inline font-size="8pt">Baseline table changed</fo:inline>
  83. </fo:block>
  84. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
  85. Before
  86. <fo:inline font-size="10pt"
  87. alignment-baseline="middle"
  88. background-color="yellow">middle
  89. <fo:inline font-size="8pt"
  90. baseline-shift="sub"
  91. background-color="red">sub
  92. </fo:inline>middle
  93. </fo:inline>
  94. After <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
  95. </fo:block>
  96. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
  97. Before
  98. <fo:inline font-size="10pt"
  99. alignment-baseline="middle"
  100. background-color="yellow">middle
  101. <fo:inline font-size="8pt"
  102. baseline-shift="super"
  103. background-color="red">super
  104. </fo:inline>middle
  105. </fo:inline>
  106. After <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
  107. </fo:block>
  108. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
  109. Before
  110. <fo:inline font-size="10pt"
  111. alignment-baseline="text-after-edge"
  112. background-color="yellow">text-after-edge
  113. <fo:inline font-size="8pt"
  114. baseline-shift="30%"
  115. background-color="red">30%
  116. </fo:inline>text-after-edge
  117. </fo:inline>
  118. After <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
  119. </fo:block>
  120. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
  121. Before
  122. <fo:inline font-size="10pt"
  123. alignment-baseline="text-before-edge"
  124. background-color="yellow">text-before-edge
  125. <fo:inline font-size="8pt"
  126. baseline-shift="-50%"
  127. background-color="red">-50%
  128. </fo:inline>text-before-edge
  129. </fo:inline>
  130. After <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
  131. </fo:block>
  132. </fo:flow>
  133. </fo:page-sequence>
  134. </fo:root>
  135. </fo>
  136. <checks>
  137. <eval expected="14846" xpath="//flow/block[1]/lineArea[1]/@bpd"/>
  138. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/text[1]/@offset"/>
  139. <eval expected="1826" xpath="//flow/block[1]/lineArea[1]/inlineparent/@offset"/>
  140. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/inlineparent/text[1]/@offset"/>
  141. <eval expected="5620" xpath="//flow/block[1]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  142. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  143. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/inlineparent/text[2]/@offset"/>
  144. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/text[2]/@offset"/>
  145. <eval expected="12950" xpath="//flow/block[2]/lineArea[1]/@bpd"/>
  146. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[1]/@offset"/>
  147. <eval expected="1826" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
  148. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/text[1]/@offset"/>
  149. <eval expected="-1702" xpath="//flow/block[2]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  150. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  151. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/text[2]/@offset"/>
  152. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[2]/@offset"/>
  153. <eval expected="12950" xpath="//flow/block[3]/lineArea[1]/@bpd"/>
  154. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/text[1]/@offset"/>
  155. <eval expected="3700" xpath="//flow/block[3]/lineArea[1]/inlineparent/@offset"/>
  156. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/text[1]/@offset"/>
  157. <eval expected="-1750" xpath="//flow/block[3]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  158. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  159. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/text[2]/@offset"/>
  160. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/text[2]/@offset"/>
  161. <eval expected="13400" xpath="//flow/block[4]/lineArea[1]/@bpd"/>
  162. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/text[1]/@offset"/>
  163. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/@offset"/>
  164. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/text[1]/@offset"/>
  165. <eval expected="6000" xpath="//flow/block[4]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  166. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  167. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/text[2]/@offset"/>
  168. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/text[2]/@offset"/>
  169. <eval expected="12950" xpath="//flow/block[5]/lineArea[1]/@bpd"/>
  170. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[1]/@offset"/>
  171. <eval expected="1826" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
  172. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[1]/@offset"/>
  173. <eval expected="3528" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  174. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  175. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[2]/@offset"/>
  176. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[2]/@offset"/>
  177. <eval expected="14918" xpath="//flow/block[6]/lineArea[1]/@bpd"/>
  178. <eval expected="1968" xpath="//flow/block[6]/lineArea[1]/text[1]/@offset"/>
  179. <eval expected="3794" xpath="//flow/block[6]/lineArea[1]/inlineparent/@offset"/>
  180. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/text[1]/@offset"/>
  181. <eval expected="-3794" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  182. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  183. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/text[2]/@offset"/>
  184. <eval expected="1968" xpath="//flow/block[6]/lineArea[1]/text[2]/@offset"/>
  185. <eval expected="12950" xpath="//flow/block[7]/lineArea[1]/@bpd"/>
  186. <eval expected="0" xpath="//flow/block[7]/lineArea[1]/text[1]/@offset"/>
  187. <eval expected="3700" xpath="//flow/block[7]/lineArea[1]/inlineparent/@offset"/>
  188. <eval expected="0" xpath="//flow/block[7]/lineArea[1]/inlineparent/text[1]/@offset"/>
  189. <eval expected="-2992" xpath="//flow/block[7]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  190. <eval expected="0" xpath="//flow/block[7]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  191. <eval expected="0" xpath="//flow/block[7]/lineArea[1]/inlineparent/text[2]/@offset"/>
  192. <eval expected="0" xpath="//flow/block[7]/lineArea[1]/text[2]/@offset"/>
  193. <eval expected="17708" xpath="//flow/block[8]/lineArea[1]/@bpd"/>
  194. <eval expected="0" xpath="//flow/block[8]/lineArea[1]/text[1]/@offset"/>
  195. <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
  196. <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/text[1]/@offset"/>
  197. <eval expected="10308" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  198. <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  199. <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/text[2]/@offset"/>
  200. <eval expected="0" xpath="//flow/block[8]/lineArea[1]/text[2]/@offset"/>
  201. </checks>
  202. </testcase>