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_2.xml 8.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. baseline-shift="sub"
  36. background-color="yellow">sub
  37. <fo:inline font-size="8pt"
  38. baseline-shift="sub"
  39. background-color="red">sub
  40. </fo:inline>sub
  41. </fo:inline>
  42. After
  43. </fo:block>
  44. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
  45. Before
  46. <fo:inline font-size="10pt"
  47. baseline-shift="sub"
  48. background-color="yellow">sub
  49. <fo:inline font-size="8pt"
  50. baseline-shift="super"
  51. background-color="red">super
  52. </fo:inline>sub
  53. </fo:inline>
  54. After
  55. </fo:block>
  56. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
  57. Before
  58. <fo:inline font-size="10pt"
  59. baseline-shift="super"
  60. background-color="yellow">super
  61. <fo:inline font-size="8pt"
  62. baseline-shift="super"
  63. background-color="red">super
  64. </fo:inline>super
  65. </fo:inline>
  66. After
  67. </fo:block>
  68. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
  69. Before
  70. <fo:inline font-size="10pt"
  71. baseline-shift="super"
  72. background-color="yellow">super
  73. <fo:inline font-size="8pt"
  74. baseline-shift="sub"
  75. background-color="red">sub
  76. </fo:inline>super
  77. </fo:inline>
  78. After
  79. </fo:block>
  80. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
  81. Before
  82. <fo:inline font-size="10pt"
  83. baseline-shift="30%"
  84. background-color="yellow">30%
  85. <fo:inline font-size="8pt"
  86. baseline-shift="-50%"
  87. background-color="red">-50%
  88. </fo:inline>30%
  89. </fo:inline>
  90. After
  91. </fo:block>
  92. <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
  93. Before
  94. <fo:inline font-size="18pt"
  95. baseline-shift="super"
  96. background-color="yellow">super
  97. <fo:inline font-size="24pt"
  98. baseline-shift="sub"
  99. background-color="red">sub
  100. <fo:inline font-size="30pt"
  101. baseline-shift="super"
  102. background-color="green">super
  103. </fo:inline>sub
  104. </fo:inline>super
  105. </fo:inline>
  106. After
  107. </fo:block>
  108. </fo:flow>
  109. </fo:page-sequence>
  110. </fo:root>
  111. </fo>
  112. <checks>
  113. <eval expected="16415" xpath="//flow/block[1]/lineArea[1]/@bpd"/>
  114. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/text[1]/@offset"/>
  115. <eval expected="5487" xpath="//flow/block[1]/lineArea[1]/inlineparent/@offset"/>
  116. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/inlineparent/text[1]/@offset"/>
  117. <eval expected="3528" xpath="//flow/block[1]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  118. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  119. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/inlineparent/text[2]/@offset"/>
  120. <eval expected="0" xpath="//flow/block[1]/lineArea[1]/text[2]/@offset"/>
  121. <eval expected="14737" xpath="//flow/block[2]/lineArea[1]/@bpd"/>
  122. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[1]/@offset"/>
  123. <eval expected="5487" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
  124. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/text[1]/@offset"/>
  125. <eval expected="-3794" xpath="//flow/block[2]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  126. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  127. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/text[2]/@offset"/>
  128. <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[2]/@offset"/>
  129. <eval expected="21194" xpath="//flow/block[3]/lineArea[1]/@bpd"/>
  130. <eval expected="8244" xpath="//flow/block[3]/lineArea[1]/text[1]/@offset"/>
  131. <eval expected="3794" xpath="//flow/block[3]/lineArea[1]/inlineparent/@offset"/>
  132. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/text[1]/@offset"/>
  133. <eval expected="-3794" xpath="//flow/block[3]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  134. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  135. <eval expected="0" xpath="//flow/block[3]/lineArea[1]/inlineparent/text[2]/@offset"/>
  136. <eval expected="8244" xpath="//flow/block[3]/lineArea[1]/text[2]/@offset"/>
  137. <eval expected="17400" xpath="//flow/block[4]/lineArea[1]/@bpd"/>
  138. <eval expected="4450" xpath="//flow/block[4]/lineArea[1]/text[1]/@offset"/>
  139. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/@offset"/>
  140. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/text[1]/@offset"/>
  141. <eval expected="3528" xpath="//flow/block[4]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  142. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  143. <eval expected="0" xpath="//flow/block[4]/lineArea[1]/inlineparent/text[2]/@offset"/>
  144. <eval expected="4450" xpath="//flow/block[4]/lineArea[1]/text[2]/@offset"/>
  145. <eval expected="15118" xpath="//flow/block[5]/lineArea[1]/@bpd"/>
  146. <eval expected="2168" xpath="//flow/block[5]/lineArea[1]/text[1]/@offset"/>
  147. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
  148. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[1]/@offset"/>
  149. <eval expected="7436" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  150. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
  151. <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[2]/@offset"/>
  152. <eval expected="2168" xpath="//flow/block[5]/lineArea[1]/text[2]/@offset"/>
  153. <eval expected="39060" xpath="//flow/block[6]/lineArea[1]/@bpd"/>
  154. <eval expected="25086" xpath="//flow/block[6]/lineArea[1]/text[1]/@offset"/>
  155. <eval expected="14892" xpath="//flow/block[6]/lineArea[1]/inlineparent/@offset"/>
  156. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/text[1]/@offset"/>
  157. <eval expected="1968" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/@offset"/>
  158. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
  159. <eval expected="-16860" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
  160. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
  161. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
  162. <eval expected="0" xpath="//flow/block[6]/lineArea[1]/inlineparent/text[2]/@offset"/>
  163. <eval expected="25086" xpath="//flow/block[6]/lineArea[1]/text[2]/@offset"/>
  164. </checks>
  165. </testcase>