您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 colors.
  21. </p>
  22. </info>
  23. <fo>
  24. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="Gladiator">
  25. <fo:layout-master-set>
  26. <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
  27. <fo:region-body background-color="rgb-icc(100%,80%,80%,sRGB,1,0.8,0.8)" />
  28. </fo:simple-page-master>
  29. </fo:layout-master-set>
  30. <fo:declarations>
  31. <fo:color-profile src="../../../src/java/org/apache/fop/pdf/sRGB Color Space Profile.icm" color-profile-name="sRGB"/>
  32. <fo:color-profile src="nonexistent.icc" color-profile-name="unknown"/>
  33. </fo:declarations>
  34. <fo:page-sequence master-reference="normal" white-space-collapse="true">
  35. <fo:flow flow-name="xsl-region-body">
  36. <fo:block color="red">color "red"</fo:block>
  37. <fo:block color="rgb(255,128,0)">color "rgb(255,128,0)"</fo:block>
  38. <fo:block color="rgb(100%,50%,0%)">color "rgb(100%,50%,0%)"</fo:block>
  39. <fo:block color="rgb-icc(100%,50%,0%, sRGB, 1, 0.5, 0)">color "rgb-icc(100%,50%,0%, sRGB, 1, 0.5, 0)"</fo:block>
  40. <fo:block color="rgb-icc(0%,100%,0%, unknown, 1, 0.5, 0)">color "rgb-icc(0%,100%,0%, unknown, 1, 0.5, 0)"</fo:block>
  41. <fo:block color="cmyk(0%,0%,20%,40%)">color "cmyk(0%,0%,20%,40%)" (Khaki)</fo:block>
  42. <!-- NYI
  43. <fo:block color="rgb-icc(153, 153, 102, #CMYK, 0, 0, 0.2, 0.4)">color "rgb-icc(153, 153, 102, #CMYK, 0, 0, 0.2, 0.4)" (Khaki)</fo:block>
  44. -->
  45. </fo:flow>
  46. </fo:page-sequence>
  47. </fo:root>
  48. </fo>
  49. <checks>
  50. <!-- Check page -->
  51. <!-- Special case? rgb-icc() used before fo:declarations
  52. Revert to sRGB fallback for now -->
  53. <eval expected="color=#ffcccc" xpath="//regionViewport[1]/@background" />
  54. <eval expected="#ff0000" xpath="//block[1]//text/@color"/>
  55. <eval expected="#ff8000" xpath="//block[2]//text/@color"/>
  56. <eval expected="#ff8000" xpath="//block[3]//text/@color"/>
  57. <eval expected="fop-rgb-icc(1.0,0.5,0.0,sRGB,&quot;../../../src/java/org/apache/fop/pdf/sRGB Color Space Profile.icm&quot;,1.0,0.5,0.0)" xpath="//block[4]//text/@color"/>
  58. <eval expected="#00ff00" xpath="//block[5]//text/@color"/>
  59. <eval expected="cmyk(0.0,0.0,0.2,0.4)" xpath="//block[6]//text/@color"/>
  60. </checks>
  61. </testcase>