https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ................ r665691 | jeremias | 2008-06-09 15:01:53 +0100 (Mon, 09 Jun 2008) | 82 lines Merged revisions 636407-637074,637076-637118,637120-637790,637792-637856,637858-637992,637994-638047,638049-638307,638309-638315,638318-664698 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95 ........ r638937 | jeremias | 2008-03-19 18:08:57 +0100 (Mi, 19 Mrz 2008) | 1 line A nit. ........ r640889 | vhennebert | 2008-03-25 17:43:55 +0100 (Di, 25 Mrz 2008) | 2 lines Set the final release date and added a news item about the 0.95beta release (the change was made before updating the website) ........ r642906 | jeremias | 2008-03-31 09:12:40 +0200 (Mo, 31 Mrz 2008) | 3 lines Added version number to xml-apis-ext (as suggested by Karel Vervaeke). Moved xml-apis to same version as xml-apis-ext. Added missing licensing info about xml-apis-ext. ........ r647403 | jeremias | 2008-04-12 11:02:01 +0200 (Sa, 12 Apr 2008) | 1 line Fixed NullPointerException when loading a TrueType font using XML font metric files. ........ r647537 | jeremias | 2008-04-13 09:36:00 +0200 (So, 13 Apr 2008) | 1 line Performance improvement when encoding images: Fixed an important hotspot by extending CloseBlocker from ProxyOutputStream instead of FilterOutputStream as the latter routes all write(byte[]) calls through write(int). ........ r648984 | jeremias | 2008-04-17 09:00:22 +0200 (Do, 17 Apr 2008) | 1 line HeadURL was missing in the properties. ........ r649006 | jeremias | 2008-04-17 10:42:52 +0200 (Do, 17 Apr 2008) | 1 line Fixed text extraction problem with ZapfDingbats and Symbol font in PDF output. These fonts are symbolic and must not use an Encoding value in PDF. Applies to the built-in base 14 variant and to the case where these fonts are explicitely embedded. ........ r649014 | jeremias | 2008-04-17 11:10:15 +0200 (Do, 17 Apr 2008) | 1 line Added missing change information. ........ r650550 | vhennebert | 2008-04-22 17:22:31 +0200 (Di, 22 Apr 2008) | 4 lines Bugzilla 41621: - length of the penalty now correctly computed; - AssertionError fixed. ........ r651302 | jeremias | 2008-04-24 18:08:53 +0200 (Do, 24 Apr 2008) | 3 lines Fixed regression causing bad positioning of block-containers if used as descendant of a table-cell. This was not caught because of the lack of a test case that would have shown the problem in visual testing with BatchDiffer. See also: http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-users/200804.mbox/%3c20080424164128.973A.DEV@jeremias-maerki.ch%3e ........ r653537 | vhennebert | 2008-05-05 19:47:28 +0200 (Mo, 05 Mai 2008) | 2 lines Bugfix: the before border of cells below a column-spanning cell had their value taken from the leading case, instead of the normal one. ........ r654453 | jeremias | 2008-05-08 11:14:04 +0200 (Do, 08 Mai 2008) | 2 lines Added /usr/local/share/fonts as additional possible location for fonts on Unixes. ........ r656286 | jeremias | 2008-05-14 16:16:49 +0200 (Mi, 14 Mai 2008) | 1 line Restored plug-in API compatibility with FOP 0.94. Fixes a NoSuchMethodError when Barcode4J is run. ........ r656524 | jeremias | 2008-05-15 09:07:18 +0200 (Do, 15 Mai 2008) | 1 line Fixed rendering of fixed block-containers in AFP output. The break-out was actually never implemented which is necessary for supporting fixed positioned viewports. ........ r657520 | maxberger | 2008-05-18 11:38:45 +0200 (So, 18 Mai 2008) | 1 line Updated as per suggestions in bug 45019 ........ r661580 | maxberger | 2008-05-30 08:42:17 +0200 (Fr, 30 Mai 2008) | 1 line added my key to KEYS, it is used for signing mvn artifacts ........ r663482 | jeremias | 2008-06-05 09:06:37 +0200 (Do, 05 Jun 2008) | 1 line Fixed positioning of absolutely positioned block-containers in multi-column documents. ........ r664692 | jeremias | 2008-06-09 14:49:45 +0200 (Mo, 09 Jun 2008) | 1 line Restored PSImageUtils. I had deleted it prematurely. Extensions like Barcode4J rely on this class. ........ ................ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@665697 13f79535-47bb-0310-9956-ffa450edef68tags/fop-1_0
Apache FOP | Apache FOP | ||||
Copyright 1999-2006 The Apache Software Foundation | |||||
Copyright 1999-2008 The Apache Software Foundation | |||||
This product includes software developed at | This product includes software developed at | ||||
The Apache Software Foundation (http://www.apache.org/). | The Apache Software Foundation (http://www.apache.org/). |
</fileset> | </fileset> | ||||
</classpath> | </classpath> | ||||
</javac> | </javac> | ||||
<copy todir="${build.dir}/test-classes"> | |||||
<fileset dir="${basedir}/test/java"> | |||||
<include name="**/*.xsl"/> | |||||
</fileset> | |||||
</copy> | |||||
</target> | </target> | ||||
<target name="junit-compile-copy-resources" if="junit.present"> | <target name="junit-compile-copy-resources" if="junit.present"> |
set LOCALCLASSPATH=%LOCAL_FOP_HOME%build\fop.jar | 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-sandbox.jar | ||||
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LOCAL_FOP_HOME%build\fop-hyph.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%\xercesImpl-2.7.1.jar | ||||
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.7.0.jar | set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.7.0.jar | ||||
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\serializer-2.7.0.jar | set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\serializer-2.7.0.jar |
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) $ |
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) $ |
<?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> |
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. |
========================================================================= | |||||
== 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 |
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 |
<version>$Revision$</version> | <version>$Revision$</version> | ||||
</header> | </header> | ||||
<body> | <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> | <section> | ||||
<title>30 October 2007 - New Committer</title> | <title>30 October 2007 - New Committer</title> | ||||
<p>Welcome Max Berger!</p> | <p>Welcome Max Berger!</p> |
return fontBBox; | return fontBBox; | ||||
} | } | ||||
/** | |||||
* {@inheritDoc} | |||||
*/ | |||||
/** {@inheritDoc} */ | |||||
public int getFlags() { | public int getFlags() { | ||||
return flags; | 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 | * Returns the font weight (100, 200...800, 900). This value may be different from the |
*/ | */ | ||||
int getFlags(); | 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. | * Returns the font's bounding box. | ||||
* @return the bounding box | * @return the bounding box |
import javax.xml.parsers.SAXParserFactory; | 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.Attributes; | ||||
import org.xml.sax.InputSource; | import org.xml.sax.InputSource; | ||||
import org.xml.sax.Locator; | import org.xml.sax.Locator; | ||||
import org.xml.sax.XMLReader; | import org.xml.sax.XMLReader; | ||||
import org.xml.sax.helpers.DefaultHandler; | 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. | * Class for reading a metric.xml file and creating a font object. | ||||
* Typical usage: | * Typical usage: | ||||
if ("font-name".equals(localName)) { | if ("font-name".equals(localName)) { | ||||
returnFont.setFontName(content); | returnFont.setFontName(content); | ||||
} else if ("full-name".equals(localName)) { | } else if ("full-name".equals(localName)) { | ||||
multiFont.setFullName(content); | |||||
returnFont.setFullName(content); | |||||
} else if ("family-name".equals(localName)) { | } else if ("family-name".equals(localName)) { | ||||
Set s = new java.util.HashSet(); | Set s = new java.util.HashSet(); | ||||
s.add(content); | s.add(content); | ||||
multiFont.setFamilyNames(s); | |||||
returnFont.setFamilyNames(s); | |||||
} else if ("ttc-name".equals(localName) && isCID) { | } else if ("ttc-name".equals(localName) && isCID) { | ||||
multiFont.setTTCName(content); | multiFont.setTTCName(content); | ||||
} else if ("encoding".equals(localName)) { | } else if ("encoding".equals(localName)) { |
return realFontDescriptor.getAscender(); | return realFontDescriptor.getAscender(); | ||||
} | } | ||||
/** | |||||
* {@inheritDoc} | |||||
*/ | |||||
/** {@inheritDoc} */ | |||||
public int getFlags() { | public int getFlags() { | ||||
load(true); | load(true); | ||||
return realFontDescriptor.getFlags(); | return realFontDescriptor.getFlags(); | ||||
} | } | ||||
/** {@inheritDoc} */ | |||||
public boolean isSymbolicFont() { | |||||
load(true); | |||||
return realFontDescriptor.isSymbolicFont(); | |||||
} | |||||
/** | /** | ||||
* {@inheritDoc} | * {@inheritDoc} | ||||
*/ | */ |
return new String[] { | return new String[] { | ||||
System.getProperty("user.home") + "/.fonts", // user | System.getProperty("user.home") + "/.fonts", // user | ||||
"/usr/local/fonts", // local | "/usr/local/fonts", // local | ||||
"/usr/local/share/fonts", // local shared | |||||
"/usr/share/fonts", // system | "/usr/share/fonts", // system | ||||
"/usr/X11R6/lib/X11/fonts" // X | "/usr/X11R6/lib/X11/fonts" // X | ||||
}; | }; |
// Then add areas for cells finishing on the current row | // Then add areas for cells finishing on the current row | ||||
for (int i = 0; i < colCount; i++) { | 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()) | && (lastInPart || currentGU.isLastGridUnitRowSpan()) | ||||
&& firstCellParts[i] != null) { | && firstCellParts[i] != null) { | ||||
assert firstCellParts[i].pgu == currentGU.getPrimary(); | assert firstCellParts[i].pgu == currentGU.getPrimary(); | ||||
actualRowHeight, borderBeforeWhich, borderAfterWhich, | actualRowHeight, borderBeforeWhich, borderAfterWhich, | ||||
lastOnPage); | lastOnPage); | ||||
firstCellParts[i] = null; | firstCellParts[i] = null; | ||||
firstCellOnPage[i] = false; | |||||
Arrays.fill(firstCellOnPage, i, i + currentGU.getCell().getNumberColumnsSpanned(), | |||||
false); | |||||
} | } | ||||
} | } | ||||
currentRowOffset += actualRowHeight; | currentRowOffset += actualRowHeight; |
import java.util.Iterator; | import java.util.Iterator; | ||||
import java.util.LinkedList; | import java.util.LinkedList; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.ListIterator; | |||||
import java.util.Map; | import java.util.Map; | ||||
import org.apache.commons.logging.Log; | import org.apache.commons.logging.Log; | ||||
import org.apache.fop.layoutmgr.KeepUtil; | import org.apache.fop.layoutmgr.KeepUtil; | ||||
import org.apache.fop.layoutmgr.KnuthBox; | import org.apache.fop.layoutmgr.KnuthBox; | ||||
import org.apache.fop.layoutmgr.KnuthElement; | import org.apache.fop.layoutmgr.KnuthElement; | ||||
import org.apache.fop.layoutmgr.KnuthGlue; | |||||
import org.apache.fop.layoutmgr.KnuthPossPosIter; | import org.apache.fop.layoutmgr.KnuthPossPosIter; | ||||
import org.apache.fop.layoutmgr.LayoutContext; | import org.apache.fop.layoutmgr.LayoutContext; | ||||
import org.apache.fop.layoutmgr.ListElement; | import org.apache.fop.layoutmgr.ListElement; | ||||
//Get elements for next row group | //Get elements for next row group | ||||
nextRowGroupElems = rowGroupLM.getNextKnuthElements(context, alignment, bodyType); | 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 | //Determine keep constraints | ||||
int penaltyStrength = BlockLevelLayoutManager.KEEP_AUTO; | int penaltyStrength = BlockLevelLayoutManager.KEEP_AUTO; | ||||
if (breakBetween != Constants.EN_AUTO) { | if (breakBetween != Constants.EN_AUTO) { | ||||
penaltyValue = -KnuthElement.INFINITE; | 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); | returnList.addAll(nextRowGroupElems); | ||||
breakBetween = context.getBreakAfter(); | 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.updateKeepWithPreviousPending(keepWithPrevious); | ||||
context.setBreakBefore(breakBefore); | context.setBreakBefore(breakBefore); | ||||
laststep = step; | laststep = step; | ||||
step = getNextStep(); | step = getNextStep(); | ||||
} while (step >= 0); | } 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; | return returnList; | ||||
} | } | ||||
PDFFontDescriptor pdfdesc = makeFontDescriptor(descriptor); | PDFFontDescriptor pdfdesc = makeFontDescriptor(descriptor); | ||||
PDFFont font = null; | PDFFont font = null; | ||||
font = PDFFont.createFont(fontname, fonttype, basefont, encoding); | |||||
font = PDFFont.createFont(fontname, fonttype, basefont, null); | |||||
getDocument().registerObject(font); | getDocument().registerObject(font); | ||||
if (fonttype == FontType.TYPE0) { | if (fonttype == FontType.TYPE0) { | ||||
font.setEncoding(encoding); | |||||
CIDFont cidMetrics; | CIDFont cidMetrics; | ||||
if (metrics instanceof LazyFont) { | if (metrics instanceof LazyFont) { | ||||
cidMetrics = (CIDFont)((LazyFont) metrics).getRealFont(); | cidMetrics = (CIDFont)((LazyFont) metrics).getRealFont(); | ||||
//Handle encoding | //Handle encoding | ||||
SingleByteEncoding mapping = singleByteFont.getEncoding(); | 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()); | font.setEncoding(mapping.getName()); | ||||
} else { | } else { | ||||
Object pdfEncoding = createPDFEncoding(mapping, | Object pdfEncoding = createPDFEncoding(mapping, |
setEncoding((PDFEncoding)encoding); | setEncoding((PDFEncoding)encoding); | ||||
} else if (encoding instanceof String) { | } else if (encoding instanceof String) { | ||||
setEncoding((String)encoding); | setEncoding((String)encoding); | ||||
} else { | |||||
throw new IllegalArgumentException("Illegal value for encoding"); | |||||
} | } | ||||
} | } | ||||
import org.apache.fop.fonts.FontDescriptor; | import org.apache.fop.fonts.FontDescriptor; | ||||
import org.apache.fop.fonts.FontInfo; | import org.apache.fop.fonts.FontInfo; | ||||
import org.apache.fop.fonts.Typeface; | 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; | import org.apache.fop.util.ColorProfileUtil; | ||||
/** | /** | ||||
if (font instanceof FontDescriptor) { | if (font instanceof FontDescriptor) { | ||||
desc = (FontDescriptor)font; | 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( | addFont(doc.getFactory().makeFont( | ||||
f, font.getEmbedFontName(), font.getEncodingName(), font, desc)); | |||||
f, font.getEmbedFontName(), encoding, font, desc)); | |||||
} | } | ||||
} | } | ||||
} | } |
import java.awt.image.DataBuffer; | import java.awt.image.DataBuffer; | ||||
import java.awt.image.Raster; | import java.awt.image.Raster; | ||||
import java.awt.image.WritableRaster; | import java.awt.image.WritableRaster; | ||||
import java.io.IOException; | |||||
import org.apache.fop.render.RendererContext.RendererContextWrapper; | import org.apache.fop.render.RendererContext.RendererContextWrapper; | ||||
import org.apache.fop.util.UnitConv; | 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 { | public abstract class AbstractGraphics2DAdapter implements Graphics2DAdapter { | ||||
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, | g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, | ||||
RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); | 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); | |||||
} | |||||
} | } |
import org.apache.fop.area.Block; | import org.apache.fop.area.Block; | ||||
import org.apache.fop.area.BlockViewport; | import org.apache.fop.area.BlockViewport; | ||||
import org.apache.fop.area.CTM; | import org.apache.fop.area.CTM; | ||||
import org.apache.fop.area.NormalFlow; | |||||
import org.apache.fop.area.RegionViewport; | import org.apache.fop.area.RegionViewport; | ||||
import org.apache.fop.area.Trait; | import org.apache.fop.area.Trait; | ||||
import org.apache.fop.area.inline.ForeignObject; | import org.apache.fop.area.inline.ForeignObject; | ||||
} | } | ||||
} | } | ||||
/** {@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 | * Concatenates the current transformation matrix with the given one, therefore establishing | ||||
* a new coordinate system. | * a new coordinate system. |
} | } | ||||
} | } | ||||
/** | |||||
* 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. | * Renders a list of block areas. | ||||
* | * | ||||
// simply move position | // simply move position | ||||
currentBPPosition += block.getAllocBPD(); | currentBPPosition += block.getAllocBPD(); | ||||
} | } | ||||
} else if (Boolean.TRUE.equals(block.getTrait(Trait.IS_REFERENCE_AREA))) { | |||||
renderReferenceArea(block); | |||||
} else { | } else { | ||||
// save position and offset | // save position and offset | ||||
int saveIP = currentIPPosition; | int saveIP = currentIPPosition; |
RendererContext context, | RendererContext context, | ||||
int x, int y, int width, int height) throws IOException; | 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; | |||||
} | } |
import org.apache.fop.area.BodyRegion; | import org.apache.fop.area.BodyRegion; | ||||
import org.apache.fop.area.CTM; | import org.apache.fop.area.CTM; | ||||
import org.apache.fop.area.LineArea; | import org.apache.fop.area.LineArea; | ||||
import org.apache.fop.area.NormalFlow; | |||||
import org.apache.fop.area.OffDocumentItem; | import org.apache.fop.area.OffDocumentItem; | ||||
import org.apache.fop.area.PageViewport; | import org.apache.fop.area.PageViewport; | ||||
import org.apache.fop.area.RegionReference; | import org.apache.fop.area.RegionReference; | ||||
} | } | ||||
} | } | ||||
// /** | |||||
// * {@inheritDoc} | |||||
// */ | |||||
// protected void drawBackAndBorders(Area area, float startx, float starty, | |||||
// float width, float height) { | |||||
// super.drawBackAndBorders(area, startx, starty, width, height); | |||||
// Trait.Background back = (Trait.Background) area | |||||
// .getTrait(Trait.BACKGROUND); | |||||
// | |||||
// // the current block has a background so its contents are placed inside | |||||
// // an overlay | |||||
// // after drawing the background and borders | |||||
// if (back != null) { | |||||
// int x = pts2units(startx); | |||||
// int y = pts2units(starty); | |||||
// int w = mpts2units(width); | |||||
// int h = mpts2units(height); | |||||
// int res = getResolution(); | |||||
// final int rotation = 0; | |||||
// getAFPDataStream().startOverlay(x, y, w, h, res, res, rotation); | |||||
//// Color col = back.getColor(); | |||||
//// getAFPDataStream().createShading(x, y, w, h, col); | |||||
// } | |||||
// } | |||||
// | |||||
//// /** | |||||
//// * {@inheritDoc} | |||||
//// */ | |||||
// protected void renderBlock(Block block) { | |||||
//// // new block so start page segment | |||||
////// getAFPDataStream().startPageSegment(); | |||||
// super.renderBlock(block); | |||||
// getAFPDataStream().endOverlay(); | |||||
////// getAFPDataStream().endPageSegment(); | |||||
// } | |||||
/** | |||||
* {@inheritDoc} | |||||
*/ | |||||
/** {@inheritDoc} */ | |||||
protected void renderBlockViewport(BlockViewport bv, List children) { | protected void renderBlockViewport(BlockViewport bv, List children) { | ||||
// clip and position viewport if necessary | // clip and position viewport if necessary | ||||
} | } | ||||
} | } | ||||
/** {@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} */ | /** {@inheritDoc} */ | ||||
protected void concatenateTransformationMatrix(AffineTransform at) { | protected void concatenateTransformationMatrix(AffineTransform at) { | ||||
// Not used here since AFPRenderer defines its own renderBlockViewport() | // Not used here since AFPRenderer defines its own renderBlockViewport() | ||||
} | } | ||||
} | } | ||||
/** | |||||
* 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. */ | /** Saves the graphics state of the rendering engine. */ | ||||
getAFPDataStream().setOffsets(vpp.x, vpp.y, vpp.rot); | getAFPDataStream().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) { | if (viewPortPositions.size() > 0) { | ||||
ViewPortPos vpp = (ViewPortPos) viewPortPositions | ViewPortPos vpp = (ViewPortPos) viewPortPositions | ||||
.get(viewPortPositions.size() - 1); | .get(viewPortPositions.size() - 1); | ||||
getAFPDataStream().setOffsets(vpp.x, vpp.y, vpp.rot); | getAFPDataStream().setOffsets(vpp.x, vpp.y, vpp.rot); | ||||
} | } | ||||
return current; | |||||
} | } | ||||
/** | /** |
import org.apache.fop.area.Block; | import org.apache.fop.area.Block; | ||||
import org.apache.fop.area.BlockViewport; | import org.apache.fop.area.BlockViewport; | ||||
import org.apache.fop.area.CTM; | import org.apache.fop.area.CTM; | ||||
import org.apache.fop.area.NormalFlow; | |||||
import org.apache.fop.area.PageViewport; | import org.apache.fop.area.PageViewport; | ||||
import org.apache.fop.area.RegionViewport; | import org.apache.fop.area.RegionViewport; | ||||
import org.apache.fop.area.Trait; | import org.apache.fop.area.Trait; | ||||
//currentFontName = saveFontName; | //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 | * Concatenates the current transformation matrix with the given one, therefore establishing | ||||
* a new coordinate system. | * a new coordinate system. |
/* | |||||
* 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 { | |||||
} |
endElement("flow"); | 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) { | protected void renderBlock(Block block) { | ||||
atts.clear(); | atts.clear(); | ||||
addAreaAttributes(block); | addAreaAttributes(block); |
package org.apache.fop.util; | package org.apache.fop.util; | ||||
import java.io.FilterOutputStream; | |||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.io.OutputStream; | import java.io.OutputStream; | ||||
import org.apache.commons.io.output.ProxyOutputStream; | |||||
/** | /** | ||||
* This is a decorator to block calls to close() to the underlying stream. | * 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) { | public CloseBlockerOutputStream(OutputStream out) { | ||||
super(out); | super(out); | ||||
} | } | ||||
/** | |||||
* {@inheritDoc} | |||||
*/ | |||||
/** {@inheritDoc} */ | |||||
public void close() throws IOException { | public void close() throws IOException { | ||||
try { | try { | ||||
flush(); | flush(); |
in the font's primary encoding. | in the font's primary encoding. | ||||
</action> | </action> | ||||
</release> | </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> | <notes> | ||||
<section> | <section> | ||||
<title>Notes</title> | <title>Notes</title> |
import junit.framework.Test; | import junit.framework.Test; | ||||
import junit.framework.TestSuite; | import junit.framework.TestSuite; | ||||
import org.apache.fop.fonts.TrueTypeAnsiTestCase; | |||||
import org.apache.fop.render.pdf.PDFAConformanceTestCase; | import org.apache.fop.render.pdf.PDFAConformanceTestCase; | ||||
import org.apache.fop.render.pdf.PDFCMapTestCase; | import org.apache.fop.render.pdf.PDFCMapTestCase; | ||||
import org.apache.fop.render.pdf.PDFEncodingTestCase; | import org.apache.fop.render.pdf.PDFEncodingTestCase; | ||||
suite.addTest(new TestSuite(PDFEncodingTestCase.class)); | suite.addTest(new TestSuite(PDFEncodingTestCase.class)); | ||||
suite.addTest(new TestSuite(PDFCMapTestCase.class)); | suite.addTest(new TestSuite(PDFCMapTestCase.class)); | ||||
suite.addTest(new TestSuite(PDFsRGBSettingsTestCase.class)); | suite.addTest(new TestSuite(PDFsRGBSettingsTestCase.class)); | ||||
suite.addTest(new TestSuite(TrueTypeAnsiTestCase.class)); | |||||
suite.addTest(RichTextFormatTestSuite.suite()); | suite.addTest(RichTextFormatTestSuite.suite()); | ||||
//$JUnit-END$ | //$JUnit-END$ | ||||
return suite; | return suite; |
/* | |||||
* 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()); | |||||
} | |||||
} |
<?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> |
<?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"> </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> |
<?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> |
<?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> |
</fo:table-row> | </fo:table-row> | ||||
</fo:table-body> | </fo:table-body> | ||||
</fo:table> | </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:flow> | ||||
</fo:page-sequence> | </fo:page-sequence> | ||||
</fo:root> | </fo:root> | ||||
</fo> | </fo> | ||||
<checks> | <checks> | ||||
<!-- table 1 --> | |||||
<eval expected="39000" xpath="//pageViewport//flow/block[2]/@bpd"/> | <eval expected="39000" xpath="//pageViewport//flow/block[2]/@bpd"/> | ||||
<eval expected="39000" xpath="//pageViewport//flow/block[2]/@bpda"/> | <eval expected="39000" xpath="//pageViewport//flow/block[2]/@bpda"/> | ||||
<!-- cell 1.1 --> | <!-- cell 1.1 --> | ||||
<eval expected="10000" xpath="//pageViewport//flow/block[2]/block[6]/@bpd"/> | <eval expected="10000" xpath="//pageViewport//flow/block[2]/block[6]/@bpd"/> | ||||
<eval expected="18000" xpath="//pageViewport//flow/block[2]/block[6]/@bpda"/> | <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"> | <element-list category="breaker"> | ||||
<skip>4</skip> | <skip>4</skip> | ||||
<box w="12000"/> | <box w="12000"/> | ||||
<penalty w="14000" p="0"/><!-- should be 15000 --> | |||||
<penalty w="15000" p="0"/> | |||||
<box w="13000"/> | <box w="13000"/> | ||||
<box w="14000"/> | <box w="14000"/> | ||||
<skip>6</skip> | |||||
<box w="11000"/> | |||||
<penalty w="0" p="0"/> | |||||
<glue w="500"/> | |||||
<box w="12000"/> | |||||
<skip>3</skip> | <skip>3</skip> | ||||
</element-list> | </element-list> | ||||
</checks> | </checks> |