aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NOTICE2
-rw-r--r--build.xml5
-rw-r--r--fop.bat4
-rw-r--r--lib/xml-apis-1.3.04.jar (renamed from lib/xml-apis-1.3.02.jar)bin194205 -> 194354 bytes
-rw-r--r--lib/xml-apis-ext-1.3.04.jar (renamed from lib/xml-apis-ext.jar)bin85686 -> 85686 bytes
-rw-r--r--lib/xml-apis-ext.LICENSE.dom-documentation.txt73
-rw-r--r--lib/xml-apis-ext.LICENSE.dom-software.txt61
-rw-r--r--lib/xml-apis-ext.LICENSE.sac.html75
-rw-r--r--lib/xml-apis-ext.LICENSE.txt202
-rw-r--r--lib/xml-apis-ext.NOTICE.txt16
-rw-r--r--lib/xml-apis-ext.README.dom.txt56
-rw-r--r--src/documentation/content/xdocs/news.xml8
-rw-r--r--src/java/org/apache/fop/fonts/CustomFont.java11
-rw-r--r--src/java/org/apache/fop/fonts/FontDescriptor.java6
-rw-r--r--src/java/org/apache/fop/fonts/FontReader.java9
-rw-r--r--src/java/org/apache/fop/fonts/LazyFont.java10
-rw-r--r--src/java/org/apache/fop/fonts/autodetect/UnixFontDirFinder.java1
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/RowPainter.java11
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java50
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/TableStepper.java9
-rw-r--r--src/java/org/apache/fop/pdf/PDFFactory.java7
-rw-r--r--src/java/org/apache/fop/pdf/PDFFont.java2
-rw-r--r--src/java/org/apache/fop/pdf/PDFResources.java8
-rw-r--r--src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java11
-rw-r--r--src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java64
-rw-r--r--src/java/org/apache/fop/render/AbstractRenderer.java9
-rw-r--r--src/java/org/apache/fop/render/Graphics2DAdapter.java19
-rw-r--r--src/java/org/apache/fop/render/afp/AFPRenderer.java108
-rw-r--r--src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java4
-rw-r--r--src/java/org/apache/fop/render/pcl/PCLRenderer.java74
-rw-r--r--src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java4
-rw-r--r--src/java/org/apache/fop/render/ps/PSImageUtils.java29
-rw-r--r--src/java/org/apache/fop/render/xml/XMLRenderer.java14
-rw-r--r--src/java/org/apache/fop/util/CloseBlockerOutputStream.java12
-rw-r--r--status.xml23
-rw-r--r--test/java/org/apache/fop/StandardTestSuite.java2
-rw-r--r--test/java/org/apache/fop/fonts/TrueTypeAnsiTestCase.java107
-rw-r--r--test/java/org/apache/fop/fonts/fonttest.xsl24
-rw-r--r--test/layoutengine/standard-testcases/block-container_absolute-position_multi-column.xml71
-rw-r--r--test/layoutengine/standard-testcases/table-cell_bc-child.xml65
-rw-r--r--test/layoutengine/standard-testcases/table_border-collapse_collapse_spans_3.xml79
-rw-r--r--test/layoutengine/standard-testcases/table_bug44621.xml37
42 files changed, 1307 insertions, 75 deletions
diff --git a/NOTICE b/NOTICE
index 12fc2d569..880e36f18 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
Apache FOP
-Copyright 1999-2006 The Apache Software Foundation
+Copyright 1999-2008 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
diff --git a/build.xml b/build.xml
index c4eb1e94d..d744c16c1 100644
--- a/build.xml
+++ b/build.xml
@@ -808,6 +808,11 @@ list of possible build targets.
</fileset>
</classpath>
</javac>
+ <copy todir="${build.dir}/test-classes">
+ <fileset dir="${basedir}/test/java">
+ <include name="**/*.xsl"/>
+ </fileset>
+ </copy>
</target>
<target name="junit-compile-copy-resources" if="junit.present">
diff --git a/fop.bat b/fop.bat
index c2444a083..a01c5ddb7 100644
--- a/fop.bat
+++ b/fop.bat
@@ -55,8 +55,8 @@ set LIBDIR=%LOCAL_FOP_HOME%lib
set LOCALCLASSPATH=%LOCAL_FOP_HOME%build\fop.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LOCAL_FOP_HOME%build\fop-sandbox.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LOCAL_FOP_HOME%build\fop-hyph.jar
-set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis-1.3.02.jar
-set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis-ext.jar
+set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis-1.3.04.jar
+set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis-ext-1.3.04.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xercesImpl-2.7.1.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.7.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\serializer-2.7.0.jar
diff --git a/lib/xml-apis-1.3.02.jar b/lib/xml-apis-1.3.04.jar
index 243eaeaeb..d42c0ea6c 100644
--- a/lib/xml-apis-1.3.02.jar
+++ b/lib/xml-apis-1.3.04.jar
Binary files differ
diff --git a/lib/xml-apis-ext.jar b/lib/xml-apis-ext-1.3.04.jar
index a7869d68a..a7869d68a 100644
--- a/lib/xml-apis-ext.jar
+++ b/lib/xml-apis-ext-1.3.04.jar
Binary files differ
diff --git a/lib/xml-apis-ext.LICENSE.dom-documentation.txt b/lib/xml-apis-ext.LICENSE.dom-documentation.txt
new file mode 100644
index 000000000..3d84b5d6c
--- /dev/null
+++ b/lib/xml-apis-ext.LICENSE.dom-documentation.txt
@@ -0,0 +1,73 @@
+xml-commons/java/external/LICENSE.dom-documentation.txt $Id: LICENSE.dom-documentation.txt 226215 2005-06-03 22:49:13Z mrglavas $
+
+
+This license came from: http://www.w3.org/Consortium/Legal/copyright-documents-20021231
+
+
+W3C® DOCUMENT LICENSE
+http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231
+
+Public documents on the W3C site are provided by the copyright holders under
+the following license. By using and/or copying this document, or the W3C
+document from which this statement is linked, you (the licensee) agree that
+you have read, understood, and will comply with the following terms and
+conditions:
+
+Permission to copy, and distribute the contents of this document, or the W3C
+document from which this statement is linked, in any medium for any purpose
+and without fee or royalty is hereby granted, provided that you include the
+following on ALL copies of the document, or portions thereof, that you use:
+
+ 1. A link or URL to the original W3C document.
+ 2. The pre-existing copyright notice of the original author, or if it
+ doesn't exist, a notice (hypertext is preferred, but a textual
+ representation is permitted) of the form: "Copyright © [$date-of-document]
+ World Wide Web Consortium, (Massachusetts Institute of Technology,
+ European Research Consortium for Informatics and Mathematics, Keio
+ University). All Rights Reserved.
+ http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231"
+ 3. If it exists, the STATUS of the W3C document.
+
+When space permits, inclusion of the full text of this NOTICE should be
+provided. We request that authorship attribution be provided in any software,
+documents, or other items or products that you create pursuant to the
+implementation of the contents of this document, or any portion thereof.
+
+No right to create modifications or derivatives of W3C documents is granted
+pursuant to this license. However, if additional requirements (documented in
+the Copyright FAQ) are satisfied, the right to create modifications or
+derivatives is sometimes granted by the W3C to individuals complying with
+those requirements.
+
+THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO
+REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE
+FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT
+INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE
+PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.
+
+The name and trademarks of copyright holders may NOT be used in advertising
+or publicity pertaining to this document or its contents without specific,
+written prior permission. Title to copyright in this document will at all
+times remain with copyright holders.
+
+----------------------------------------------------------------------------
+
+This formulation of W3C's notice and license became active on December 31 2002.
+This version removes the copyright ownership notice such that this license can
+be used with materials other than those owned by the W3C, moves information on
+style sheets, DTDs, and schemas to the Copyright FAQ, reflects that ERCIM is
+now a host of the W3C, includes references to this specific dated version of
+the license, and removes the ambiguous grant of "use". See the older
+formulation for the policy prior to this date. Please see our Copyright FAQ for
+common questions about using materials from our site, such as the translating
+or annotating specifications. Other questions about this notice can be directed
+to site-policy@w3.org.
+
+Joseph Reagle <site-policy@w3.org>
+
+Last revised by Reagle $Date: 2005-06-03 18:49:13 -0400 (Fri, 03 Jun 2005) $
diff --git a/lib/xml-apis-ext.LICENSE.dom-software.txt b/lib/xml-apis-ext.LICENSE.dom-software.txt
new file mode 100644
index 000000000..c5fe5a48a
--- /dev/null
+++ b/lib/xml-apis-ext.LICENSE.dom-software.txt
@@ -0,0 +1,61 @@
+xml-commons/java/external/LICENSE.dom-software.txt $Id: LICENSE.dom-software.txt 226215 2005-06-03 22:49:13Z mrglavas $
+
+
+This license came from: http://www.w3.org/Consortium/Legal/copyright-software-20021231
+
+
+W3C® SOFTWARE NOTICE AND LICENSE
+http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+
+This work (and included software, documentation such as READMEs, or other
+related items) is being provided by the copyright holders under the following
+license. By obtaining, using and/or copying this work, you (the licensee) agree
+that you have read, understood, and will comply with the following terms and
+conditions.
+
+Permission to copy, modify, and distribute this software and its documentation,
+with or without modification, for any purpose and without fee or royalty is
+hereby granted, provided that you include the following on ALL copies of the
+software and documentation or portions thereof, including modifications:
+
+ 1. The full text of this NOTICE in a location viewable to users of the
+ redistributed or derivative work.
+ 2. Any pre-existing intellectual property disclaimers, notices, or terms
+ and conditions. If none exist, the W3C Software Short Notice should be
+ included (hypertext is preferred, text is permitted) within the body
+ of any redistributed or derivative code.
+ 3. Notice of any changes or modifications to the files, including the date
+ changes were made. (We recommend you provide URIs to the location from
+ which the code is derived.)
+
+THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE
+NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
+THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
+PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+The name and trademarks of copyright holders may NOT be used in advertising or
+publicity pertaining to the software without specific, written prior permission.
+Title to copyright in this software and any associated documentation will at
+all times remain with copyright holders.
+
+____________________________________
+
+This formulation of W3C's notice and license became active on December 31 2002.
+This version removes the copyright ownership notice such that this license can
+be used with materials other than those owned by the W3C, reflects that ERCIM
+is now a host of the W3C, includes references to this specific dated version of
+the license, and removes the ambiguous grant of "use". Otherwise, this version
+is the same as the previous version and is written so as to preserve the Free
+Software Foundation's assessment of GPL compatibility and OSI's certification
+under the Open Source Definition. Please see our Copyright FAQ for common
+questions about using materials from our site, including specific terms and
+conditions for packages like libwww, Amaya, and Jigsaw. Other questions about
+this notice can be directed to site-policy@w3.org.
+
+Joseph Reagle <site-policy@w3.org>
+
+Last revised by Reagle $Date: 2005-06-03 18:49:13 -0400 (Fri, 03 Jun 2005) $
diff --git a/lib/xml-apis-ext.LICENSE.sac.html b/lib/xml-apis-ext.LICENSE.sac.html
new file mode 100644
index 000000000..46abc5c63
--- /dev/null
+++ b/lib/xml-apis-ext.LICENSE.sac.html
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- $Id: LICENSE.sac.html 477037 2006-11-20 04:30:53Z mrglavas $ -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>W3C IPR SOFTWARE NOTICE</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <style type='text/css'>
+ body { background: white; color: black; }
+ </style>
+</head>
+
+<body>
+<h1>W3C IPR SOFTWARE NOTICE</h1>
+
+<h3>Copyright © 2002 World Wide Web Consortium, (Massachusetts Institute of
+Technology, Institut National de Recherche en Informatique et en Automatique,
+Keio University). All Rights Reserved.</h3>
+
+<p><b>Note:</b> The original version of the W3C Software Copyright Notice and
+License could be found at <a
+href="http://www.w3.org/Consortium/Legal/copyright-software-19980720">http://www.w3.org/Consortium/Legal/copyright-software-19980720</a></p>
+
+<h3>Copyright © 1994-2002 <a href="http://www.w3.org/">World Wide Web
+Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts Institute of
+Technology</a>, <a href="http://www.inria.fr/">Institut National de Recherche
+en Informatique et en Automatique</a>, <a href="http://www.keio.ac.jp/">Keio
+University</a>). All Rights Reserved. http://www.w3.org/Consortium/Legal/</h3>
+
+<p>This W3C work (including software, documents, or other related items) is
+being provided by the copyright holders under the following license. By
+obtaining, using and/or copying this work, you (the licensee) agree that you
+have read, understood, and will comply with the following terms and
+conditions:</p>
+
+<p>Permission to use, copy, and modify this software and its documentation,
+with or without modification,  for any purpose and without fee or royalty is
+hereby granted, provided that you include the following on ALL copies of the
+software and documentation or portions thereof, including modifications, that
+you make:</p>
+<ol>
+ <li>The full text of this NOTICE in a location viewable to users of the
+ redistributed or derivative work.</li>
+ <li>Any pre-existing intellectual property disclaimers, notices, or terms
+ and conditions. If none exist, a short notice of the following form
+ (hypertext is preferred, text is permitted) should be used within the body
+ of any redistributed or derivative code: "Copyright © 2002
+ <a href="http://www.w3.org/">World Wide Web Consortium</a>, (<a
+ href="http://www.lcs.mit.edu/">Massachusetts Institute of Technology</a>,
+ <a href="http://www.inria.fr/">Institut National de Recherche en
+ Informatique et en Automatique</a>, <a href="http://www.keio.ac.jp/">Keio
+ University</a>). All Rights Reserved.
+ http://www.w3.org/Consortium/Legal/"</li>
+ <li>Notice of any changes or modifications to the W3C files, including the
+ date changes were made. (We recommend you provide URIs to the location
+ from which the code is derived.)</li>
+</ol>
+
+<p>THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS
+MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
+PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY
+THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.</p>
+
+<p>COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
+DOCUMENTATION.</p>
+
+<p>The name and trademarks of copyright holders may NOT be used in advertising
+or publicity pertaining to the software without specific, written prior
+permission. Title to copyright in this software and any associated
+documentation will at all times remain with copyright holders.</p>
+</body>
+</html>
diff --git a/lib/xml-apis-ext.LICENSE.txt b/lib/xml-apis-ext.LICENSE.txt
new file mode 100644
index 000000000..d64569567
--- /dev/null
+++ b/lib/xml-apis-ext.LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/lib/xml-apis-ext.NOTICE.txt b/lib/xml-apis-ext.NOTICE.txt
new file mode 100644
index 000000000..f6d34b5ee
--- /dev/null
+++ b/lib/xml-apis-ext.NOTICE.txt
@@ -0,0 +1,16 @@
+ =========================================================================
+ == NOTICE file corresponding to section 4(d) of the Apache License, ==
+ == Version 2.0, in this case for the Apache xml-commons xml-apis ==
+ == distribution. ==
+ =========================================================================
+
+ Apache XML Commons XML APIs
+ Copyright 2006 The Apache Software Foundation.
+
+ This product includes software developed at
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Portions of this software were originally based on the following:
+ - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
+ - software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
+ - software copyright (c) 2000 World Wide Web Consortium, http://www.w3.org
diff --git a/lib/xml-apis-ext.README.dom.txt b/lib/xml-apis-ext.README.dom.txt
new file mode 100644
index 000000000..bde694497
--- /dev/null
+++ b/lib/xml-apis-ext.README.dom.txt
@@ -0,0 +1,56 @@
+xml-commons/java/external/README.dom.txt $Id: README.dom.txt 477038 2006-11-20 04:40:36Z mrglavas $
+
+
+HEAR YE, HEAR YE!
+
+
+All of the .java software and associated documentation about
+the DOM in this repository are distributed under the license
+from the W3C, which is provided herein.
+
+
+LICENSE.dom-software.txt covers all software from the W3C
+including the following items in the xml-commons project:
+
+ xml-commons/java/external/src/org/w3c
+ and all subdirectories
+
+(Note: SAC (The Simple API for CSS) has been published under an older
+version of the W3C license. The original license file is LICENSE.sac.html.)
+
+LICENSE.dom-documentation.txt covers all documentation from the W3C
+including the following items in the xml-commons project:
+
+ xml-commons/java/external/xdocs/dom
+ and all subdirectories
+
+The actual DOM Java Language Binding classes in xml-commons came from:
+ http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html
+
+The specification of DOM Level 3's various parts is at:
+ http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/
+ http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/
+ http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226/
+
+The specification of DOM Level 2's various parts is at:
+ http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/
+ http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/
+ http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113/
+ http://www.w3.org/TR/2000/REC-DOM-Level-2-Views-20001113/
+
+The specification of DOM Level 1's various parts is at:
+ http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html
+
+Links to all available W3C DOM Java Bindings can be found at:
+ http://www.w3.org/DOM/DOMTR
+
+The actual classes of The Simple API for CSS (SAC) came from:
+ http://www.w3.org/Style/CSS/SAC/
+ http://www.w3.org/2002/06/sacjava-1.3.zip
+
+The actual DOM Java Language Binding classes for SMIL came from:
+ http://dev.w3.org/cvsweb/java/classes/org/w3c/dom/smil/
+ (both ElementTimeControl.java and TimeEvent.java were taken at revision 1.1)
+
+The actual DOM Java Language Binding classes for SVG 1.1 came from:
+ http://www.w3.org/TR/SVG11/java.html \ No newline at end of file
diff --git a/src/documentation/content/xdocs/news.xml b/src/documentation/content/xdocs/news.xml
index 0a4467e66..1a5c178e2 100644
--- a/src/documentation/content/xdocs/news.xml
+++ b/src/documentation/content/xdocs/news.xml
@@ -24,6 +24,14 @@
</header>
<body>
<section>
+ <title>26th March 2007 - Apache FOP 0.95beta Released</title>
+ <p>The Apache FOP team is delighted to present you a beta version of the
+ next production grade release of the new FOP codebase. This release
+ contains many bug fixes and new features. See the <a
+ href="0.95/releaseNotes_0.95beta.html">Release Notes</a> for a list of
+ the most important changes.</p>
+ </section>
+ <section>
<title>30 October 2007 - New Committer</title>
<p>Welcome Max Berger!</p>
</section>
diff --git a/src/java/org/apache/fop/fonts/CustomFont.java b/src/java/org/apache/fop/fonts/CustomFont.java
index f6bb52cb3..1f782b2ea 100644
--- a/src/java/org/apache/fop/fonts/CustomFont.java
+++ b/src/java/org/apache/fop/fonts/CustomFont.java
@@ -190,12 +190,17 @@ public abstract class CustomFont extends Typeface
return fontBBox;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public int getFlags() {
return flags;
}
+
+ /** {@inheritDoc} */
+ public boolean isSymbolicFont() {
+ return ((getFlags() & 4) != 0) || "ZapfDingbatsEncoding".equals(getEncodingName());
+ //Note: The check for ZapfDingbats is necessary as the PFM does not reliably indicate
+ //if a font is symbolic.
+ }
/**
* Returns the font weight (100, 200...800, 900). This value may be different from the
diff --git a/src/java/org/apache/fop/fonts/FontDescriptor.java b/src/java/org/apache/fop/fonts/FontDescriptor.java
index 841d99de2..fb9c7d02e 100644
--- a/src/java/org/apache/fop/fonts/FontDescriptor.java
+++ b/src/java/org/apache/fop/fonts/FontDescriptor.java
@@ -53,7 +53,11 @@ public interface FontDescriptor extends FontMetrics {
*/
int getFlags();
-
+ /**
+ * Indicates whether the font is a symbolic font.
+ * @return true if the font is a symbolic font (i.e. Symbol or ZapfDingbats)
+ */
+ boolean isSymbolicFont();
/**
* Returns the font's bounding box.
* @return the bounding box
diff --git a/src/java/org/apache/fop/fonts/FontReader.java b/src/java/org/apache/fop/fonts/FontReader.java
index 51d90c7e5..6f148f503 100644
--- a/src/java/org/apache/fop/fonts/FontReader.java
+++ b/src/java/org/apache/fop/fonts/FontReader.java
@@ -27,8 +27,6 @@ import java.util.Set;
import javax.xml.parsers.SAXParserFactory;
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.fonts.apps.TTFReader;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
@@ -36,6 +34,9 @@ import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.fonts.apps.TTFReader;
+
/**
* Class for reading a metric.xml file and creating a font object.
* Typical usage:
@@ -228,11 +229,11 @@ public class FontReader extends DefaultHandler {
if ("font-name".equals(localName)) {
returnFont.setFontName(content);
} else if ("full-name".equals(localName)) {
- multiFont.setFullName(content);
+ returnFont.setFullName(content);
} else if ("family-name".equals(localName)) {
Set s = new java.util.HashSet();
s.add(content);
- multiFont.setFamilyNames(s);
+ returnFont.setFamilyNames(s);
} else if ("ttc-name".equals(localName) && isCID) {
multiFont.setTTCName(content);
} else if ("encoding".equals(localName)) {
diff --git a/src/java/org/apache/fop/fonts/LazyFont.java b/src/java/org/apache/fop/fonts/LazyFont.java
index b4f7773a3..70b971fff 100644
--- a/src/java/org/apache/fop/fonts/LazyFont.java
+++ b/src/java/org/apache/fop/fonts/LazyFont.java
@@ -321,14 +321,18 @@ public class LazyFont extends Typeface implements FontDescriptor {
return realFontDescriptor.getAscender();
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public int getFlags() {
load(true);
return realFontDescriptor.getFlags();
}
+ /** {@inheritDoc} */
+ public boolean isSymbolicFont() {
+ load(true);
+ return realFontDescriptor.isSymbolicFont();
+ }
+
/**
* {@inheritDoc}
*/
diff --git a/src/java/org/apache/fop/fonts/autodetect/UnixFontDirFinder.java b/src/java/org/apache/fop/fonts/autodetect/UnixFontDirFinder.java
index 55a7ae1c0..d59fd5c7e 100644
--- a/src/java/org/apache/fop/fonts/autodetect/UnixFontDirFinder.java
+++ b/src/java/org/apache/fop/fonts/autodetect/UnixFontDirFinder.java
@@ -32,6 +32,7 @@ public class UnixFontDirFinder extends NativeFontDirFinder {
return new String[] {
System.getProperty("user.home") + "/.fonts", // user
"/usr/local/fonts", // local
+ "/usr/local/share/fonts", // local shared
"/usr/share/fonts", // system
"/usr/X11R6/lib/X11/fonts" // X
};
diff --git a/src/java/org/apache/fop/layoutmgr/table/RowPainter.java b/src/java/org/apache/fop/layoutmgr/table/RowPainter.java
index bed9c53ae..d432c7657 100644
--- a/src/java/org/apache/fop/layoutmgr/table/RowPainter.java
+++ b/src/java/org/apache/fop/layoutmgr/table/RowPainter.java
@@ -229,8 +229,12 @@ class RowPainter {
// Then add areas for cells finishing on the current row
for (int i = 0; i < colCount; i++) {
- GridUnit currentGU = currentRow.getGridUnit(i);
- if (!currentGU.isEmpty() && currentGU.getColSpanIndex() == 0
+ GridUnit currentGU = currentRow.getGridUnit(i);
+ if (currentGU.isEmpty()) {
+ // TODO remove once missing cells are properly implemented (i.e., replaced
+ // by an fo:table-cell element containing an empty fo:block)
+ firstCellOnPage[i] = false;
+ } else if (currentGU.getColSpanIndex() == 0
&& (lastInPart || currentGU.isLastGridUnitRowSpan())
&& firstCellParts[i] != null) {
assert firstCellParts[i].pgu == currentGU.getPrimary();
@@ -260,7 +264,8 @@ class RowPainter {
actualRowHeight, borderBeforeWhich, borderAfterWhich,
lastOnPage);
firstCellParts[i] = null;
- firstCellOnPage[i] = false;
+ Arrays.fill(firstCellOnPage, i, i + currentGU.getCell().getNumberColumnsSpanned(),
+ false);
}
}
currentRowOffset += actualRowHeight;
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
index 7a2ee171c..9b4a03a67 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
@@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.ListIterator;
import java.util.Map;
import org.apache.commons.logging.Log;
@@ -41,6 +42,7 @@ import org.apache.fop.layoutmgr.ElementListUtils;
import org.apache.fop.layoutmgr.KeepUtil;
import org.apache.fop.layoutmgr.KnuthBox;
import org.apache.fop.layoutmgr.KnuthElement;
+import org.apache.fop.layoutmgr.KnuthGlue;
import org.apache.fop.layoutmgr.KnuthPossPosIter;
import org.apache.fop.layoutmgr.LayoutContext;
import org.apache.fop.layoutmgr.ListElement;
@@ -232,6 +234,17 @@ public class TableContentLayoutManager implements PercentBaseContext {
//Get elements for next row group
nextRowGroupElems = rowGroupLM.getNextKnuthElements(context, alignment, bodyType);
+ /*
+ * The last break element produced by TableStepper (for the previous row
+ * group) may be used to represent the break between the two row groups.
+ * Its penalty value and break class must just be overridden by the
+ * characteristics of the keep or break between the two.
+ *
+ * However, we mustn't forget that if the after border of the last row of
+ * the row group is thicker in the normal case than in the trailing case,
+ * an additional glue will be appended to the element list. So we may have
+ * to go two steps backwards in the list.
+ */
//Determine keep constraints
int penaltyStrength = BlockLevelLayoutManager.KEEP_AUTO;
@@ -246,24 +259,35 @@ public class TableContentLayoutManager implements PercentBaseContext {
if (breakBetween != Constants.EN_AUTO) {
penaltyValue = -KnuthElement.INFINITE;
}
- TableHFPenaltyPosition penaltyPos = new TableHFPenaltyPosition(getTableLM());
- int penaltyLen = 0;
- if (bodyType == TableRowIterator.BODY) {
- if (!getTableLM().getTable().omitHeaderAtBreak()) {
- penaltyLen += getHeaderNetHeight();
- penaltyPos.headerElements = getHeaderElements();
- }
- if (!getTableLM().getTable().omitFooterAtBreak()) {
- penaltyLen += getFooterNetHeight();
- penaltyPos.footerElements = getFooterElements();
- }
+ BreakElement breakElement;
+ ListIterator elemIter = returnList.listIterator(returnList.size());
+ ListElement elem = (ListElement) elemIter.previous();
+ if (elem instanceof KnuthGlue) {
+ breakElement = (BreakElement) elemIter.previous();
+ } else {
+ breakElement = (BreakElement) elem;
}
- returnList.add(new BreakElement(penaltyPos,
- penaltyLen, penaltyValue, breakBetween, context));
+ breakElement.setPenaltyValue(penaltyValue);
+ breakElement.setBreakClass(breakBetween);
returnList.addAll(nextRowGroupElems);
breakBetween = context.getBreakAfter();
}
}
+ /*
+ * The last break produced for the last row-group of this table part must be
+ * removed, because the breaking after the table will be handled by TableLM.
+ * Unless the element list ends with a glue, which must be kept to accurately
+ * represent the content. In such a case the break is simply disabled by setting
+ * its penalty to infinite.
+ */
+ ListIterator elemIter = returnList.listIterator(returnList.size());
+ ListElement elem = (ListElement) elemIter.previous();
+ if (elem instanceof KnuthGlue) {
+ BreakElement breakElement = (BreakElement) elemIter.previous();
+ breakElement.setPenaltyValue(KnuthElement.INFINITE);
+ } else {
+ elemIter.remove();
+ }
context.updateKeepWithPreviousPending(keepWithPrevious);
context.setBreakBefore(breakBefore);
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableStepper.java b/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
index 7c963338f..6aa619368 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
@@ -282,13 +282,8 @@ public class TableStepper {
laststep = step;
step = getNextStep();
} while (step >= 0);
- if (!returnList.isEmpty()) {
- lastTCPos.setFlag(TableContentPosition.LAST_IN_ROWGROUP, true);
- // It's not up to TableStepper to decide whether there can/must be a break
- // after the row group or not, but to ancestor stacking elements
- assert returnList.getLast() instanceof BreakElement;
- returnList.removeLast();
- }
+ assert !returnList.isEmpty();
+ lastTCPos.setFlag(TableContentPosition.LAST_IN_ROWGROUP, true);
return returnList;
}
diff --git a/src/java/org/apache/fop/pdf/PDFFactory.java b/src/java/org/apache/fop/pdf/PDFFactory.java
index 02f0c2cdb..6211b5da7 100644
--- a/src/java/org/apache/fop/pdf/PDFFactory.java
+++ b/src/java/org/apache/fop/pdf/PDFFactory.java
@@ -1203,10 +1203,11 @@ public class PDFFactory {
PDFFontDescriptor pdfdesc = makeFontDescriptor(descriptor);
PDFFont font = null;
- font = PDFFont.createFont(fontname, fonttype, basefont, encoding);
+ font = PDFFont.createFont(fontname, fonttype, basefont, null);
getDocument().registerObject(font);
if (fonttype == FontType.TYPE0) {
+ font.setEncoding(encoding);
CIDFont cidMetrics;
if (metrics instanceof LazyFont) {
cidMetrics = (CIDFont)((LazyFont) metrics).getRealFont();
@@ -1252,7 +1253,9 @@ public class PDFFactory {
//Handle encoding
SingleByteEncoding mapping = singleByteFont.getEncoding();
- if (PDFEncoding.isPredefinedEncoding(mapping.getName())) {
+ if (singleByteFont.isSymbolicFont()) {
+ //no encoding, use the font's encoding
+ } else if (PDFEncoding.isPredefinedEncoding(mapping.getName())) {
font.setEncoding(mapping.getName());
} else {
Object pdfEncoding = createPDFEncoding(mapping,
diff --git a/src/java/org/apache/fop/pdf/PDFFont.java b/src/java/org/apache/fop/pdf/PDFFont.java
index 14f1a657c..1f76f1e11 100644
--- a/src/java/org/apache/fop/pdf/PDFFont.java
+++ b/src/java/org/apache/fop/pdf/PDFFont.java
@@ -62,8 +62,6 @@ public class PDFFont extends PDFDictionary {
setEncoding((PDFEncoding)encoding);
} else if (encoding instanceof String) {
setEncoding((String)encoding);
- } else {
- throw new IllegalArgumentException("Illegal value for encoding");
}
}
diff --git a/src/java/org/apache/fop/pdf/PDFResources.java b/src/java/org/apache/fop/pdf/PDFResources.java
index b0c0128e1..da213bb87 100644
--- a/src/java/org/apache/fop/pdf/PDFResources.java
+++ b/src/java/org/apache/fop/pdf/PDFResources.java
@@ -28,6 +28,8 @@ import java.util.Set;
import org.apache.fop.fonts.FontDescriptor;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.fonts.Typeface;
+import org.apache.fop.fonts.base14.Symbol;
+import org.apache.fop.fonts.base14.ZapfDingbats;
import org.apache.fop.util.ColorProfileUtil;
/**
@@ -109,8 +111,12 @@ public class PDFResources extends PDFObject {
if (font instanceof FontDescriptor) {
desc = (FontDescriptor)font;
}
+ String encoding = font.getEncodingName();
+ if (font instanceof Symbol || font instanceof ZapfDingbats) {
+ encoding = null; //Symbolic fonts shouldn't specify an encoding value in PDF
+ }
addFont(doc.getFactory().makeFont(
- f, font.getEmbedFontName(), font.getEncodingName(), font, desc));
+ f, font.getEmbedFontName(), encoding, font, desc));
}
}
}
diff --git a/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java b/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java
index bc7bb95a1..e91947ba5 100644
--- a/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java
+++ b/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java
@@ -32,12 +32,13 @@ import java.awt.image.ComponentColorModel;
import java.awt.image.DataBuffer;
import java.awt.image.Raster;
import java.awt.image.WritableRaster;
+import java.io.IOException;
import org.apache.fop.render.RendererContext.RendererContextWrapper;
import org.apache.fop.util.UnitConv;
/**
- * Graphics2DAdapter implementation for PCL and HP GL/2.
+ * Abstract base class for Graphics2DAdapter implementations.
*/
public abstract class AbstractGraphics2DAdapter implements Graphics2DAdapter {
@@ -135,4 +136,12 @@ public abstract class AbstractGraphics2DAdapter implements Graphics2DAdapter {
RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
}
+ /** {@inheritDoc} */
+ public void paintImage(Graphics2DImagePainter painter,
+ RendererContext context,
+ int x, int y, int width, int height) throws IOException {
+ paintImage((org.apache.xmlgraphics.java2d.Graphics2DImagePainter)painter,
+ context, x, y, width, height);
+ }
+
}
diff --git a/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java b/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java
index b38d973c5..eb0668d8b 100644
--- a/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java
+++ b/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java
@@ -37,6 +37,7 @@ import org.apache.fop.area.Area;
import org.apache.fop.area.Block;
import org.apache.fop.area.BlockViewport;
import org.apache.fop.area.CTM;
+import org.apache.fop.area.NormalFlow;
import org.apache.fop.area.RegionViewport;
import org.apache.fop.area.Trait;
import org.apache.fop.area.inline.ForeignObject;
@@ -521,6 +522,69 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
}
}
+ /** {@inheritDoc} */
+ protected void renderReferenceArea(Block block) {
+ // save position and offset
+ int saveIP = currentIPPosition;
+ int saveBP = currentBPPosition;
+
+ //Establish a new coordinate system
+ AffineTransform at = new AffineTransform();
+ at.translate(currentIPPosition, currentBPPosition);
+ at.translate(block.getXOffset(), block.getYOffset());
+ at.translate(0, block.getSpaceBefore());
+
+ if (!at.isIdentity()) {
+ saveGraphicsState();
+ concatenateTransformationMatrix(mptToPt(at));
+ }
+
+ currentIPPosition = 0;
+ currentBPPosition = 0;
+ handleBlockTraits(block);
+
+ List children = block.getChildAreas();
+ if (children != null) {
+ renderBlocks(block, children);
+ }
+
+ if (!at.isIdentity()) {
+ restoreGraphicsState();
+ }
+
+ // stacked and relative blocks effect stacking
+ currentIPPosition = saveIP;
+ currentBPPosition = saveBP;
+ }
+
+ /** {@inheritDoc} */
+ protected void renderFlow(NormalFlow flow) {
+ // save position and offset
+ int saveIP = currentIPPosition;
+ int saveBP = currentBPPosition;
+
+ //Establish a new coordinate system
+ AffineTransform at = new AffineTransform();
+ at.translate(currentIPPosition, currentBPPosition);
+
+ if (!at.isIdentity()) {
+ saveGraphicsState();
+ concatenateTransformationMatrix(mptToPt(at));
+ }
+
+ currentIPPosition = 0;
+ currentBPPosition = 0;
+ super.renderFlow(flow);
+
+ if (!at.isIdentity()) {
+ restoreGraphicsState();
+ }
+
+ // stacked and relative blocks effect stacking
+ currentIPPosition = saveIP;
+ currentBPPosition = saveBP;
+ }
+
/**
* Concatenates the current transformation matrix with the given one, therefore establishing
* a new coordinate system.
diff --git a/src/java/org/apache/fop/render/AbstractRenderer.java b/src/java/org/apache/fop/render/AbstractRenderer.java
index 816fa4067..20eceac8c 100644
--- a/src/java/org/apache/fop/render/AbstractRenderer.java
+++ b/src/java/org/apache/fop/render/AbstractRenderer.java
@@ -484,6 +484,13 @@ public abstract class AbstractRenderer
}
/**
+ * Renders a block area that represents a reference area. The reference area establishes
+ * a new coordinate system.
+ * @param block the block area
+ */
+ protected abstract void renderReferenceArea(Block block);
+
+ /**
* Renders a list of block areas.
*
* @param parent the parent block if the parent is a block, otherwise
@@ -551,6 +558,8 @@ public abstract class AbstractRenderer
// simply move position
currentBPPosition += block.getAllocBPD();
}
+ } else if (Boolean.TRUE.equals(block.getTrait(Trait.IS_REFERENCE_AREA))) {
+ renderReferenceArea(block);
} else {
// save position and offset
int saveIP = currentIPPosition;
diff --git a/src/java/org/apache/fop/render/Graphics2DAdapter.java b/src/java/org/apache/fop/render/Graphics2DAdapter.java
index 0123e04a1..4fbdbe09a 100644
--- a/src/java/org/apache/fop/render/Graphics2DAdapter.java
+++ b/src/java/org/apache/fop/render/Graphics2DAdapter.java
@@ -47,4 +47,23 @@ public interface Graphics2DAdapter {
RendererContext context,
int x, int y, int width, int height) throws IOException;
+ /**
+ * Paints an arbitrary images on a given Graphics2D instance. The renderer
+ * providing this functionality must set up a Graphics2D instance so that
+ * the image with the given extents (in mpt) can be painted by the painter
+ * passed to this method. The Graphics2DImagePainter is then passed this
+ * Graphics2D instance so the image can be painted.
+ * @param painter the painter which will paint the actual image
+ * @param context the renderer context for the current renderer
+ * @param x X position of the image
+ * @param y Y position of the image
+ * @param width width of the image
+ * @param height height of the image
+ * @throws IOException In case of an I/O error while writing the output format
+ * @deprecated Use the variant with the Graphics2DImagePainter from XML Graphics Commons instead
+ */
+ void paintImage(Graphics2DImagePainter painter,
+ RendererContext context,
+ int x, int y, int width, int height) throws IOException;
+
}
diff --git a/src/java/org/apache/fop/render/afp/AFPRenderer.java b/src/java/org/apache/fop/render/afp/AFPRenderer.java
index 045ba9835..5c8e80312 100644
--- a/src/java/org/apache/fop/render/afp/AFPRenderer.java
+++ b/src/java/org/apache/fop/render/afp/AFPRenderer.java
@@ -59,6 +59,7 @@ import org.apache.fop.area.Block;
import org.apache.fop.area.BlockViewport;
import org.apache.fop.area.BodyRegion;
import org.apache.fop.area.CTM;
+import org.apache.fop.area.NormalFlow;
import org.apache.fop.area.OffDocumentItem;
import org.apache.fop.area.PageViewport;
import org.apache.fop.area.RegionReference;
@@ -467,9 +468,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void renderBlockViewport(BlockViewport bv, List children) {
// clip and position viewport if necessary
@@ -591,6 +590,76 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
}
/** {@inheritDoc} */
+ protected void renderReferenceArea(Block block) {
+ //TODO Remove this method once concatenateTransformationMatrix() is implemented
+
+ // save position and offset
+ int saveIP = currentIPPosition;
+ int saveBP = currentBPPosition;
+
+ //Establish a new coordinate system
+ AffineTransform at = new AffineTransform();
+ at.translate(currentIPPosition, currentBPPosition);
+ at.translate(block.getXOffset(), block.getYOffset());
+ at.translate(0, block.getSpaceBefore());
+
+ if (!at.isIdentity()) {
+ Rectangle2D contentRect
+ = new Rectangle2D.Double(at.getTranslateX(), at.getTranslateY(),
+ block.getAllocIPD(), block.getAllocBPD());
+ pushViewPortPos(new ViewPortPos(contentRect, new CTM(at)));
+ }
+
+ currentIPPosition = 0;
+ currentBPPosition = 0;
+ handleBlockTraits(block);
+
+ List children = block.getChildAreas();
+ if (children != null) {
+ renderBlocks(block, children);
+ }
+
+ if (!at.isIdentity()) {
+ popViewPortPos();
+ }
+
+ // stacked and relative blocks effect stacking
+ currentIPPosition = saveIP;
+ currentBPPosition = saveBP;
+ }
+
+ /** {@inheritDoc} */
+ protected void renderFlow(NormalFlow flow) {
+ // save position and offset
+ int saveIP = currentIPPosition;
+ int saveBP = currentBPPosition;
+
+ //Establish a new coordinate system
+ AffineTransform at = new AffineTransform();
+ at.translate(currentIPPosition, currentBPPosition);
+
+ if (!at.isIdentity()) {
+ Rectangle2D contentRect
+ = new Rectangle2D.Double(at.getTranslateX(), at.getTranslateY(),
+ flow.getAllocIPD(), flow.getAllocBPD());
+ pushViewPortPos(new ViewPortPos(contentRect, new CTM(at)));
+ }
+
+ currentIPPosition = 0;
+ currentBPPosition = 0;
+ super.renderFlow(flow);
+
+ if (!at.isIdentity()) {
+ popViewPortPos();
+ }
+
+ // stacked and relative blocks effect stacking
+ currentIPPosition = saveIP;
+ currentBPPosition = saveBP;
+ }
+
+
+ /** {@inheritDoc} */
protected void concatenateTransformationMatrix(AffineTransform at) {
//Not used here since AFPRenderer defines its own renderBlockViewport() method.
throw new UnsupportedOperationException("NYI");
@@ -1218,20 +1287,24 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
}
}
- /**
- * Restores the state stack after a break out.
- * @param breakOutList the state stack to restore.
- */
- public void restoreStateStackAfterBreakOut(List breakOutList) {
-
+ /** {@inheritDoc} */
+ public List breakOutOfStateStack() {
+ log.debug("Block.FIXED --> break out");
+ List breakOutList = new java.util.ArrayList();
+ //Don't pop the last ViewPortPos (created by renderPage())
+ while (this.viewPortPositions.size() > 1) {
+ breakOutList.add(0, popViewPortPos());
+ }
+ return breakOutList;
}
- /**
- * Breaks out of the state stack to handle fixed block-containers.
- * @return the saved state stack to recreate later
- */
- public List breakOutOfStateStack() {
- return null;
+ /** {@inheritDoc} */
+ public void restoreStateStackAfterBreakOut(List breakOutList) {
+ log.debug("Block.FIXED --> restoring context after break-out");
+ for (int i = 0, c = breakOutList.size(); i < c; i++) {
+ ViewPortPos vps = (ViewPortPos)breakOutList.get(i);
+ pushViewPortPos(vps);
+ }
}
/** Saves the graphics state of the rendering engine. */
@@ -1755,12 +1828,13 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
afpDataStream.setOffsets(vpp.x, vpp.y, vpp.rot);
}
- private void popViewPortPos() {
- viewPortPositions.remove(viewPortPositions.size() - 1);
+ private ViewPortPos popViewPortPos() {
+ ViewPortPos current = (ViewPortPos)viewPortPositions.remove(viewPortPositions.size() - 1);
if (viewPortPositions.size() > 0) {
ViewPortPos vpp = (ViewPortPos)viewPortPositions.get(viewPortPositions.size() - 1);
afpDataStream.setOffsets(vpp.x, vpp.y, vpp.rot);
}
+ return current;
}
/**
diff --git a/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java b/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java
index 48feba135..b29378a96 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java
@@ -28,13 +28,13 @@ import java.io.IOException;
import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
-import org.apache.fop.render.Graphics2DAdapter;
+import org.apache.fop.render.AbstractGraphics2DAdapter;
import org.apache.fop.render.RendererContext;
/**
* Graphics2DAdapter implementation for Java2D.
*/
-public class Java2DGraphics2DAdapter implements Graphics2DAdapter {
+public class Java2DGraphics2DAdapter extends AbstractGraphics2DAdapter {
/** {@inheritDoc} */
public void paintImage(Graphics2DImagePainter painter,
diff --git a/src/java/org/apache/fop/render/pcl/PCLRenderer.java b/src/java/org/apache/fop/render/pcl/PCLRenderer.java
index 988517cc7..7ab46c24e 100644
--- a/src/java/org/apache/fop/render/pcl/PCLRenderer.java
+++ b/src/java/org/apache/fop/render/pcl/PCLRenderer.java
@@ -66,6 +66,7 @@ import org.apache.fop.area.Area;
import org.apache.fop.area.Block;
import org.apache.fop.area.BlockViewport;
import org.apache.fop.area.CTM;
+import org.apache.fop.area.NormalFlow;
import org.apache.fop.area.PageViewport;
import org.apache.fop.area.RegionViewport;
import org.apache.fop.area.Trait;
@@ -1028,6 +1029,79 @@ public class PCLRenderer extends PrintRenderer {
//currentFontName = saveFontName;
}
+ /** {@inheritDoc} */
+ protected void renderReferenceArea(Block block) {
+ //TODO This is the same code as in AbstractPathOrientedRenderer
+ //So there's some optimization potential but not otherwise PCLRenderer is a little
+ //difficult to derive from AbstractPathOrientedRenderer. Maybe an additional layer
+ //between PrintRenderer and AbstractPathOrientedRenderer is necessary.
+
+ // save position and offset
+ int saveIP = currentIPPosition;
+ int saveBP = currentBPPosition;
+
+ //Establish a new coordinate system
+ AffineTransform at = new AffineTransform();
+ at.translate(currentIPPosition, currentBPPosition);
+ at.translate(block.getXOffset(), block.getYOffset());
+ at.translate(0, block.getSpaceBefore());
+
+ if (!at.isIdentity()) {
+ saveGraphicsState();
+ concatenateTransformationMatrix(mptToPt(at));
+ }
+
+ currentIPPosition = 0;
+ currentBPPosition = 0;
+ handleBlockTraits(block);
+
+ List children = block.getChildAreas();
+ if (children != null) {
+ renderBlocks(block, children);
+ }
+
+ if (!at.isIdentity()) {
+ restoreGraphicsState();
+ }
+
+ // stacked and relative blocks effect stacking
+ currentIPPosition = saveIP;
+ currentBPPosition = saveBP;
+ }
+
+ /** {@inheritDoc} */
+ protected void renderFlow(NormalFlow flow) {
+ //TODO This is the same code as in AbstractPathOrientedRenderer
+ //So there's some optimization potential but not otherwise PCLRenderer is a little
+ //difficult to derive from AbstractPathOrientedRenderer. Maybe an additional layer
+ //between PrintRenderer and AbstractPathOrientedRenderer is necessary.
+
+ // save position and offset
+ int saveIP = currentIPPosition;
+ int saveBP = currentBPPosition;
+
+ //Establish a new coordinate system
+ AffineTransform at = new AffineTransform();
+ at.translate(currentIPPosition, currentBPPosition);
+
+ if (!at.isIdentity()) {
+ saveGraphicsState();
+ concatenateTransformationMatrix(mptToPt(at));
+ }
+
+ currentIPPosition = 0;
+ currentBPPosition = 0;
+ super.renderFlow(flow);
+
+ if (!at.isIdentity()) {
+ restoreGraphicsState();
+ }
+
+ // stacked and relative blocks effect stacking
+ currentIPPosition = saveIP;
+ currentBPPosition = saveBP;
+ }
+
/**
* Concatenates the current transformation matrix with the given one, therefore establishing
* a new coordinate system.
diff --git a/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java b/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java
index a592b4f44..994481d59 100644
--- a/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java
+++ b/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java
@@ -28,13 +28,13 @@ import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
import org.apache.xmlgraphics.java2d.ps.PSGraphics2D;
import org.apache.xmlgraphics.ps.PSGenerator;
-import org.apache.fop.render.Graphics2DAdapter;
+import org.apache.fop.render.AbstractGraphics2DAdapter;
import org.apache.fop.render.RendererContext;
/**
* Graphics2DAdapter implementation for PostScript.
*/
-public class PSGraphics2DAdapter implements Graphics2DAdapter {
+public class PSGraphics2DAdapter extends AbstractGraphics2DAdapter {
private PSGenerator gen;
private boolean clip = true;
diff --git a/src/java/org/apache/fop/render/ps/PSImageUtils.java b/src/java/org/apache/fop/render/ps/PSImageUtils.java
new file mode 100644
index 000000000..27eb736d8
--- /dev/null
+++ b/src/java/org/apache/fop/render/ps/PSImageUtils.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render.ps;
+
+/**
+ * Utility code for rendering images in PostScript.
+ * @deprecated Kept for compatibility with older FOP extensions (like Barcode4J). Use the
+ * super-class instead.
+ */
+public class PSImageUtils extends org.apache.xmlgraphics.ps.PSImageUtils {
+
+}
diff --git a/src/java/org/apache/fop/render/xml/XMLRenderer.java b/src/java/org/apache/fop/render/xml/XMLRenderer.java
index eb3c92e1b..94cd107c7 100644
--- a/src/java/org/apache/fop/render/xml/XMLRenderer.java
+++ b/src/java/org/apache/fop/render/xml/XMLRenderer.java
@@ -754,9 +754,17 @@ public class XMLRenderer extends PrintRenderer {
endElement("flow");
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
+ protected void renderReferenceArea(Block block) {
+ handleBlockTraits(block);
+
+ List children = block.getChildAreas();
+ if (children != null) {
+ renderBlocks(block, children);
+ }
+ }
+
+ /** {@inheritDoc} */
protected void renderBlock(Block block) {
atts.clear();
addAreaAttributes(block);
diff --git a/src/java/org/apache/fop/util/CloseBlockerOutputStream.java b/src/java/org/apache/fop/util/CloseBlockerOutputStream.java
index 7192e76d2..c0db8c8b7 100644
--- a/src/java/org/apache/fop/util/CloseBlockerOutputStream.java
+++ b/src/java/org/apache/fop/util/CloseBlockerOutputStream.java
@@ -19,25 +19,25 @@
package org.apache.fop.util;
-import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;
+import org.apache.commons.io.output.ProxyOutputStream;
+
/**
* This is a decorator to block calls to close() to the underlying stream.
*/
-public class CloseBlockerOutputStream extends FilterOutputStream {
+public class CloseBlockerOutputStream extends ProxyOutputStream {
/**
- * @see java.io.FilterOutputStream#FilterOutputStream(OutputStream)
+ * Main constructor.
+ * @param out the underlying stream
*/
public CloseBlockerOutputStream(OutputStream out) {
super(out);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void close() throws IOException {
try {
flush();
diff --git a/status.xml b/status.xml
index c82fca331..02786adbc 100644
--- a/status.xml
+++ b/status.xml
@@ -144,7 +144,28 @@
in the font's primary encoding.
</action>
</release>
- <release version="0.95beta" date="22 March 2008">
+ <release version="0.95" date="TBD">
+ <action context="Renderers" dev="JM" type="fix">
+ Fixed positioning of absolutely positioned block-containers in multi-column documents.
+ </action>
+ <action context="Renderers" dev="JM" type="fix">
+ Fixed rendering of fixed block-containers in AFP output.
+ </action>
+ <action context="Renderers" dev="JM" type="fix">
+ Fixed regression causing bad positioning of block-containers if used as descendant
+ of a table-cell.
+ </action>
+ <action context="Fonts" dev="JM" type="fix">
+ Fixed text extraction problem with ZapfDingbats and Symbol font in PDF output.
+ </action>
+ <action context="Images" dev="JM" type="fix">
+ Fixed a performance problem concerning image serialization.
+ </action>
+ <action context="Fonts" dev="JM" type="fix">
+ Fixed NullPointerException when loading a TrueType font using XML font metric files.
+ </action>
+ </release>
+ <release version="0.95beta" date="26 March 2008">
<notes>
<section>
<title>Notes</title>
diff --git a/test/java/org/apache/fop/StandardTestSuite.java b/test/java/org/apache/fop/StandardTestSuite.java
index 33e034de0..6399d3b09 100644
--- a/test/java/org/apache/fop/StandardTestSuite.java
+++ b/test/java/org/apache/fop/StandardTestSuite.java
@@ -22,6 +22,7 @@ package org.apache.fop;
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.apache.fop.fonts.TrueTypeAnsiTestCase;
import org.apache.fop.render.pdf.PDFAConformanceTestCase;
import org.apache.fop.render.pdf.PDFCMapTestCase;
import org.apache.fop.render.pdf.PDFEncodingTestCase;
@@ -47,6 +48,7 @@ public class StandardTestSuite {
suite.addTest(new TestSuite(PDFEncodingTestCase.class));
suite.addTest(new TestSuite(PDFCMapTestCase.class));
suite.addTest(new TestSuite(PDFsRGBSettingsTestCase.class));
+ suite.addTest(new TestSuite(TrueTypeAnsiTestCase.class));
suite.addTest(RichTextFormatTestSuite.suite());
//$JUnit-END$
return suite;
diff --git a/test/java/org/apache/fop/fonts/TrueTypeAnsiTestCase.java b/test/java/org/apache/fop/fonts/TrueTypeAnsiTestCase.java
new file mode 100644
index 000000000..dc9890167
--- /dev/null
+++ b/test/java/org/apache/fop/fonts/TrueTypeAnsiTestCase.java
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.fonts;
+
+import java.io.File;
+import java.io.OutputStream;
+import java.io.StringReader;
+import java.net.URL;
+import java.util.List;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.stream.StreamSource;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.io.output.NullOutputStream;
+
+import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.apps.Fop;
+import org.apache.fop.apps.FopFactory;
+import org.apache.fop.fonts.apps.TTFReader;
+import org.apache.fop.render.pdf.PDFRenderer;
+
+/**
+ * Tests XML font metrics file generation and usage for WinAnsi mode.
+ */
+public class TrueTypeAnsiTestCase extends TestCase {
+
+ /**
+ * Tests a TrueType font in WinAnsi mode.
+ * @throws Exception if an error occurs
+ */
+ public void testTrueTypeAnsi() throws Exception {
+ String fontFamily = "Gladiator Bold";
+ File ttfFile = new File("./test/resources/fonts/glb12.ttf");
+ File workDir = new File("./build/test-results");
+ if (!workDir.isDirectory()) {
+ assertTrue(workDir.mkdirs());
+ }
+ File metricsFile = new File(workDir, ttfFile.getName() + ".xml");
+ if (metricsFile.isFile()) {
+ assertTrue(metricsFile.delete());
+ }
+
+ String[] args = new String[] {"-enc", "ansi",
+ ttfFile.getCanonicalPath(), metricsFile.getCanonicalPath()};
+ TTFReader.main(args);
+ assertTrue(metricsFile.isFile());
+
+ FopFactory fopFactory = FopFactory.newInstance();
+ FOUserAgent ua = fopFactory.newFOUserAgent();
+ PDFRenderer renderer = new PDFRenderer();
+ renderer.setUserAgent(ua);
+ List fontList = new java.util.ArrayList();
+ List triplets = new java.util.ArrayList();
+ triplets.add(new FontTriplet(fontFamily, "normal", Font.WEIGHT_NORMAL));
+ EmbedFontInfo font = new EmbedFontInfo(
+ metricsFile.toURI().toASCIIString(),
+ true, triplets,
+ ttfFile.toURI().toASCIIString(), null);
+ fontList.add(font);
+ renderer.addFontList(fontList);
+
+ ua.setRendererOverride(renderer);
+ OutputStream out = new NullOutputStream();
+
+ Fop fop = fopFactory.newFop(null, ua, out);
+
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+ Source src = new StreamSource(new StringReader(
+ "<root font-family='" + fontFamily + "'>Test!</root>"));
+ Result res = new SAXResult(fop.getDefaultHandler());
+ Transformer transformer = tFactory.newTransformer(
+ getSourceForResource(this, "fonttest.xsl"));
+ transformer.transform(src, res);
+ }
+
+ private static Source getSourceForResource(Object reference, String name) {
+ URL url = reference.getClass().getResource(name);
+ if (url == null) {
+ throw new NullPointerException("Resource not found: " + name);
+ }
+ return new StreamSource(url.toExternalForm());
+ }
+
+}
diff --git a/test/java/org/apache/fop/fonts/fonttest.xsl b/test/java/org/apache/fop/fonts/fonttest.xsl
new file mode 100644
index 000000000..26c7d72a5
--- /dev/null
+++ b/test/java/org/apache/fop/fonts/fonttest.xsl
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format">
+
+ <xsl:output method="xml" indent="yes"/>
+
+ <xsl:template match="root">
+ <fo:root>
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="A4" page-height="29.7cm" page-width="21cm"
+ margin="2cm">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="A4">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block font-family="{@font-family}">
+ <xsl:value-of select="."/>
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/test/layoutengine/standard-testcases/block-container_absolute-position_multi-column.xml b/test/layoutengine/standard-testcases/block-container_absolute-position_multi-column.xml
new file mode 100644
index 000000000..e3b6fb4f8
--- /dev/null
+++ b/test/layoutengine/standard-testcases/block-container_absolute-position_multi-column.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks absolutely positioned block-containers in multi-column documents.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="0.1in">
+ <fo:region-body column-count="2" column-gap="0.2in"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal">
+ <fo:flow flow-name="xsl-region-body" text-align="justify">
+ <fo:block background-color="yellow">
+ This should not have any line floating over it! This should not have any
+ line floating over it! This should not have any line floating over it! This
+ should not have any line floating over it!
+ </fo:block>
+ <fo:block span="all" background-color="orange">
+ <fo:block padding-top="0.5em" padding-bottom="0.5em">
+ This should not have any line floating over it! This should not have any
+ line floating over it! This should not have any line floating over
+ it!<fo:block />
+ </fo:block>
+ </fo:block>
+ <fo:block background-color="yellow">
+ This should not have any line floating over it! This should not have any
+ line floating over it! This should not have any line floating over it! This
+ should not have any line floating over it!
+ </fo:block>
+ <fo:block-container absolute-position="absolute"
+ left="2.5in - 0.1in - 0.025in" top="auto" width="0.05in" height="100%" background-color="red">
+ <fo:block/>
+ </fo:block-container>
+ <fo:block-container absolute-position="absolute" left="2.5in - 0.1in" top="auto"
+ reference-orientation="90">
+ <fo:block width="100%" line-height="1pt" background-color="black"
+ height="1pt">&#xA0;</fo:block>
+ </fo:block-container>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <!--
+ This test is only visually interesting! Visually check that the block container begins
+ directly under the spanned block!
+ -->
+ <eval expected="1" xpath="count(//pageViewport)"/>
+ </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/table-cell_bc-child.xml b/test/layoutengine/standard-testcases/table-cell_bc-child.xml
new file mode 100644
index 000000000..eb199c73b
--- /dev/null
+++ b/test/layoutengine/standard-testcases/table-cell_bc-child.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase visual="only">
+ <info>
+ <p>
+ This test checks the rendering of block viewports in reference areas generated
+ by table-cells. This does not test the layout engine, only the renderer.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="20pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:table table-layout="fixed" width="4in" background-color="lightgray"
+ space-before="2in" space-before.conditionality="retain">
+ <fo:table-column column-width="100%"/>
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell background-color="rgb(230, 230, 255)">
+ <fo:block-container absolute-position="absolute" width="100%" height="2em">
+ <fo:block color="red">No red text should be visible!</fo:block>
+ </fo:block-container>
+ <fo:block color="green">No red text should be visible!</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell padding="10pt" background-color="rgb(230, 255, 230)">
+ <fo:block-container absolute-position="absolute" width="100%" height="2em" top="10pt">
+ <fo:block color="red">No red text should be visible!</fo:block>
+ </fo:block-container>
+ <fo:block color="green">No red text should be visible!</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <!-- Dummy test. This test is only useful with BatchDiffer. -->
+ <eval expected="1" xpath="count(//pageViewport)"/>
+ </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/table_border-collapse_collapse_spans_3.xml b/test/layoutengine/standard-testcases/table_border-collapse_collapse_spans_3.xml
new file mode 100644
index 000000000..8d4f42c16
--- /dev/null
+++ b/test/layoutengine/standard-testcases/table_border-collapse_collapse_spans_3.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks tables with collapsing-border model and complex spanning cells.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="4in" margin="0.5in">
+ <fo:region-body margin="0pt"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:table table-layout="fixed" width="100%">
+ <fo:table-column number-columns-repeated="2" column-width="proportional-column-width(1)"/>
+ <fo:table-header border-bottom="1pt solid black">
+ <fo:table-cell>
+ <fo:block>Header 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell>
+ <fo:block>Header 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-header>
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell number-columns-spanned="2">
+ <fo:block>Cell 1.1</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell>
+ <fo:block>Cell 2.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell>
+ <fo:block>Cell 2.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+
+ <checks>
+ <eval expected="" xpath="//flow/block[1]/block[1]/@border-before"/>
+ <eval expected="(solid,#000000,1000,collapse-inner)" xpath="//flow/block[1]/block[1]/@border-after"/>
+ <eval expected="" xpath="//flow/block[1]/block[2]/@border-before"/>
+ <eval expected="(solid,#000000,1000,collapse-inner)" xpath="//flow/block[1]/block[2]/@border-after"/>
+ <eval expected="(solid,#000000,1000,collapse-inner)" xpath="//flow/block[1]/block[3]/@border-before"/>
+ <eval expected="" xpath="//flow/block[1]/block[3]/@border-after"/>
+ <eval expected="(solid,#000000,1000,collapse-inner)" xpath="//flow/block[1]/block[4]/@border-before"/>
+ <eval expected="" xpath="//flow/block[1]/block[4]/@border-after"/>
+ <eval expected="" xpath="//flow/block[1]/block[6]/@border-before"/>
+ <eval expected="" xpath="//flow/block[1]/block[6]/@border-after"/>
+ <eval expected="" xpath="//flow/block[1]/block[7]/@border-before"/>
+ <eval expected="" xpath="//flow/block[1]/block[7]/@border-after"/>
+ </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/table_bug44621.xml b/test/layoutengine/standard-testcases/table_bug44621.xml
index b4b9edbd0..ae04d1903 100644
--- a/test/layoutengine/standard-testcases/table_bug44621.xml
+++ b/test/layoutengine/standard-testcases/table_bug44621.xml
@@ -66,12 +66,32 @@
</fo:table-row>
</fo:table-body>
</fo:table>
+
+ <fo:block space-before="20pt" space-after="10pt">The after border of cell 1, in the normal
+ case, is thicker than in the trailing case.</fo:block>
+ <fo:table width="100%" table-layout="fixed"
+ font-size="8pt" line-height="10pt">
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Cell 1</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell border="2pt solid black">
+ <fo:block>Cell 2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+
</fo:flow>
</fo:page-sequence>
</fo:root>
</fo>
<checks>
+ <!-- table 1 -->
<eval expected="39000" xpath="//pageViewport//flow/block[2]/@bpd"/>
<eval expected="39000" xpath="//pageViewport//flow/block[2]/@bpda"/>
<!-- cell 1.1 -->
@@ -93,12 +113,27 @@
<eval expected="10000" xpath="//pageViewport//flow/block[2]/block[6]/@bpd"/>
<eval expected="18000" xpath="//pageViewport//flow/block[2]/block[6]/@bpda"/>
+ <!-- table 2 -->
+ <eval expected="23500" xpath="//pageViewport//flow/block[4]/@bpd"/>
+ <eval expected="23500" xpath="//pageViewport//flow/block[4]/@bpda"/>
+ <!-- cell 1 -->
+ <eval expected="10000" xpath="//pageViewport//flow/block[4]/block[1]/@bpd"/>
+ <eval expected="13000" xpath="//pageViewport//flow/block[4]/block[1]/@bpda"/>
+ <!-- cell 2 -->
+ <eval expected="10000" xpath="//pageViewport//flow/block[4]/block[2]/@bpd"/>
+ <eval expected="14000" xpath="//pageViewport//flow/block[4]/block[2]/@bpda"/>
+
<element-list category="breaker">
<skip>4</skip>
<box w="12000"/>
- <penalty w="14000" p="0"/><!-- should be 15000 -->
+ <penalty w="15000" p="0"/>
<box w="13000"/>
<box w="14000"/>
+ <skip>6</skip>
+ <box w="11000"/>
+ <penalty w="0" p="0"/>
+ <glue w="500"/>
+ <box w="12000"/>
<skip>3</skip>
</element-list>
</checks>