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.

linefeed-treatment_preserve.xml 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 linefeed-preservation.
  21. </p>
  22. </info>
  23. <fo>
  24. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  25. <fo:layout-master-set>
  26. <fo:simple-page-master page-width="21cm" page-height="29.7cm" master-name="spm0">
  27. <fo:region-body region-name="region-body" margin-bottom="1cm" margin-top="1.5cm"/>
  28. <fo:region-before region-name="header" precedence="false" extent="4cm"/>
  29. <fo:region-after region-name="footer" extent="1cm"/>
  30. </fo:simple-page-master>
  31. </fo:layout-master-set>
  32. <fo:page-sequence master-reference="spm0">
  33. <fo:flow flow-name="region-body">
  34. <fo:block hyphenate="false" font="8pt monospace"
  35. text-align="start" wrap-option="no-wrap"
  36. white-space="pre" line-stacking-strategy="font-height"
  37. background-color="yellow">First line yellow background
  38. <fo:inline background-color="red">Second line red background
  39. Third line red background</fo:inline>
  40. <fo:inline background-color="pink">
  41. Fifth line pink background; the above line has one preserved space character.</fo:inline>
  42. Seventh line yellow background; the above line is empty.</fo:block>
  43. <fo:block linefeed-treatment="preserve" background-color="blue"
  44. text-align="start" font="8pt Courier" color="yellow">
  45. <fo:inline background-color="orange">
  46. One line, surrounded by some linefeeds; orange line in blue block
  47. </fo:inline>
  48. </fo:block>
  49. </fo:flow>
  50. </fo:page-sequence>
  51. </fo:root>
  52. </fo>
  53. <checks>
  54. <eval expected="7" xpath="count(//block[1]/lineArea)" />
  55. <eval expected="10" xpath="count(//block[2]/lineArea)" />
  56. </checks>
  57. </testcase>