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_4.xml 9.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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="16pt">
  33. Before
  34. <fo:inline font-size="50%"
  35. alignment-baseline="central"
  36. baseline-shift="6pt"
  37. background-color="yellow">6pt central
  38. </fo:inline>
  39. <fo:inline font-size="50%"
  40. alignment-baseline="central"
  41. background-color="orange">central
  42. </fo:inline>
  43. After
  44. </fo:block>
  45. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="16pt">
  46. Before
  47. <fo:inline font-size="50%"
  48. alignment-baseline="central"
  49. baseline-shift="-6pt"
  50. background-color="yellow">-6pt central
  51. </fo:inline>
  52. <fo:inline font-size="50%"
  53. alignment-baseline="central"
  54. background-color="orange">central
  55. </fo:inline>
  56. After
  57. </fo:block>
  58. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="16pt">
  59. Before
  60. <fo:inline font-size="50%"
  61. alignment-baseline="central"
  62. baseline-shift="sub"
  63. background-color="yellow">sub
  64. <fo:inline font-size="150%"
  65. alignment-baseline="text-before-edge"
  66. background-color="red">text-before-edge
  67. <fo:inline font-size="6pt"
  68. background-color="green">Baseline unchanged</fo:inline>
  69. </fo:inline>central
  70. </fo:inline>
  71. After
  72. </fo:block>
  73. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="16pt">
  74. Before
  75. <fo:inline font-size="50%"
  76. alignment-baseline="central"
  77. baseline-shift="super"
  78. background-color="yellow">super
  79. <fo:inline font-size="150%"
  80. alignment-baseline="text-after-edge"
  81. background-color="red">text-after-edge
  82. <fo:inline font-size="6pt"
  83. background-color="green">Baseline unchanged</fo:inline>
  84. </fo:inline>central
  85. </fo:inline>
  86. After
  87. </fo:block>
  88. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="16pt">
  89. Before
  90. <fo:inline font-size="50%"
  91. alignment-baseline="central"
  92. baseline-shift="sub"
  93. background-color="yellow">sub
  94. <fo:inline font-size="150%"
  95. dominant-baseline="text-before-edge"
  96. background-color="red">text-before-edge
  97. <fo:inline font-size="6pt"
  98. background-color="green">Baseline changed</fo:inline>
  99. </fo:inline>central
  100. </fo:inline>
  101. After
  102. </fo:block>
  103. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="16pt">
  104. Before
  105. <fo:inline font-size="50%"
  106. alignment-baseline="central"
  107. baseline-shift="super"
  108. background-color="yellow">super
  109. <fo:inline font-size="150%"
  110. dominant-baseline="text-after-edge"
  111. background-color="red">text-after-edge
  112. <fo:inline font-size="6pt"
  113. background-color="green">Baseline changed</fo:inline>
  114. </fo:inline>central
  115. </fo:inline>
  116. After
  117. </fo:block>
  118. </fo:flow>
  119. </fo:page-sequence>
  120. </fo:root>
  121. </fo>
  122. <checks>
  123. <eval expected="17100" xpath="//flow/block[1]/lineArea[1]/@bpd"/>
  124. <eval expected="2300" xpath="//flow/block[1]/lineArea[1]/text[1]/@offset"/>
  125. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/inlineparent[1]/@offset"/>
  126. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/inlineparent[1]/text[1]/@offset"/>
  127. <eval expected="6000" xpath="//flow/block[1]/lineArea[1]/inlineparent[2]/@offset"/>
  128. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/inlineparent[2]/text[1]/@offset"/>
  129. <eval expected="2300" xpath="//flow/block[1]/lineArea[1]/text[2]/@offset"/>
  130. <eval expected="17100" xpath="//flow/block[2]/lineArea[1]/@bpd"/>
  131. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[1]/@offset"/>
  132. <eval expected="9700" xpath="//flow/block[2]/lineArea[1]/inlineparent[1]/@offset"/>
  133. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent[1]/text[1]/@offset"/>
  134. <eval expected="3700" xpath="//flow/block[2]/lineArea[1]/inlineparent[2]/@offset"/>
  135. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent[2]/text[1]/@offset"/>
  136. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[2]/@offset"/>
  137. <eval expected="16892" xpath="//flow/block[3]/lineArea[1]/@bpd"/>
  138. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/text[1]/@offset"/>
  139. <eval expected="5792" xpath="//flow/block[3]/lineArea[1]/inlineparent/@offset"/>
  140. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/text[1]/@offset"/>
  141. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  142. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  143. <eval expected="1436" xpath="//flow/block[3]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
  144. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
  145. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/text[2]/@offset"/>
  146. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/text[2]/@offset"/>
  147. <eval expected="23168" xpath="//flow/block[4]/lineArea[1]/@bpd"/>
  148. <eval expected="8368" xpath="//flow/block[4]/lineArea[1]/text[1]/@offset"/>
  149. <eval expected="3700" xpath="//flow/block[4]/lineArea[1]/inlineparent/@offset"/>
  150. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/text[1]/@offset"/>
  151. <eval expected="-3700" xpath="//flow/block[4]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  152. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  153. <eval expected="5136" xpath="//flow/block[4]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
  154. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
  155. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/text[2]/@offset"/>
  156. <eval expected="8368" xpath="//flow/block[4]/lineArea[1]/text[2]/@offset"/>
  157. <eval expected="14800" xpath="//flow/block[5]/lineArea[1]/@bpd"/>
  158. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[1]/@offset"/>
  159. <eval expected="5792" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
  160. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[1]/@offset"/>
  161. <eval expected="-2872" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  162. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  163. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
  164. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
  165. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[2]/@offset"/>
  166. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[2]/@offset"/>
  167. <eval expected="22340" xpath="//flow/block[6]/lineArea[1]/@bpd"/>
  168. <eval expected="7540" xpath="//flow/block[6]/lineArea[1]/text[1]/@offset"/>
  169. <eval expected="2872" xpath="//flow/block[6]/lineArea[1]/inlineparent/@offset"/>
  170. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/text[1]/@offset"/>
  171. <eval expected="-2872" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  172. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  173. <eval expected="5550" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
  174. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
  175. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/text[2]/@offset"/>
  176. <eval expected="7540" xpath="//flow/block[6]/lineArea[1]/text[2]/@offset"/>
  177. </checks>
  178. </testcase>