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.

bordershorthand.fo 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- example for a simple fo file. At the beginning the page layout is set.
  3. Below fo:root there is always
  4. - a single fo:layout-master-set which defines one or more page layouts
  5. - an optional fo:declarations,
  6. - and a sequence of one or more fo:page-sequences containing the text and formatting instructions -->
  7. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  8. <fo:layout-master-set>
  9. <!-- layout for the first page -->
  10. <fo:simple-page-master master-name="first"
  11. page-height="29.7cm"
  12. page-width="21cm"
  13. margin-top="1cm"
  14. margin-bottom="2cm"
  15. margin-left="2.0cm + 0.5cm"
  16. margin-right="(5cm * 1cm) div 2cm">
  17. <fo:region-body margin-top="3cm"/>
  18. <fo:region-before extent="3cm"/>
  19. <fo:region-after extent="1.5cm"/>
  20. </fo:simple-page-master>
  21. <!-- layout for the other pages -->
  22. <fo:simple-page-master master-name="rest"
  23. page-height="abs(-30cm + .3cm)"
  24. page-width="(10cm * 2) + 1cm"
  25. margin-top="round(.5) * 1cm"
  26. margin-bottom="round(2.4) * 1cm"
  27. margin-left="2.5 * 1cm"
  28. margin-right="5.5cm - 3cm">
  29. <fo:region-body margin-top="2.5cm"/>
  30. <fo:region-before extent="2.5cm"/>
  31. <fo:region-after extent="1.5cm"/>
  32. </fo:simple-page-master>
  33. <fo:page-sequence-master master-name="basicPSM" >
  34. <fo:repeatable-page-master-alternatives>
  35. <fo:conditional-page-master-reference master-reference="first"
  36. page-position="first" />
  37. <fo:conditional-page-master-reference master-reference="rest"
  38. page-position="rest" />
  39. <!-- recommended fallback procedure -->
  40. <fo:conditional-page-master-reference master-reference="rest" />
  41. </fo:repeatable-page-master-alternatives>
  42. </fo:page-sequence-master>
  43. </fo:layout-master-set>
  44. <!-- end: defines page layout -->
  45. <!-- actual layout -->
  46. <fo:page-sequence master-reference="basicPSM">
  47. <!-- header -->
  48. <fo:static-content flow-name="xsl-region-before">
  49. <fo:block text-align="end"
  50. font-size="10pt"
  51. font-family="serif"
  52. line-height="1em + 4pt"
  53. >
  54. Border and Padding Shorthand Tests - p. <fo:page-number/>
  55. </fo:block>
  56. </fo:static-content>
  57. <fo:flow flow-name="xsl-region-body">
  58. <!-- defines text title level 1-->
  59. <fo:block font-size="min(18pt,20pt)"
  60. font-family="sans-serif"
  61. line-height="max(24pt,18pt)"
  62. space-after.optimum="5 mod 3 * 7.5pt"
  63. background-color="rgb(128,128,128)"
  64. color="rgb(255,255,255)"
  65. text-align="center"
  66. padding-top="3pt">
  67. Border and Padding Shorthand Tests
  68. </fo:block>
  69. <!-- Normal text -->
  70. <fo:block font-size="12pt"
  71. font-family="sans-serif"
  72. line-height="1.25em"
  73. space-after="12pt"
  74. text-align="start"
  75. background-color="rgb(150,150,150)"
  76. start-indent="3mm" end-indent="3mm"
  77. padding-left="3mm" padding-right="3mm"
  78. padding-top="4mm" padding-bottom="4mm"
  79. border-style="dashed"
  80. border-left-width="1pt" border-right-width="1pt"
  81. border-top-width="2pt" border-bottom-width="2pt"
  82. border-top-color="rgb(100,100,100)" border-bottom-color="rgb(200,200,200)">
  83. In this example, padding and border properties are specified using absolute properties:
  84. padding-left, padding-right, padding-top, and padding-bottom, etc.
  85. According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified.
  86. </fo:block>
  87. <fo:block font-size="12pt"
  88. font-family="sans-serif"
  89. line-height="1.25em"
  90. space-after="12pt"
  91. text-align="start"
  92. background-color="rgb(150,150,150)"
  93. start-indent="3mm" end-indent="3mm"
  94. padding="3mm + 1mm 3mm"
  95. border-top="rgb(100,100,100) 1pt + 1pt dashed"
  96. border-bottom="2pt rgb(200,200,200) solid"
  97. border-left="solid 1pt" border-right="solid 1pt">
  98. In this example, padding and border properties are specified using shorthand properties:
  99. padding, border-width, border-color.
  100. According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified.
  101. </fo:block>
  102. <!-- Normal text -->
  103. <fo:block font-size="12pt"
  104. font-family="sans-serif"
  105. line-height="1.25em"
  106. space-after="3pt"
  107. text-align="start"
  108. background-color="rgb(150,150,150)"
  109. start-indent="3mm" end-indent="3mm"
  110. padding-before="4mm" padding-after="4mm"
  111. padding-start.length="3mm" padding-end.length="3mm"
  112. border-style="solid"
  113. border-start-width="1pt" border-end-width="1pt"
  114. border-before-width="2pt" border-after-width="2pt"
  115. border-before-color="rgb(100,100,100)"
  116. border-after-color="rgb(200,200,200)">
  117. In this example, padding and border properties are specified using writing-mode relative properties:
  118. padding-before, padding-after, padding-start, and padding-end, etc.
  119. According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified.
  120. </fo:block>
  121. <!-- Normal text -->
  122. <fo:block font-size="12pt"
  123. font-family="sans-serif"
  124. line-height="1.25em"
  125. space-after="3pt"
  126. text-align="start"
  127. background-color="rgb(200,200,200)"
  128. start-indent="3mm" end-indent="3mm"
  129. padding = "3mm"
  130. padding-before="4mm" padding-after="4mm"
  131. border-width = "2pt" border-style="solid"
  132. border-color="black"
  133. border-start-width="1pt" border-end-width="1pt"
  134. border-before-width="2pt" border-after-width="2pt"
  135. border-before-color="rgb(200,200,200)"
  136. border-after-color="rgb(100,100,100)">
  137. In this example, padding and border properties are specified using
  138. shorthand and writing-mode relative properties:
  139. padding-before, padding-after, padding-start, and padding-end, etc.
  140. According to the specification, a request for the absolute (top, bottom, left, right) versions of these properties should use the relative ones if they are specified.
  141. </fo:block>
  142. </fo:flow>
  143. </fo:page-sequence>
  144. </fo:root>