summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Adams <gadams@apache.org>2012-07-05 17:49:46 +0000
committerGlenn Adams <gadams@apache.org>2012-07-05 17:49:46 +0000
commit4b554ca6cc76359363ec4d1b11778cb380921f5a (patch)
tree71b8cec5543d08620b0bfd5ec0b768f596dc85f8
parent2cb88e8a33dc037cc41f0a2be9b9ce2bdf968e4e (diff)
parent47789800746b09c46b7369d9d8122b40531494e0 (diff)
downloadxmlgraphics-fop-4b554ca6cc76359363ec4d1b11778cb380921f5a.tar.gz
xmlgraphics-fop-4b554ca6cc76359363ec4d1b11778cb380921f5a.zip
Reconstructed FOP 1.1 branch.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-1_1@1357766 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--NOTICE2
-rw-r--r--README39
-rw-r--r--build.xml32
-rw-r--r--checkstyle-5.1.xml204
-rw-r--r--examples/fo/advanced/cid-fonts.fo2
-rw-r--r--examples/fo/advanced/giro.fo14
-rw-r--r--examples/fo/basic/images.fo2
-rw-r--r--examples/fo/basic/tableunits.fo40
-rw-r--r--examples/fo/build.xml5
-rw-r--r--examples/fo/svg/embedding.fo4
-rw-r--r--examples/fo/tables/background.fo22
-rw-r--r--examples/fo/tables/borders.fo39
-rw-r--r--examples/fo/tables/break.fo10
-rw-r--r--examples/fo/tables/headfoot.fo14
-rw-r--r--examples/fo/tables/keep.fo12
-rw-r--r--examples/fo/tables/omit.fo10
-rw-r--r--examples/fo/tables/space.fo18
-rw-r--r--findbugs-exclude.xml51
-rw-r--r--known-issues.xml136
-rw-r--r--lib/xmlgraphics-commons-1.5rc1.jarbin600645 -> 0 bytes
-rw-r--r--lib/xmlgraphics-commons-1.5svn.jarbin0 -> 585921 bytes
-rw-r--r--src/documentation/content/.htaccess34
-rw-r--r--src/documentation/content/doap.rdf16
-rw-r--r--src/documentation/content/xdocs/1.1rc1/accessibility.xml167
-rw-r--r--src/documentation/content/xdocs/1.1rc1/anttask.xml236
-rw-r--r--src/documentation/content/xdocs/1.1rc1/compiling.xml147
-rw-r--r--src/documentation/content/xdocs/1.1rc1/complexscripts.xml694
-rw-r--r--src/documentation/content/xdocs/1.1rc1/configuration.xml541
-rw-r--r--src/documentation/content/xdocs/1.1rc1/embedding.xml752
-rw-r--r--src/documentation/content/xdocs/1.1rc1/events.xml449
-rw-r--r--src/documentation/content/xdocs/1.1rc1/extensions.xml339
-rw-r--r--src/documentation/content/xdocs/1.1rc1/fonts.xml579
-rw-r--r--src/documentation/content/xdocs/1.1rc1/fotree/disabled-testcases.xml31
-rw-r--r--src/documentation/content/xdocs/1.1rc1/graphics.xml590
-rw-r--r--src/documentation/content/xdocs/1.1rc1/hyphenation.xml237
-rw-r--r--src/documentation/content/xdocs/1.1rc1/index.xml55
-rw-r--r--src/documentation/content/xdocs/1.1rc1/intermediate.xml331
-rw-r--r--src/documentation/content/xdocs/1.1rc1/known-issues.xml54
-rw-r--r--src/documentation/content/xdocs/1.1rc1/knownissues_overview.xml74
-rw-r--r--src/documentation/content/xdocs/1.1rc1/layoutengine/disabled-testcases.xml223
-rw-r--r--src/documentation/content/xdocs/1.1rc1/metadata.xml243
-rw-r--r--src/documentation/content/xdocs/1.1rc1/output.xml1401
-rw-r--r--src/documentation/content/xdocs/1.1rc1/pdfa.xml168
-rw-r--r--src/documentation/content/xdocs/1.1rc1/pdfencryption.xml301
-rw-r--r--src/documentation/content/xdocs/1.1rc1/pdfx.xml136
-rw-r--r--src/documentation/content/xdocs/1.1rc1/running.xml370
-rw-r--r--src/documentation/content/xdocs/1.1rc1/servlets.xml325
-rw-r--r--src/documentation/content/xdocs/1.1rc1/upgrading.xml181
-rw-r--r--src/documentation/content/xdocs/bugs.xml1
-rw-r--r--src/documentation/content/xdocs/compliance.ihtml86
-rw-r--r--src/documentation/content/xdocs/download.xml29
-rw-r--r--src/documentation/content/xdocs/examples.xml10
-rw-r--r--src/documentation/content/xdocs/faq.xml17
-rw-r--r--src/documentation/content/xdocs/fo.xml7
-rw-r--r--src/documentation/content/xdocs/fo/align.fo25
-rw-r--r--src/documentation/content/xdocs/fo/align.fo.pdfbin0 -> 4689 bytes
-rw-r--r--src/documentation/content/xdocs/fo/align.pdfbin9284 -> 0 bytes
-rw-r--r--src/documentation/content/xdocs/fo/align2.fo27
-rw-r--r--src/documentation/content/xdocs/fo/align2.fo.pdfbin0 -> 4299 bytes
-rw-r--r--src/documentation/content/xdocs/fo/align2.pdfbin8797 -> 0 bytes
-rw-r--r--src/documentation/content/xdocs/fo/build.xml70
-rw-r--r--src/documentation/content/xdocs/fo/embed.fo25
-rw-r--r--src/documentation/content/xdocs/fo/embed.fo.pdf87
-rw-r--r--src/documentation/content/xdocs/fo/embed.pdfbin8249 -> 0 bytes
-rw-r--r--src/documentation/content/xdocs/fo/fonts.fo48
-rw-r--r--src/documentation/content/xdocs/fo/fonts.fo.pdf160
-rw-r--r--src/documentation/content/xdocs/fo/fonts.pdfbin20432 -> 0 bytes
-rw-r--r--src/documentation/content/xdocs/fo/size.fo25
-rw-r--r--src/documentation/content/xdocs/fo/size.fo.pdfbin0 -> 5516 bytes
-rw-r--r--src/documentation/content/xdocs/fo/size.pdfbin9508 -> 0 bytes
-rw-r--r--src/documentation/content/xdocs/index.xml24
-rw-r--r--src/documentation/content/xdocs/knownissues.xml29
-rw-r--r--src/documentation/content/xdocs/license.xml3
-rw-r--r--src/documentation/content/xdocs/maillist.xml2
-rw-r--r--src/documentation/content/xdocs/news-data.xml9
-rw-r--r--src/documentation/content/xdocs/news.xml15
-rw-r--r--src/documentation/content/xdocs/quickstartguide.xml14
-rw-r--r--src/documentation/content/xdocs/site.xml84
-rw-r--r--src/documentation/content/xdocs/status.xml30
-rw-r--r--src/documentation/content/xdocs/tabs.xml2
-rw-r--r--src/documentation/content/xdocs/team.xml2
-rw-r--r--src/documentation/content/xdocs/trunk/configuration.xml18
-rw-r--r--src/documentation/content/xdocs/trunk/fonts.xml10
-rw-r--r--src/documentation/content/xdocs/trunk/graphics.xml13
-rw-r--r--src/documentation/intermediate-format-ng/fop-intermediate-format-ng.xsd1
-rw-r--r--src/documentation/resources/stylesheets/known-issues2document.xsl6
-rw-r--r--src/java/META-INF/services/org.apache.fop.render.ImageHandler2
-rw-r--r--src/java/org/apache/fop/accessibility/Accessibility.java6
-rw-r--r--src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java25
-rw-r--r--src/java/org/apache/fop/afp/AFPGraphics2D.java4
-rw-r--r--src/java/org/apache/fop/afp/modca/ImageObject.java6
-rw-r--r--src/java/org/apache/fop/afp/modca/PresentationTextData.java2
-rw-r--r--src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java3
-rw-r--r--src/java/org/apache/fop/apps/FOUserAgent.java5
-rw-r--r--src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java2
-rw-r--r--src/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java41
-rw-r--r--src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java2
-rw-r--r--src/java/org/apache/fop/fo/FOEventHandler.java14
-rw-r--r--src/java/org/apache/fop/fo/flow/Wrapper.java19
-rw-r--r--src/java/org/apache/fop/fo/properties/CondLengthProperty.java5
-rw-r--r--src/java/org/apache/fop/fonts/BFEntry.java (renamed from src/java/org/apache/fop/fonts/CMapSegment.java)39
-rw-r--r--src/java/org/apache/fop/fonts/CIDFontType.java2
-rw-r--r--src/java/org/apache/fop/fonts/CustomFont.java40
-rw-r--r--src/java/org/apache/fop/fonts/CustomFontCollection.java2
-rw-r--r--src/java/org/apache/fop/fonts/EmbedFontInfo.java23
-rw-r--r--src/java/org/apache/fop/fonts/EmbeddingMode.java58
-rw-r--r--src/java/org/apache/fop/fonts/EncodingMode.java2
-rw-r--r--src/java/org/apache/fop/fonts/FontInfoConfigurator.java6
-rw-r--r--src/java/org/apache/fop/fonts/FontLoader.java22
-rw-r--r--src/java/org/apache/fop/fonts/FontReader.java13
-rw-r--r--src/java/org/apache/fop/fonts/FontType.java5
-rw-r--r--src/java/org/apache/fop/fonts/LazyFont.java10
-rw-r--r--src/java/org/apache/fop/fonts/MultiByteFont.java62
-rw-r--r--src/java/org/apache/fop/fonts/MutableFont.java6
-rw-r--r--src/java/org/apache/fop/fonts/SingleByteFont.java24
-rw-r--r--src/java/org/apache/fop/fonts/apps/TTFReader.java30
-rw-r--r--src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java6
-rw-r--r--src/java/org/apache/fop/fonts/truetype/FontFileReader.java29
-rw-r--r--src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java118
-rw-r--r--src/java/org/apache/fop/fonts/truetype/TTFDirTabEntry.java8
-rw-r--r--src/java/org/apache/fop/fonts/truetype/TTFFile.java709
-rw-r--r--src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java65
-rw-r--r--src/java/org/apache/fop/fonts/truetype/TTFGlyphOutputStream.java48
-rw-r--r--src/java/org/apache/fop/fonts/truetype/TTFOutputStream.java49
-rw-r--r--src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java525
-rw-r--r--src/java/org/apache/fop/fonts/truetype/TTFTableName.java163
-rw-r--r--src/java/org/apache/fop/fonts/truetype/TTFTableOutputStream.java37
-rw-r--r--src/java/org/apache/fop/hyphenation/HyphenationTreeCache.java6
-rw-r--r--src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java16
-rw-r--r--src/java/org/apache/fop/layoutmgr/BreakElement.java34
-rw-r--r--src/java/org/apache/fop/layoutmgr/KnuthPenalty.java7
-rw-r--r--src/java/org/apache/fop/pdf/AbstractPDFStream.java9
-rw-r--r--src/java/org/apache/fop/pdf/AlphaRasterImage.java4
-rw-r--r--src/java/org/apache/fop/pdf/BitmapImage.java20
-rw-r--r--src/java/org/apache/fop/pdf/PDFColor.java2
-rw-r--r--src/java/org/apache/fop/pdf/PDFEmbeddedFile.java5
-rw-r--r--src/java/org/apache/fop/pdf/PDFFactory.java5
-rw-r--r--src/java/org/apache/fop/pdf/PDFImage.java8
-rw-r--r--src/java/org/apache/fop/pdf/PDFImageXObject.java5
-rw-r--r--src/java/org/apache/fop/pdf/PDFObject.java6
-rw-r--r--src/java/org/apache/fop/pdf/PDFResources.java54
-rw-r--r--src/java/org/apache/fop/render/ImageHandler.java3
-rw-r--r--src/java/org/apache/fop/render/afp/AFPDocumentHandler.java3
-rw-r--r--src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java2
-rw-r--r--src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java4
-rw-r--r--src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java2
-rw-r--r--src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java3
-rw-r--r--src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java3
-rw-r--r--src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java3
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFContext.java4
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFSerializer.java13
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFUtil.java8
-rw-r--r--src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java3
-rw-r--r--src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java2
-rw-r--r--src/java/org/apache/fop/render/java2d/Java2DPainter.java3
-rw-r--r--src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java3
-rw-r--r--src/java/org/apache/fop/render/pcl/PCLPainter.java3
-rw-r--r--src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java83
-rw-r--r--src/java/org/apache/fop/render/pdf/ImageRawPNGAdapter.java260
-rw-r--r--src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java73
-rw-r--r--src/java/org/apache/fop/render/pdf/PDFImageHandlerRawPNG.java65
-rw-r--r--src/java/org/apache/fop/render/ps/FontResourceCache.java17
-rw-r--r--src/java/org/apache/fop/render/ps/ImageEncoderPNG.java113
-rw-r--r--src/java/org/apache/fop/render/ps/NativeTextHandler.java6
-rw-r--r--src/java/org/apache/fop/render/ps/PSDocumentHandler.java35
-rw-r--r--src/java/org/apache/fop/render/ps/PSEventProducer.java7
-rw-r--r--src/java/org/apache/fop/render/ps/PSEventProducer.xml1
-rw-r--r--src/java/org/apache/fop/render/ps/PSFontResource.java77
-rw-r--r--src/java/org/apache/fop/render/ps/PSFontUtils.java440
-rw-r--r--src/java/org/apache/fop/render/ps/PSImageHandlerRawPNG.java111
-rw-r--r--src/java/org/apache/fop/render/ps/PSImageHandlerRenderedImage.java26
-rw-r--r--src/java/org/apache/fop/render/ps/PSPainter.java66
-rw-r--r--src/java/org/apache/fop/render/ps/PSTextPainter.java45
-rw-r--r--src/java/org/apache/fop/render/ps/ResourceHandler.java10
-rw-r--r--src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java7
-rw-r--r--src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java3
-rw-r--r--src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBefore.java50
-rw-r--r--src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBeforeElement.java55
-rw-r--r--src/java/org/apache/fop/render/ps/fonts/PSTTFGenerator.java101
-rw-r--r--src/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStream.java75
-rw-r--r--src/java/org/apache/fop/render/ps/fonts/PSTTFOutputStream.java62
-rw-r--r--src/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStream.java59
-rw-r--r--src/java/org/apache/fop/render/xml/XMLRenderer.java26
-rw-r--r--src/java/org/apache/fop/svg/PDFAElementBridge.java2
-rw-r--r--src/java/org/apache/fop/svg/PDFGraphics2D.java2
-rw-r--r--src/java/org/apache/fop/traits/MinOptMax.java5
-rw-r--r--src/java/org/apache/fop/traits/TraitEnum.java4
-rw-r--r--src/java/org/apache/fop/util/ColorExt.java2
-rw-r--r--src/java/org/apache/fop/util/HexEncoder.java57
-rw-r--r--src/sandbox/org/apache/fop/render/mif/MIFHandler.java60
-rw-r--r--src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java3
-rw-r--r--src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java3
-rw-r--r--status.xml185
-rw-r--r--test/java/org/apache/fop/UtilityCodeTestSuite.java8
-rw-r--r--test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java15
-rw-r--r--test/java/org/apache/fop/accessibility/fo/artifact.fo97
-rw-r--r--test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl2
-rw-r--r--test/java/org/apache/fop/fonts/DejaVuLGCSerifTestCase.java3
-rw-r--r--test/java/org/apache/fop/fonts/EncodingModeTestCase.java18
-rw-r--r--test/java/org/apache/fop/fonts/FOPFontsTestSuite.java42
-rw-r--r--test/java/org/apache/fop/fonts/truetype/FontFileReaderTestCase.java304
-rw-r--r--test/java/org/apache/fop/fonts/truetype/GlyfTableTestCase.java7
-rw-r--r--test/java/org/apache/fop/fonts/truetype/TTFFileTestCase.java427
-rw-r--r--test/java/org/apache/fop/fonts/truetype/TTFFontLoaderTestCase.java13
-rw-r--r--test/java/org/apache/fop/fonts/truetype/TTFSubSetFileTestCase.java76
-rw-r--r--test/java/org/apache/fop/fonts/truetype/TTFTableNameTestCase.java153
-rw-r--r--test/java/org/apache/fop/render/RawPNGTestUtil.java92
-rw-r--r--test/java/org/apache/fop/render/pdf/ImageRawPNGAdapterTestCase.java142
-rw-r--r--test/java/org/apache/fop/render/ps/ImageEncoderPNGTestCase.java133
-rw-r--r--test/java/org/apache/fop/render/ps/PSRenderingUtilTestCase.java45
-rw-r--r--test/java/org/apache/fop/render/ps/RenderPSTestSuite.java43
-rw-r--r--test/java/org/apache/fop/render/ps/fonts/PSTTFGeneratorTestCase.java120
-rw-r--r--test/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStreamTestCase.java109
-rw-r--r--test/java/org/apache/fop/render/ps/fonts/PSTTFOutputStreamTestCase.java90
-rw-r--r--test/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStreamTestCase.java87
-rw-r--r--test/java/org/apache/fop/svg/PDFGraphics2DTestCase.java48
-rw-r--r--test/java/org/apache/fop/util/HexEncoderTestCase.java61
-rw-r--r--test/layoutengine/standard-testcases/bidi_propagation_1.xml4
-rw-r--r--test/layoutengine/standard-testcases/character_writing-mode_rl.xml10
-rw-r--r--test/pdf/accessibility/pdf/role.pdfbin18600 -> 19023 bytes
-rw-r--r--test/pdf/accessibility/role.fo4
-rw-r--r--test/resources/fonts/ttf/DroidSansMono.LICENSE18
-rw-r--r--test/resources/fonts/ttf/DroidSansMono.ttfbin78296 -> 0 bytes
223 files changed, 2146 insertions, 14910 deletions
diff --git a/NOTICE b/NOTICE
index 082bb4a60..07d14c38f 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
Apache FOP
-Copyright 1999-2012 The Apache Software Foundation
+Copyright 1999-2010 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
diff --git a/README b/README
index f2adc887e..eebaf2cc4 100644
--- a/README
+++ b/README
@@ -22,8 +22,8 @@ Apache FOP is the world's first print formatter driven by XSL formatting
objects. It is a Java application that reads a formatting object tree
conforming to the XSL 1.1 Recommendation (05 December 2006) and then turns it
into a PDF document, certain other output formats or allows you to preview it
-directly on screen. Note that not all parts of the XSL 1.1 specification
-have yes been implemented.
+directly on screen. Some parts of the XSL 1.1 specification (work in progress!)
+have also been implemented.
Apache FOP is part of Apache's XML Graphics project. The homepage of Apache
FOP is http://xmlgraphics.apache.org/fop/.
@@ -93,41 +93,6 @@ http://xmlgraphics.apache.org/fop/stable/running.html
RELEASE NOTES
==============================================================================
-Version 1.1rc1
-==============
-
-This is a candidate release of the next, minor (dot) release of Apache FOP,
-which primarily addresses bug fixes and also adds a number of new features.
-See below for details.
-
-Compliance
-----------
-
-This release implements the XSL 1.0 and 1.1 recommendations to a relatively
-high degree of compliance. See the compliance page
-http://xmlgraphics.apache.org/fop/compliance.html for further details.
-
-Known issues
-------------
-
-A detailed list of known issues in this release is available at
-http://xmlgraphics.apache.org/fop/1.1/knownissues_overview.html.
-
-Major Changes in Version 1.1rc1
--------------------------------
-
-* Added support for complex scripts (e.g. Arabic, Indic, etc).
-* Added possibility to embed TrueType fonts in the PostScript output.
-* Added possibility to reduce the file size of accessible PDF outputs by using
- Object Streams (a PDF 1.5 feature).
-* Added support for 128bit PDF encryption.
-
-A more detailed list of changes in this release is available at
-http://xmlgraphics.apache.org/fop/1.1rc1/changes_1.1rc1.html.
-
-A more detailed list of changes in this and earlier releases is available at
-http://xmlgraphics.apache.org/fop/changes.html.
-
Version 1.0
===========
diff --git a/build.xml b/build.xml
index e0c3c97bc..96c8556c9 100644
--- a/build.xml
+++ b/build.xml
@@ -143,8 +143,8 @@ list of possible build targets.
<property name="Name" value="Apache FOP"/>
<property name="name" value="fop"/>
<property name="NAME" value="FOP"/>
- <property name="version" value="1.1rc1"/>
- <property name="year" value="1999-2012"/>
+ <property name="version" value="svn-trunk"/>
+ <property name="year" value="1999-2010"/>
<property name="javac.debug" value="on"/>
<property name="javac.optimize" value="off"/>
<property name="javac.deprecation" value="on"/>
@@ -477,7 +477,7 @@ list of possible build targets.
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}, Target Java ${javac.target}])"/>
<section name="org/apache/fop/">
<attribute name="Specification-Title" value="XSL-FO - Extensible Stylesheet Language"/>
- <attribute name="Specification-Version" value="1.1"/>
+ <attribute name="Specification-Version" value="1.0"/>
<attribute name="Specification-Vendor" value="World Wide Web Consortium"/>
<attribute name="Specification-URL" value="http://www.w3.org/TR/xsl"/>
<attribute name="Implementation-Title" value="${Name}"/>
@@ -864,28 +864,16 @@ list of possible build targets.
<target name="junit-text-linebreak" depends="junit-compile" description="Runs FOP's JUnit unicode linebreak tests" if="junit.present">
<junit-run title="Unicode UAX#14 support" testsuite="org.apache.fop.text.linebreak.LineBreakStatusTestCase" outfile="TEST-linebreak"/>
</target>
- <target name="junit-fonts" depends="junit-compile">
- <echo message="Running tests for the fonts package"/>
- <junit-run title="fonts" testsuite="org.apache.fop.fonts.FOPFontsTestSuite" outfile="TEST-fonts"/>
- </target>
- <target name="junit-render-ps" depends="junit-compile">
- <echo message="Running tests for the render ps package"/>
- <junit-run title="render-ps" testsuite="org.apache.fop.render.ps.RenderPSTestSuite" outfile="TEST-render-ps"/>
- </target>
<target name="junit-render-pdf" depends="junit-compile">
<junit-run title="render-pdf" testsuite="org.apache.fop.render.pdf.RenderPDFTestSuite" outfile="TEST-render-pdf"/>
</target>
<target name="junit-complexscripts" depends="junit-compile">
<junit-run title="complexscripts" testsuite="org.apache.fop.complexscripts.ComplexScriptsTestSuite" outfile="TEST-complexscripts"/>
</target>
- <target name="junit-reduced" depends="junit-userconfig, junit-basic, junit-transcoder,
- junit-text-linebreak, junit-fotree, junit-fonts, junit-render-pdf, junit-render-ps,
- junit-complexscripts"/>
+ <target name="junit-reduced" depends="junit-userconfig, junit-basic, junit-transcoder, junit-text-linebreak, junit-fotree, junit-render-pdf, junit-complexscripts"/>
<target name="junit" depends="junit-all" description="Runs all of FOP's JUnit tests"
if="junit.present">
- <fail><condition><or><isset property="fop.junit.error"/><isset
- property="fop.junit.failure"/><not><isset
- property="hyphenation.present"/></not></or></condition>
+ <fail><condition><or><isset property="fop.junit.error"/><isset property="fop.junit.failure"/><not><isset property="hyphenation.present"/></not></or></condition>
NOTE:
**************************************************************************
* One or more of the Junit tests had Failures or Errors or were skipped! *
@@ -1450,20 +1438,14 @@ NOTE:
</delete>
</target>
<target name="validate-xdocs" description="Validate the xdocs. Point schemas.dir to Forrest's 'schemas' directory.">
- <property name="schemas.dir" value="../xml-forrest/main/webapp/resources/schema"/>
+ <property name="schemas.dir" value="../xml-forrest/src/resources/schema"/>
<xmlvalidate failonerror="no">
- <fileset dir="${xdocs.dir}">
- <include name="**.xml"/>
- <exclude name="**/site.xml"/>
- <exclude name="**/news-data.xml"/>
- </fileset>
+ <fileset dir="${xdocs.dir}" includes="**.xml"/>
<xmlcatalog>
<entity publicId="-//APACHE//DTD Compliance V1.0//EN" location="src/documentation/resources/schema/dtd/compliance-v10.dtd"/>
<entity publicId="-//APACHE//DTD Documentation V1.1//EN" location="${schemas.dir}/dtd/document-v11.dtd"/>
- <entity publicId="-//APACHE//DTD Documentation V1.3//EN" location="${schemas.dir}/dtd/document-v13.dtd"/>
<entity publicId="-//APACHE//DTD Specification V1.1//EN" location="${schemas.dir}/dtd/specification-v11.dtd"/>
<entity publicId="-//APACHE//DTD FAQ V1.1//EN" location="${schemas.dir}/dtd/faq-v11.dtd"/>
- <entity publicId="-//APACHE//DTD FAQ V1.3//EN" location="${schemas.dir}/dtd/faq-v13.dtd"/>
<entity publicId="-//APACHE//DTD Changes V1.1//EN" location="${schemas.dir}/dtd/changes-v11.dtd"/>
<entity publicId="-//APACHE//DTD Todo V1.1//EN" location="${schemas.dir}/dtd/todo-v11.dtd"/>
<entity publicId="-//APACHE//DTD Cocoon Documentation Book V1.0//EN" location="${schemas.dir}/dtd/book-cocoon-v10.dtd"/>
diff --git a/checkstyle-5.1.xml b/checkstyle-5.1.xml
new file mode 100644
index 000000000..8a393d452
--- /dev/null
+++ b/checkstyle-5.1.xml
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.1//EN" "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
+<module name="Checker">
+ <module name="TreeWalker">
+ <module name="ArrayTypeStyleCheck">
+ <property name="javaStyle" value="true"/>
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="ModifierOrderCheck">
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="RedundantModifierCheck">
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="METHOD_DEF, VARIABLE_DEF"/>
+ </module>
+ <module name="UpperEllCheck">
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="AvoidNestedBlocksCheck">
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="EmptyBlockCheck">
+ <property name="option" value="text"/>
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_IF, LITERAL_FOR, LITERAL_TRY, LITERAL_WHILE, STATIC_INIT"/>
+ </module>
+ <module name="LeftCurlyCheck">
+ <property name="maxLineLength" value="100"/>
+ <property name="option" value="eol"/>
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="CLASS_DEF, CTOR_DEF, INTERFACE_DEF, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF"/>
+ </module>
+ <module name="NeedBracesCheck">
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="LITERAL_DO, LITERAL_ELSE, LITERAL_IF, LITERAL_FOR, LITERAL_WHILE"/>
+ </module>
+ <module name="RightCurlyCheck">
+ <property name="option" value="same"/>
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="LITERAL_CATCH, LITERAL_ELSE, LITERAL_TRY"/>
+ </module>
+ <module name="DoubleCheckedLockingCheck">
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="EmptyStatementCheck">
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="EqualsHashCodeCheck">
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="InnerAssignmentCheck">
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="ASSIGN, BAND_ASSIGN, BOR_ASSIGN, BSR_ASSIGN, BXOR_ASSIGN, DIV_ASSIGN, MINUS_ASSIGN, MOD_ASSIGN, PLUS_ASSIGN, SL_ASSIGN, SR_ASSIGN, STAR_ASSIGN"/>
+ </module>
+ <module name="MissingSwitchDefaultCheck">
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="SimplifyBooleanExpressionCheck">
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="SimplifyBooleanReturnCheck">
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="FinalClassCheck">
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="HideUtilityClassConstructorCheck">
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="VisibilityModifierCheck">
+ <property name="packageAllowed" value="false"/>
+ <property name="protectedAllowed" value="true"/>
+ <property name="publicMemberPattern" value="^serialVersionUID"/>
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="AvoidStarImportCheck">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="JavadocMethodCheck">
+ <property name="allowMissingParamTags" value="false"/>
+ <property name="allowMissingReturnTag" value="false"/>
+ <property name="allowMissingThrowsTags" value="false"/>
+ <property name="allowThrowsTagsForSubclasses" value="false"/>
+ <property name="allowUndeclaredRTE" value="false"/>
+ <property name="scope" value="protected"/>
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="METHOD_DEF, CTOR_DEF"/>
+ </module>
+ <module name="JavadocTypeCheck">
+ <property name="scope" value="protected"/>
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="CLASS_DEF, INTERFACE_DEF"/>
+ </module>
+ <module name="JavadocVariableCheck">
+ <property name="scope" value="protected"/>
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="ConstantNameCheck">
+ <property name="format" value="^([A-Z](_?[A-Z0-9]+)*)|(log)$"/>
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="LocalFinalVariableNameCheck">
+ <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="LocalVariableNameCheck">
+ <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="MemberNameCheck">
+ <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="MethodNameCheck">
+ <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="PackageNameCheck">
+ <property name="format" value="^[a-z]+(\.[a-zA-Z_][a-zA-Z0-9_]*)*$"/>
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="ParameterNameCheck">
+ <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="StaticVariableNameCheck">
+ <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="TypeNameCheck">
+ <property name="format" value="^[A-Z][a-zA-Z0-9]*$"/>
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="CLASS_DEF, INTERFACE_DEF"/>
+ </module>
+ <module name="LineLengthCheck">
+ <property name="ignorePattern" value="^$"/>
+ <property name="max" value="100"/>
+ <property name="severity" value="warning"/>
+ <property name="tabWidth" value="4"/>
+ </module>
+ <module name="MethodLengthCheck">
+ <property name="max" value="150"/>
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="METHOD_DEF, CTOR_DEF"/>
+ </module>
+ <module name="ParameterNumberCheck">
+ <property name="max" value="7"/>
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="METHOD_DEF, CTOR_DEF"/>
+ </module>
+ <module name="EmptyForIteratorPadCheck">
+ <property name="option" value="nospace"/>
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="NoWhitespaceAfterCheck">
+ <property name="allowLineBreaks" value="true"/>
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="ARRAY_INIT, BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS"/>
+ </module>
+ <module name="NoWhitespaceBeforeCheck">
+ <property name="allowLineBreaks" value="true"/>
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="SEMI, POST_DEC, POST_INC"/>
+ </module>
+ <module name="OperatorWrapCheck">
+ <property name="option" value="nl"/>
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, SL, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN"/>
+ </module>
+ <module name="WhitespaceAfterCheck">
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="COMMA, SEMI"/>
+ </module>
+ <module name="WhitespaceAroundCheck">
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN"/>
+ </module>
+ <module name="FileContentsHolder"/>
+ </module>
+ <module name="RegexpHeader">
+ <property name="headerFile" value="${samedir}/checkstyle.header"/>
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="FileLengthCheck">
+ <property name="max" value="2000"/>
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="FileTabCharacter">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="SuppressionFilter">
+ <property name="file" value="${samedir}/checkstyle-suppressions.xml"/>
+ </module>
+ <module name="SuppressionCommentFilter">
+ <property name="offCommentFormat" value="CSOFF\: ([\w\|]+)"/>
+ <property name="onCommentFormat" value="CSON\: ([\w\|]+)"/>
+ <property name="checkFormat" value="$1"/>
+ </module>
+ <module name="SuppressWithNearbyCommentFilter">
+ <property name="commentFormat" value="CSOK\: ([\w\|]+)"/>
+ <property name="checkFormat" value="$1"/>
+ <property name="influenceFormat" value="0"/>
+ </module>
+</module>
diff --git a/examples/fo/advanced/cid-fonts.fo b/examples/fo/advanced/cid-fonts.fo
index cdcb4737c..526ebea06 100644
--- a/examples/fo/advanced/cid-fonts.fo
+++ b/examples/fo/advanced/cid-fonts.fo
@@ -369,7 +369,7 @@ This font contains no embedding license restrictions
</fo:block>
</fo:wrapper>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="50mm"/>
<fo:table-column column-width="50mm"/>
<fo:table-column column-width="50mm"/>
diff --git a/examples/fo/advanced/giro.fo b/examples/fo/advanced/giro.fo
index 9f1a6723a..5b5422ec9 100644
--- a/examples/fo/advanced/giro.fo
+++ b/examples/fo/advanced/giro.fo
@@ -32,7 +32,7 @@
<fo:block-container absolute-position="absolute" width="100%" height="100%" border-top-color="silver" border-top-style="dotted" border-top-width="0.13mm">
<fo:block/>
</fo:block-container>
- <fo:table space-before.optimum="1in div 12" margin-left="2in div 12" margin-top="1in div 10" font-family="sans-serif" font-size="7pt" color="green" table-layout="fixed" width="100%">
+ <fo:table space-before.optimum="1in div 12" margin-left="2in div 12" margin-top="1in div 10" font-family="sans-serif" font-size="7pt" color="green">
<fo:table-column column-width="8in div 10 - 2in div 12"/>
<fo:table-column border-right-style="solid" border-right-width="0.5mm" column-width="36in div 10"/>
<fo:table-column column-width="5in div 10"/>
@@ -107,7 +107,7 @@
<fo:block>Från konto nr</fo:block>
</fo:table-cell>
<fo:table-cell border-bottom-style="solid" border-bottom-width="0.13mm" padding-top="6mm" display-align="after">
- <fo:table height="3mm" table-layout="fixed" width="100%">
+ <fo:table height="3mm">
<fo:table-column border-right-style="solid" border-right-width="0.13mm" column-width="0.2in"/>
<fo:table-column border-right-style="solid" border-right-width="0.13mm" column-width="0.2in"/>
<fo:table-column border-right-style="solid" border-right-width="0.13mm" column-width="0.2in"/>
@@ -182,7 +182,7 @@
<fo:block color="black">16.6.2006</fo:block>
</fo:table-cell>
<fo:table-cell border-bottom-style="solid" border-bottom-width="0.5mm" padding-left="2mm" padding-top="4mm" font-size="10pt">
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="0.5cm"/>
<fo:table-column column-width="2cm"/>
<fo:table-body>
@@ -201,7 +201,7 @@
<fo:table-row height="13in div 12 - 5mm">
<fo:table-cell number-columns-spanned="4" padding-left="40mm" display-align="after">
<fo:block>
- <fo:table height="5in div 12" margin-left="2.5mm" margin-right="2.5mm" table-layout="fixed" width="100%"><!--105-->
+ <fo:table height="5in div 12" margin-left="2.5mm" margin-right="2.5mm"><!--105-->
<fo:table-column column-width="0.5mm"/>
<fo:table-column column-width="0.25mm"/>
<fo:table-column column-width="0.25mm"/>
@@ -950,7 +950,7 @@
</fo:page-sequence>
<fo:page-sequence master-reference="A4">
<fo:static-content flow-name="xsl-region-after">
- <fo:table space-before.optimum="1in div 12" margin-left="2in div 12" margin-top="1in div 10" font-family="sans-serif" font-size="7pt" color="green" table-layout="fixed" width="100%">
+ <fo:table space-before.optimum="1in div 12" margin-left="2in div 12" margin-top="1in div 10" font-family="sans-serif" font-size="7pt" color="green">
<fo:table-column column-width="8in div 10 - 2in div 12"/>
<fo:table-column border-right-style="solid" border-right-width="0.5mm" column-width="36in div 10"/>
<fo:table-column column-width="5in div 10"/>
@@ -1025,7 +1025,7 @@
<fo:block>Från konto nr</fo:block>
</fo:table-cell>
<fo:table-cell border-bottom-style="solid" border-bottom-width="0.13mm" padding-top="6mm" display-align="after">
- <fo:table height="3mm" table-layout="fixed" width="100%">
+ <fo:table height="3mm">
<fo:table-column border-right-style="solid" border-right-width="0.13mm" column-width="0.2in"/>
<fo:table-column border-right-style="solid" border-right-width="0.13mm" column-width="0.2in"/>
<fo:table-column border-right-style="solid" border-right-width="0.13mm" column-width="0.2in"/>
@@ -1100,7 +1100,7 @@
<fo:block color="black">16.6.2006</fo:block>
</fo:table-cell>
<fo:table-cell border-bottom-style="solid" border-bottom-width="0.5mm" padding-left="2mm" padding-top="4mm" font-size="10pt">
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="0.5cm"/>
<fo:table-column column-width="2cm"/>
<fo:table-body>
diff --git a/examples/fo/basic/images.fo b/examples/fo/basic/images.fo
index daabcd31b..3bb864fd8 100644
--- a/examples/fo/basic/images.fo
+++ b/examples/fo/basic/images.fo
@@ -31,6 +31,8 @@
odd-or-even="even" />
<fo:conditional-page-master-reference master-reference="right"
odd-or-even="odd" />
+ <!-- recommended fallback procedure -->
+ <fo:conditional-page-master-reference master-reference="rest" />
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
diff --git a/examples/fo/basic/tableunits.fo b/examples/fo/basic/tableunits.fo
index 1a1c8c9e1..aca927c4a 100644
--- a/examples/fo/basic/tableunits.fo
+++ b/examples/fo/basic/tableunits.fo
@@ -67,9 +67,9 @@
<fo:block space-before="12pt" space-after="6pt">The next table has width=100% on the table no column widths specified on the table-column element.</fo:block>
<!-- table start -->
<fo:table border-collapse="separate" table-layout="fixed" width="100%">
- <fo:table-column column-width="proportional-column-width(1)" background-color="yellow"/>
- <fo:table-column column-width="proportional-column-width(1)" background-color="blue"/>
- <fo:table-column column-width="proportional-column-width(1)" background-color="green"/>
+ <fo:table-column background-color="yellow"/>
+ <fo:table-column background-color="blue"/>
+ <fo:table-column background-color="green"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell display-align="before"><fo:block>Some text to make this cell
@@ -83,7 +83,7 @@
<fo:block space-before="12pt" space-after="6pt">The next table has fixed column widths=13cm, ipd.optimum=12cm and ipd.max = 100%.</fo:block>
<!-- table start -->
<fo:table border-collapse="separate"
- table-layout="fixed" width="100%"
+ table-layout="fixed"
inline-progression-dimension="12cm"
inline-progression-dimension.maximum="100%"
>
@@ -122,8 +122,8 @@
<!-- table start -->
<fo:table border-collapse="separate" table-layout="fixed" width="70% + 1cm">
<fo:table-column column-width="from-parent('width') div 3" background-color="yellow"/>
- <fo:table-column column-width="proportional-column-width(1)" background-color="blue"/>
- <fo:table-column column-width="proportional-column-width(1)" background-color="green"/>
+ <fo:table-column background-color="blue"/>
+ <fo:table-column background-color="green"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell display-align="before"><fo:block>Some text to make this cell
@@ -140,11 +140,11 @@
</fo:block>
<!-- table start -->
<fo:table border-collapse="separate"
- table-layout="fixed" width="100%"
+ table-layout="fixed"
inline-progression-dimension="15cm">
- <fo:table-column column-width="proportional-column-width(1)" background-color="yellow"/>
+ <fo:table-column background-color="yellow"/>
<fo:table-column column-width="3cm" background-color="blue"/>
- <fo:table-column column-width="proportional-column-width(1)" background-color="green"/>
+ <fo:table-column background-color="green"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell display-align="before"><fo:block>Some text to make this cell
@@ -159,10 +159,10 @@
The next table specifies neither width nor inline-progression-dimension.
</fo:block>
<!-- table start -->
- <fo:table table-layout="fixed" width="100%" border-collapse="separate">
- <fo:table-column column-width="proportional-column-width(1)" background-color="yellow"/>
+ <fo:table table-layout="fixed" border-collapse="separate">
+ <fo:table-column background-color="yellow"/>
<fo:table-column column-width="3cm" background-color="blue"/>
- <fo:table-column column-width="proportional-column-width(1)" background-color="green"/>
+ <fo:table-column background-color="green"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell display-align="before"><fo:block>Some text to make this cell
@@ -178,11 +178,11 @@
specifies a column width of 5cm on the middle column only.
</fo:block>
<!-- table start -->
- <fo:table table-layout="fixed" width="100%" border-collapse="separate"
+ <fo:table table-layout="fixed" border-collapse="separate"
inline-progression-dimension.minimum="10cm">
- <fo:table-column column-width="proportional-column-width(1)" background-color="yellow"/>
+ <fo:table-column background-color="yellow"/>
<fo:table-column column-width="5cm" background-color="blue"/>
- <fo:table-column column-width="proportional-column-width(1)" background-color="green"/>
+ <fo:table-column background-color="green"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell display-align="before"><fo:block>Some text to make this cell
@@ -194,17 +194,17 @@
</fo:table>
<fo:block space-before="12pt" space-after="6pt">
- The next table specifies inline-progression-dimension.minimum=&quot;10cm&quot;,
- inline-progression-dimension.maximum=&quot;17cm and
+ The next table specifies inline-progression-dimension.minimum="10cm",
+ inline-progression-dimension.maximum="17cm and
specifies a column width of 5cm on the middle column only.
</fo:block>
<!-- table start -->
- <fo:table table-layout="fixed" width="100%" border-collapse="separate"
+ <fo:table table-layout="fixed" border-collapse="separate"
inline-progression-dimension.minimum="10cm"
inline-progression-dimension.maximum="17cm">
- <fo:table-column column-width="proportional-column-width(1)" background-color="yellow"/>
+ <fo:table-column background-color="yellow"/>
<fo:table-column column-width="5cm" background-color="blue"/>
- <fo:table-column column-width="proportional-column-width(1)" background-color="green"/>
+ <fo:table-column background-color="green"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell display-align="before"><fo:block>Some text to make this cell
diff --git a/examples/fo/build.xml b/examples/fo/build.xml
index de83b945c..2c7c18259 100644
--- a/examples/fo/build.xml
+++ b/examples/fo/build.xml
@@ -127,7 +127,6 @@
</target>
<!-- =================================================================== -->
<!-- Compares new test pdf files to reference pdf files -->
- <!-- N.B. All comparisons fail due to differences in /CreationDate -->
<!-- =================================================================== -->
<target name="comparePDF" depends="newPDF">
<compare referenceDirectory="${referenceDir}" testDirectory="${testDir}" filenames="normal.pdf,table.pdf,list.pdf,link.pdf,border.pdf,images.pdf,extensive.pdf,readme.pdf,fonts.pdf,bordershorthand.pdf,character.pdf,corresprop.pdf,hyphen.pdf,inhprop.pdf,instream.pdf,leader.pdf,newlinktest.pdf,normalex.pdf,pdfoutline.pdf,simple.pdf,textdeko.pdf,tableunits.pdf"/>
@@ -145,7 +144,6 @@
<!-- =================================================================== -->
<!-- Starts the test -->
- <!-- N.B. All tests fail due to differences in /CreationDate -->
<!-- =================================================================== -->
<target name="runtest" depends="comparePDF">
<echo message="Running Fop tests"/>
@@ -156,9 +154,6 @@
<target name="clean" depends="init">
<delete dir="${testDir}"/>
</target>
- <target name="cleantest" depends="init">
- <delete dir="${referenceDir}"/>
- </target>
</project>
<!-- End of file -->
diff --git a/examples/fo/svg/embedding.fo b/examples/fo/svg/embedding.fo
index a4af1675e..dbcac747b 100644
--- a/examples/fo/svg/embedding.fo
+++ b/examples/fo/svg/embedding.fo
@@ -794,7 +794,7 @@ XML Syntax
<fo:block>
Here we have some examples of how the XML can be specified in the fo document.
<fo:block>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="350pt"/>
<fo:table-column column-width="150pt"/>
<fo:table-body>
@@ -932,7 +932,7 @@ Sizing
The size of the instream-foreign-object is obtained in a number of ways.
<fo:block>
- <fo:table xmlns:svg="http://www.w3.org/2000/svg" table-layout="fixed" width="100%">
+ <fo:table xmlns:svg="http://www.w3.org/2000/svg">
<fo:table-column column-width="350pt"/>
<fo:table-column column-width="150pt"/>
<fo:table-body>
diff --git a/examples/fo/tables/background.fo b/examples/fo/tables/background.fo
index e516348da..fe2cf128d 100644
--- a/examples/fo/tables/background.fo
+++ b/examples/fo/tables/background.fo
@@ -30,7 +30,7 @@
Table 1: cell background
</fo:block>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -72,7 +72,7 @@
Table 1: row background
</fo:block>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -152,7 +152,7 @@
Table 1: column background
</fo:block>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="3cm" background-color="green"/>
<fo:table-column column-width="3cm" background-color="red"/>
<fo:table-column column-width="3cm" background-color="blue"/>
@@ -219,7 +219,7 @@
Table 1: column backgrounds over page
</fo:block>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="3cm" background-color="green"/>
<fo:table-column column-width="3cm" background-color="red"/>
<fo:table-column column-width="3cm" background-color="blue"/>
@@ -286,7 +286,7 @@
Table 1: body background
</fo:block>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -323,7 +323,7 @@
</fo:table-body>
</fo:table>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -360,7 +360,7 @@
</fo:table-body>
</fo:table>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -397,7 +397,7 @@
</fo:table-body>
</fo:table>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -438,7 +438,7 @@
Table 1: table background
</fo:block>
- <fo:table background-color="green" table-layout="fixed" width="100%">
+ <fo:table background-color="green">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -475,7 +475,7 @@
</fo:table-body>
</fo:table>
- <fo:table background-color="red" table-layout="fixed" width="100%">
+ <fo:table background-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -516,7 +516,7 @@
Table 1: combinations
</fo:block>
- <fo:table background-color="green" table-layout="fixed" width="100%">
+ <fo:table background-color="green">
<fo:table-column column-width="2.5cm"/>
<fo:table-column column-width="2.5cm" background-color="green"/>
<fo:table-column column-width="2.5cm" background-color="red"/>
diff --git a/examples/fo/tables/borders.fo b/examples/fo/tables/borders.fo
index f6704ef61..a38a6b148 100644
--- a/examples/fo/tables/borders.fo
+++ b/examples/fo/tables/borders.fo
@@ -30,7 +30,7 @@
Table 1: cell borders
</fo:block>
- <fo:table border-collapse="separate" table-layout="fixed" width="100%">
+ <fo:table border-collapse="separate">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -186,7 +186,7 @@
Table 2: row borders
</fo:block>
- <fo:table border-collapse="collapse" table-layout="fixed" width="100%">
+ <fo:table border-collapse="collapse">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -310,7 +310,7 @@
Table 3: column borders
</fo:block>
- <fo:table border-collapse="collapse" table-layout="fixed" width="100%">
+ <fo:table border-collapse="collapse">
<fo:table-column column-width="3cm" border-left-color="green" border-left-width="0.5pt" border-left-style="solid"/>
<fo:table-column column-width="3cm" border-top-color="red" border-top-width="0.5pt" border-top-style="solid"/>
<fo:table-column column-width="3cm" border-right-color="blue" border-right-width="0.5pt" border-right-style="solid"/>
@@ -377,7 +377,7 @@
Table 4: column borders over page
</fo:block>
- <fo:table border-collapse="collapse" table-layout="fixed" width="100%">
+ <fo:table border-collapse="collapse">
<fo:table-column column-width="3cm" border-left-color="green" border-left-width="0.5pt" border-left-style="solid"/>
<fo:table-column column-width="3cm" border-top-color="red" border-top-width="0.5pt" border-top-style="solid"/>
<fo:table-column column-width="3cm" border-right-color="blue" border-right-width="0.5pt" border-right-style="solid"/>
@@ -444,7 +444,7 @@
Table 5: body borders
</fo:block>
- <fo:table border-collapse="separate" table-layout="fixed" width="100%">
+ <fo:table border-collapse="separate">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -480,7 +480,7 @@
</fo:table-body>
</fo:table>
- <fo:table border-collapse="separate" table-layout="fixed" width="100%">
+ <fo:table border-collapse="separate">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -516,7 +516,7 @@
</fo:table-body>
</fo:table>
- <fo:table border-collapse="separate" table-layout="fixed" width="100%">
+ <fo:table border-collapse="separate">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -552,7 +552,7 @@
</fo:table-body>
</fo:table>
- <fo:table border-collapse="separate" table-layout="fixed" width="100%">
+ <fo:table border-collapse="separate">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -588,7 +588,7 @@
</fo:table-body>
</fo:table>
- <fo:table border-collapse="separate" table-layout="fixed" width="100%">
+ <fo:table border-collapse="separate">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -628,7 +628,8 @@
Table 6: table borders
</fo:block>
- <fo:table border-left-color="green" border-left-width="0.5pt" border-left-style="solid" border-collapse="separate" table-layout="fixed" width="100%">
+ <fo:table border-left-color="green" border-left-width="0.5pt" border-left-style="solid"
+ border-collapse="separate">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -664,7 +665,7 @@
</fo:table-body>
</fo:table>
- <fo:table border-top-color="red" border-top-width="0.5pt" border-top-style="solid" border-collapse="separate" table-layout="fixed" width="100%">
+ <fo:table border-top-color="red" border-top-width="0.5pt" border-top-style="solid" border-collapse="separate">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -700,7 +701,7 @@
</fo:table-body>
</fo:table>
- <fo:table border-right-color="blue" border-right-width="0.5pt" border-right-style="solid" border-collapse="separate" table-layout="fixed" width="100%">
+ <fo:table border-right-color="blue" border-right-width="0.5pt" border-right-style="solid" border-collapse="separate">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -736,7 +737,7 @@
</fo:table-body>
</fo:table>
- <fo:table border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid" border-collapse="separate" table-layout="fixed" width="100%">
+ <fo:table border-bottom-color="yellow" border-bottom-width="0.5pt" border-bottom-style="solid" border-collapse="separate">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -772,7 +773,7 @@
</fo:table-body>
</fo:table>
- <fo:table border-color="orange" border-width="0.5pt" border-style="solid" border-collapse="separate" table-layout="fixed" width="100%">
+ <fo:table border-color="orange" border-width="0.5pt" border-style="solid" border-collapse="separate">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -812,7 +813,7 @@
Table 7: combinations
</fo:block>
- <fo:table border-left-color="green" border-left-width="0.5pt" border-left-style="solid" border-collapse="collapse" table-layout="fixed" width="100%">
+ <fo:table border-left-color="green" border-left-width="0.5pt" border-left-style="solid" border-collapse="collapse">
<fo:table-column column-width="2.5cm"/>
<fo:table-column column-width="2.5cm" border-left-color="green" border-left-width="0.5pt" border-left-style="solid"/>
<fo:table-column column-width="2.5cm" border-top-color="red" border-top-width="0.5pt" border-top-style="solid"/>
@@ -1024,7 +1025,7 @@
implementation status.
</fo:block>
- <fo:table border-collapse="collapse" table-layout="fixed" width="100%">
+ <fo:table border-collapse="collapse" table-layout="fixed">
<fo:table-column column-width="3cm" border-color="blue" border-width="0.5pt" border-style="solid"/>
<fo:table-column column-width="3cm" border-color="blue" border-width="0.5pt" border-style="solid"/>
<fo:table-column column-width="3cm" border-color="blue" border-width="0.5pt" border-style="solid"/>
@@ -1089,7 +1090,7 @@
fo:table-cell level.
</fo:block>
- <fo:table border-collapse="collapse" table-layout="fixed" width="100%">
+ <fo:table border-collapse="collapse" table-layout="fixed">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -1158,7 +1159,7 @@
Check the FOP compliance page for current implementation status.
</fo:block>
- <fo:table border-collapse="collapse" table-layout="fixed" width="100%"
+ <fo:table border-collapse="collapse" table-layout="fixed"
border-style="solid" border-width="5pt" border-color="yellow">
<fo:table-column column-width="3cm"
border-style="solid" border-width="3pt" border-color="black"/>
@@ -1263,7 +1264,7 @@
the border properties differ only on color.
</fo:block>
- <fo:table border-collapse="collapse" table-layout="fixed" width="100%">
+ <fo:table border-collapse="collapse" table-layout="fixed">
<fo:table-column column-width="3cm"
border-style="solid" border-width="3pt" border-color="black"/>
diff --git a/examples/fo/tables/break.fo b/examples/fo/tables/break.fo
index 91559699d..81325c4ed 100644
--- a/examples/fo/tables/break.fo
+++ b/examples/fo/tables/break.fo
@@ -34,7 +34,7 @@
Table 1: basic break after with next
</fo:block>
- <fo:table border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -81,7 +81,7 @@
Table 2: basic break before with next
</fo:block>
- <fo:table border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -128,7 +128,7 @@
Table 3: basic break before a keep with next
</fo:block>
- <fo:table border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -175,7 +175,7 @@
Table 4: basic break after a keep with previous
</fo:block>
- <fo:table border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -222,7 +222,7 @@
Table 5: basic break after a keep with previous
</fo:block>
- <fo:table border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
diff --git a/examples/fo/tables/headfoot.fo b/examples/fo/tables/headfoot.fo
index 4401a2c77..fd0a14590 100644
--- a/examples/fo/tables/headfoot.fo
+++ b/examples/fo/tables/headfoot.fo
@@ -30,7 +30,7 @@
Table 1: with header
</fo:block>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
@@ -311,7 +311,7 @@
Table 2: with footer
</fo:block>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
@@ -592,7 +592,7 @@
Table 3: with header and footer and keeps
</fo:block>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
@@ -888,7 +888,7 @@
Table 4: cells spanning columns
</fo:block>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
@@ -940,7 +940,7 @@
Table 5: cells spanning rows
</fo:block>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="48pt"/>
<fo:table-column column-width="48pt"/>
<fo:table-column column-width="48pt"/>
@@ -1054,7 +1054,7 @@
Table 6: table with header and multiple body's
</fo:block>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
@@ -1242,7 +1242,7 @@
Table 6: table with footer and multiple body's
</fo:block>
- <fo:table table-layout="fixed" width="100%">
+ <fo:table>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
diff --git a/examples/fo/tables/keep.fo b/examples/fo/tables/keep.fo
index 929ee760d..b369d7162 100644
--- a/examples/fo/tables/keep.fo
+++ b/examples/fo/tables/keep.fo
@@ -34,7 +34,7 @@
Table 1: basic keep with next
</fo:block>
- <fo:table border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -81,7 +81,7 @@
Table 1: basic keep with previous
</fo:block>
- <fo:table border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -128,7 +128,7 @@
Table 1: basic keep with next and keep with previous
</fo:block>
- <fo:table border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -192,7 +192,7 @@
Table 1: basic multiple keep with next after normal row
</fo:block>
- <fo:table border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -324,7 +324,7 @@
Table 1: basic multiple keep (next and previous) after normal row
</fo:block>
- <fo:table border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="6cm"/>
@@ -456,7 +456,7 @@
Table 1: basic multiple keep with next after normal row with normal row in middle
</fo:block>
- <fo:table border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="6cm"/>
diff --git a/examples/fo/tables/omit.fo b/examples/fo/tables/omit.fo
index 875afe77e..042f557ed 100644
--- a/examples/fo/tables/omit.fo
+++ b/examples/fo/tables/omit.fo
@@ -30,7 +30,7 @@
Table 1: with header
</fo:block>
- <fo:table table-omit-header-at-break="true" table-layout="fixed" width="100%">
+ <fo:table table-omit-header-at-break="true">
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
@@ -311,7 +311,7 @@
Table 2: with footer
</fo:block>
- <fo:table table-omit-footer-at-break="true" table-layout="fixed" width="100%">
+ <fo:table table-omit-footer-at-break="true">
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
@@ -592,7 +592,7 @@
Table 3: with header and footer and keeps
</fo:block>
- <fo:table table-omit-header-at-break="true" table-omit-footer-at-break="true" table-layout="fixed" width="100%">
+ <fo:table table-omit-header-at-break="true" table-omit-footer-at-break="true">
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
@@ -888,7 +888,7 @@
Table 6: table with multiple body's
</fo:block>
- <fo:table table-omit-header-at-break="true" table-layout="fixed" width="100%">
+ <fo:table table-omit-header-at-break="true">
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
@@ -1076,7 +1076,7 @@
Table 6: table with multiple body's
</fo:block>
- <fo:table table-omit-footer-at-break="true" table-layout="fixed" width="100%">
+ <fo:table table-omit-footer-at-break="true">
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="2cm"/>
diff --git a/examples/fo/tables/space.fo b/examples/fo/tables/space.fo
index e409720bb..c0562d8f9 100644
--- a/examples/fo/tables/space.fo
+++ b/examples/fo/tables/space.fo
@@ -30,7 +30,7 @@
Table 1: spaces around cells
</fo:block>
- <fo:table border-style="solid" border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table border-style="solid" border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -109,7 +109,7 @@
Table 2: spaces around rows
</fo:block>
- <fo:table border-style="solid" border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table border-style="solid" border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -190,7 +190,7 @@
Table 3: spaces around body
</fo:block>
- <fo:table border-style="solid" border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table border-style="solid" border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -281,7 +281,7 @@
</fo:block>
<fo:block border-style="solid" border-width="0.5pt">
- <fo:table space-before.optimum="5pt" border-style="solid" border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table space-before.optimum="5pt" border-style="solid" border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -309,7 +309,7 @@
</fo:block>
<fo:block border-style="solid" border-width="0.5pt">
- <fo:table padding-left="5pt" border-style="solid" border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table padding-left="5pt" border-style="solid" border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -337,7 +337,7 @@
</fo:block>
<fo:block border-style="solid" border-width="0.5pt">
- <fo:table padding-right="5pt" border-style="solid" border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table padding-right="5pt" border-style="solid" border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -365,7 +365,7 @@
</fo:block>
<fo:block border-style="solid" border-width="0.5pt">
- <fo:table space-after.optimum="5pt" border-style="solid" border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table space-after.optimum="5pt" border-style="solid" border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -397,7 +397,7 @@
</fo:block>
<fo:block border-style="solid" border-width="0.5pt">
- <fo:table space-after.optimum="20pt" border-style="solid" border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table space-after.optimum="20pt" border-style="solid" border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
@@ -462,7 +462,7 @@
</fo:block>
<fo:block border-style="solid" border-width="0.5pt">
- <fo:table space-after.optimum="5pt" border-style="solid" border-width="0.5pt" border-color="red" table-layout="fixed" width="100%">
+ <fo:table space-after.optimum="5pt" border-style="solid" border-width="0.5pt" border-color="red">
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
diff --git a/findbugs-exclude.xml b/findbugs-exclude.xml
index a764eac41..46879d1f6 100644
--- a/findbugs-exclude.xml
+++ b/findbugs-exclude.xml
@@ -1,15 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FindBugsFilter>
<Match>
- <Class name="org.apache.fop.fonts.truetype.TTFFile$1"/>
- <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/>
- </Match>
- <Match>
- <Class name="org.apache.fop.fonts.truetype.FontFileReader"/>
- <Method name="getAllBytes"/>
- <Bug pattern="EI_EXPOSE_REP"/>
- </Match>
- <Match>
<Class name="org.apache.fop.fo.properties.FontFamilyProperty"/>
<Bug pattern="EQ_DOESNT_OVERRIDE_EQUALS"/>
</Match>
@@ -959,6 +950,11 @@
<Bug pattern="RV_EXCEPTION_NOT_THROWN"/>
</Match>
<Match>
+ <Class name="org.apache.fop.hyphenation.HyphenationTreeCache"/>
+ <Method name="constructUserKey"/>
+ <Bug pattern="RV_RETURN_VALUE_IGNORED"/>
+ </Match>
+ <Match>
<Class name="org.apache.fop.afp.AFPResourceLevel"/>
<Method name="equals"/>
<Bug pattern="SA_FIELD_SELF_COMPARISON"/>
@@ -5166,41 +5162,4 @@
<Method name="getNonEmptyLevels"/>
<Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
</Match>
- <Match>
- <Class name="org.apache.fop.render.pdf.AbstractImageAdapter"/>
- <Method name="populateXObjectDictionaryForIndexColorModel"/>
- <Bug pattern="OS_OPEN_STREAM"/>
- </Match>
- <Match>
- <Class name="org.apache.fop.render.pdf.ImageRawPNGAdapter"/>
- <Or>
- <Method name="outputContents"/>
- <Method name="setup"/>
- </Or>
- <Or>
- <Bug pattern="OS_OPEN_STREAM"/>
- <Bug pattern="OS_OPEN_STREAM_EXCEPTION_PATH"/>
- </Or>
- </Match>
- <Match>
- <Class name="org.apache.fop.render.ps.ImageEncoderPNG"/>
- <Method name="writeTo"/>
- <Bug pattern="OS_OPEN_STREAM"/>
- </Match>
- <Match>
- <Or>
- <Class name="org.apache.fop.render.pdf.PDFImageHandlerRawPNG"/>
- <Class name="org.apache.fop.render.ps.PSImageHandlerRawPNG"/>
- </Or>
- <Method name="getSupportedImageFlavors"/>
- <Bug pattern="EI_EXPOSE_REP"/>
- </Match>
- <Match>
- <Class name="org.apache.fop.render.ps.PSImageHandlerRawPNG"/>
- <Or>
- <Method name="handleImage"/>
- <Method name="generateForm"/>
- </Or>
- <Bug pattern="BC_UNCONFIRMED_CAST"/>
- </Match>
</FindBugsFilter>
diff --git a/known-issues.xml b/known-issues.xml
index 622e6a79a..2ef4b7102 100644
--- a/known-issues.xml
+++ b/known-issues.xml
@@ -17,69 +17,75 @@
-->
<!-- $Id$ -->
<known-issues>
- <!-- NEED TO REVIEW ALL OF THE FOLLOWING
- <known-issue>
- MIF and SVG output support have not been restored, yet.
- </known-issue>
- <known-issue>
- RTF output is inferior to other output formats supported by FOP.
- For details, please see the "Output Targets" page of the release
- you're using.
- </known-issue>
- <known-issue>
- Auto table layout is not implemented, yet.
- </known-issue>
- <known-issue>
- Footnotes may overlap with text of the region-body in multi-column
- documents.
- </known-issue>
- <known-issue>
- Space resolution does not work between footnote regions.
- </known-issue>
- <known-issue>
- Block containers with no height currently don't create a fence for
- spaces as they should (they behave like a normal block).
- </known-issue>
- <known-issue>
- Preserved linefeeds in fo:character are not handled correctly.
- </known-issue>
- <known-issue>
- An empty block currently produces a fence for stacking constraints
- which it shouldn't.
- </known-issue>
- <known-issue>
- There are several small problems around white space handling.
- </known-issue>
- <known-issue>
- Images currently don't shrink so they fit on a page when they are
- too big and shrinking is allowed to happen.
- </known-issue>
- <known-issue>
- Inline container may not work as expected.
- </known-issue>
- <known-issue>
- The letter-spacing and word-spacing properties may not work as expected.
- </known-issue>
- <known-issue>
- Leaders with leader-pattern="use-content" may not work as expected.
- </known-issue>
- <known-issue>
- The keep-with-previous property doesn't work inside tables and lists, yet.
- </known-issue>
- <known-issue>
- If two consecutive pages don't have the same available width, the
- content currently isn't properly fit into the available space on
- the new page.
- </known-issue>
- <known-issue>
- Background images on page number citations are not placed correctly.
- </known-issue>
- <known-issue>
- Not all FO elements can be referenced by their "id", most notably:
- table-body, table-header, table-footer and table-row.
- </known-issue>
- <known-issue>
- Border and padding conditionality are not supported on table-cells, yet.
- </known-issue>
- -->
+ <known-issue>
+ MIF and SVG output support have not been restored, yet.
+ </known-issue>
+ <known-issue>
+ RTF output is inferior to other output formats supported by FOP.
+ For details, please see the "Output Targets" page of the release
+ you're using.
+ </known-issue>
+ <known-issue>
+ Auto table layout is not implemented, yet.
+ </known-issue>
+ <known-issue>
+ Footnotes may overlap with text of the region-body in multi-column
+ documents.
+ </known-issue>
+ <known-issue>
+ Space resolution does not work between footnote regions.
+ </known-issue>
+ <known-issue>
+ There's a problem involving nested block-containers and
+ reference-orientation 180/-180 (<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=36391">Bugzilla #36391</a>)
+ </known-issue>
+ <known-issue>
+ block-containers with no height currently don't create a fence for
+ spaces as they should (they behave like a normal block).
+ </known-issue>
+ <known-issue>
+ Preserved linefeeds in fo:character are not handled correctly.
+ </known-issue>
+ <known-issue>
+ An empty block currently produces a fence for stacking constraints
+ which it shouldn't.
+ </known-issue>
+ <known-issue>
+ There are several small problems around white space handling.
+ </known-issue>
+ <known-issue>
+ Images currently don't shrink so they fit on a page when they are
+ too big and shrinking is allowed to happen.
+ </known-issue>
+ <known-issue>
+ inline-container may not work as expected.
+ </known-issue>
+ <known-issue>
+ letter-spacing and word-spacing properties may not work as expected.
+ </known-issue>
+ <known-issue>
+ leaders with leader-pattern="use-content" may not work as expected.
+ </known-issue>
+ <known-issue>
+ keep-with-previous doesn't work inside tables and lists, yet.
+ </known-issue>
+ <known-issue>
+ If two consecutive pages don't have the same available width, the
+ content currently isn't properly fit into the available space on
+ the new page.
+ </known-issue>
+ <known-issue>
+ background-images on page-number-citations are not placed correctly.
+ </known-issue>
+ <known-issue>
+ Not all FO elements can be referenced by their "id", most notably:
+ table-body, table-header, table-footer and table-row.
+ </known-issue>
+ <known-issue>
+ Border and padding conditionality are not supported on table-cells, yet.
+ </known-issue>
+ <known-issue>
+ Column balancing in multi-column documents may not work as expected
+ (<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=36356">Bugzilla #36356</a>)
+ </known-issue>
</known-issues>
diff --git a/lib/xmlgraphics-commons-1.5rc1.jar b/lib/xmlgraphics-commons-1.5rc1.jar
deleted file mode 100644
index 03cf5b3d6..000000000
--- a/lib/xmlgraphics-commons-1.5rc1.jar
+++ /dev/null
Binary files differ
diff --git a/lib/xmlgraphics-commons-1.5svn.jar b/lib/xmlgraphics-commons-1.5svn.jar
new file mode 100644
index 000000000..d8c5e0989
--- /dev/null
+++ b/lib/xmlgraphics-commons-1.5svn.jar
Binary files differ
diff --git a/src/documentation/content/.htaccess b/src/documentation/content/.htaccess
index 0edc84f75..b020b2422 100644
--- a/src/documentation/content/.htaccess
+++ b/src/documentation/content/.htaccess
@@ -1,27 +1,27 @@
# redirect moved files
-RedirectMatch Permanent ^/fop/anttask(.*) http://xmlgraphics.apache.org/fop/1.1rc1/anttask$1
-RedirectMatch Permanent ^/fop/compiling(.*) http://xmlgraphics.apache.org/fop/1.1rc1/compiling$1
-RedirectMatch Permanent ^/fop/configuration(.*) http://xmlgraphics.apache.org/fop/1.1rc1/configuration$1
-RedirectMatch Permanent ^/fop/embedding(.*) http://xmlgraphics.apache.org/fop/1.1rc1/embedding$1
-RedirectMatch Permanent ^/fop/extensions(.*) http://xmlgraphics.apache.org/fop/1.1rc1/extensions$1
-RedirectMatch Permanent ^/fop/fonts(.*) http://xmlgraphics.apache.org/fop/1.1rc1/fonts$1
-RedirectMatch Permanent ^/fop/graphics(.*) http://xmlgraphics.apache.org/fop/1.1rc1/graphics$1
-RedirectMatch Permanent ^/fop/hyphenation(.*) http://xmlgraphics.apache.org/fop/1.1rc1/hyphenation$1
-RedirectMatch Permanent ^/fop/intermediate(.*) http://xmlgraphics.apache.org/fop/1.1rc1/intermediate$1
-RedirectMatch Permanent ^/fop/output(.*) http://xmlgraphics.apache.org/fop/1.1rc1/output$1
-RedirectMatch Permanent ^/fop/pdfa(.*) http://xmlgraphics.apache.org/fop/1.1rc1/pdfa$1
-RedirectMatch Permanent ^/fop/pdfencryption(.*) http://xmlgraphics.apache.org/fop/1.1rc1/pdfencryption$1
-RedirectMatch Permanent ^/fop/pdfx(.*) http://xmlgraphics.apache.org/fop/1.1rc1/pdfx$1
-RedirectMatch Permanent ^/fop/running(.*) http://xmlgraphics.apache.org/fop/1.1rc1/running$1
-RedirectMatch Permanent ^/fop/servlets(.*) http://xmlgraphics.apache.org/fop/1.1rc1/servlets$1
-RedirectMatch Permanent ^/fop/upgrading(.*) http://xmlgraphics.apache.org/fop/1.1rc1/upgrading$1
+RedirectMatch Permanent ^/fop/anttask(.*) http://xmlgraphics.apache.org/fop/1.0/anttask$1
+RedirectMatch Permanent ^/fop/compiling(.*) http://xmlgraphics.apache.org/fop/1.0/compiling$1
+RedirectMatch Permanent ^/fop/configuration(.*) http://xmlgraphics.apache.org/fop/1.0/configuration$1
+RedirectMatch Permanent ^/fop/embedding(.*) http://xmlgraphics.apache.org/fop/1.0/embedding$1
+RedirectMatch Permanent ^/fop/extensions(.*) http://xmlgraphics.apache.org/fop/1.0/extensions$1
+RedirectMatch Permanent ^/fop/fonts(.*) http://xmlgraphics.apache.org/fop/1.0/fonts$1
+RedirectMatch Permanent ^/fop/graphics(.*) http://xmlgraphics.apache.org/fop/1.0/graphics$1
+RedirectMatch Permanent ^/fop/hyphenation(.*) http://xmlgraphics.apache.org/fop/1.0/hyphenation$1
+RedirectMatch Permanent ^/fop/intermediate(.*) http://xmlgraphics.apache.org/fop/1.0/intermediate$1
+RedirectMatch Permanent ^/fop/output(.*) http://xmlgraphics.apache.org/fop/1.0/output$1
+RedirectMatch Permanent ^/fop/pdfa(.*) http://xmlgraphics.apache.org/fop/1.0/pdfa$1
+RedirectMatch Permanent ^/fop/pdfencryption(.*) http://xmlgraphics.apache.org/fop/1.0/pdfencryption$1
+RedirectMatch Permanent ^/fop/pdfx(.*) http://xmlgraphics.apache.org/fop/1.0/pdfx$1
+RedirectMatch Permanent ^/fop/running(.*) http://xmlgraphics.apache.org/fop/1.0/running$1
+RedirectMatch Permanent ^/fop/servlets(.*) http://xmlgraphics.apache.org/fop/1.0/servlets$1
+RedirectMatch Permanent ^/fop/upgrading(.*) http://xmlgraphics.apache.org/fop/1.0/upgrading$1
# redirect to versioned documentation
# Current stable release
Redirect Temp /fop/stable http://xmlgraphics.apache.org/fop/1.0
# Current unstable release (or trunk if no beta is the latest release)
-Redirect Temp /fop/unstable http://xmlgraphics.apache.org/fop/1.1rc1
+Redirect Temp /fop/unstable http://xmlgraphics.apache.org/fop/trunk
# Latest release
Redirect Temp /fop/current http://xmlgraphics.apache.org/fop/1.0
diff --git a/src/documentation/content/doap.rdf b/src/documentation/content/doap.rdf
index 7ce3d6d58..8ccd82bf6 100644
--- a/src/documentation/content/doap.rdf
+++ b/src/documentation/content/doap.rdf
@@ -15,6 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<?xml-stylesheet type="text/xsl" href="../xsl/p2.xsl"?>
<rdf:RDF xml:lang="en"
xmlns="http://usefulinc.com/ns/doap#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
@@ -75,25 +76,18 @@
</asfext:implements>
<release>
<Version>
- <name>Upcoming release (candidate)</name>
- <created>2012-07-02</created>
- <revision>1.1rc1</revision>
+ <name>Previous stable release</name>
+ <created>2008-08-05</created>
+ <revision>0.95</revision>
</Version>
</release>
<release>
<Version>
- <name>Current release (stable)</name>
+ <name>Latest stable release</name>
<created>2010-07-21</created>
<revision>1.0</revision>
</Version>
</release>
- <release>
- <Version>
- <name>Previous release (stable)</name>
- <created>2008-08-05</created>
- <revision>0.95</revision>
- </Version>
- </release>
<repository>
<SVNRepository>
<location rdf:resource="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/"/>
diff --git a/src/documentation/content/xdocs/1.1rc1/accessibility.xml b/src/documentation/content/xdocs/1.1rc1/accessibility.xml
deleted file mode 100644
index 412519d8b..000000000
--- a/src/documentation/content/xdocs/1.1rc1/accessibility.xml
+++ /dev/null
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP: Accessibility</title>
- </header>
- <body>
- <section id="overview">
- <title>Overview</title>
- <p>
- This page describes the
- <a href="http://en.wikipedia.org/wiki/Accessibility">accessibility</a>
- features of Apacheâ„¢ FOP.
- <a href="http://www.section508.gov/">Section 508</a> defines accessibility in the context
- of electronic documents for the USA but other countries have similar requirements.
- </p>
- <p>
- Accessibility features are available only for the PDF output format and there are some
- implementation limitations. Also, certain actions must be undertaken by the content creator
- to ensure that FOP can create a truly accessible document.
- </p>
- </section>
- <section>
- <title>Enabling accessibility</title>
- <p>There are 3 ways to enable accessibility:</p>
- <ol>
- <li>
- <strong>Command line:</strong> The command line option -a turns on accessibility:
- <code>fop -a -fo mydocument.fo -pdf mydocument.pdf</code>
- </li>
- <li>
- <strong>Embedding:</strong> <code>userAgent.setAccessibility(true);</code>
- </li>
- <li>
- <strong>Optional setting in fop.xconf file:</strong>
- <pre>
- &lt;fop version="1.0"&gt;
- &lt;accessibility&gt;true&lt;/accessibility&gt;
- ...
- &lt;/fop&gt;
- </pre>
- </li>
- </ol>
- <p>
- When accessibility is enabled, additional information relating to the logical structure of
- the document is added to the PDF. That information allows the PDF viewer (or a
- text-to-speech application) to retrieve the natural reading order of the document.
- </p>
- <note>The processing of the logical structure is memory-hungry. You may need to adjust the
- Java heap size in order to process larger files.</note>
- </section>
- <section id="source">
- <title>Changes to your XSL-FO input files</title>
- <p>
- Apache FOP cannot automatically generate accessible PDFs. Some of the work can only be
- performed by the content provider. Following are some changes that may be necessary to
- your XSL-FO content in order to generate really accessible documents:
- </p>
- <ul>
- <li>Table cells must have a table row as their parent.</li>
- <li>
- Images must have an alternate text: use the <code>fox:alt-text</code> extension attribute
- (in the <a href="extensions.html#fox-namespace">fox namespace</a>) on
- <code>fo:external-graphic</code> and <code>fo:instream-foreign-object</code> to specify a
- short text describing the image.
- </li>
- <li>
- Ensure that the order of <code>fo:block-container</code> elements in a page corresponds to
- the reading order.
- </li>
- <li>
- Specify the natural language of the document using the language and country properties
- (or via the <code>xml:lang</code> shorthand property).
- </li>
- </ul>
- </section>
- <section id="customTags">
- <title>Customized Tagging</title>
- <p>The <a href="#PDFReference">PDF Reference</a> defines a set of standard Structure Types to
- tag content. For example, ‘P’ is used for identifying paragraphs, ‘H1’ to ‘H6’ for headers,
- ‘L’ for lists, ‘Div’ for block-level groups of elements, etc. This standard set is aimed at
- improving interoperability between applications producing or consuming PDF. </p>
- <p>FOP provides a default mapping of Formatting Objects to elements from that standard set.
- For example, <code>fo:page-sequence</code> is mapped to ‘Part’, <code>fo:block</code> is
- mapped to ‘P’, <code>fo:list-block</code> to ‘L’, etc.</p>
- <p>You may want to customize that mapping to improve the accuracy of the tagging or deal with
- particular FO constructs. For example, you may want to make use of the ‘H1’ to ‘H6’ tags to
- make the hierarchical structure of the document appear in the PDF. This is achieved by using
- the <code>role</code> XSL-FO property:</p>
- <source>...
-&lt;fo:block role="H1" font-weight="bold"&gt;I. A Level 1 Heading&lt;/fo:block&gt;
-&lt;fo:block&gt;This is the first paragraph of the first section...&lt;/fo:block&gt;
-...</source>
- <p>If a non-standard structure type is specified, FOP will issue a warning and fall back to
- the default tag associated to the Formatting Object.</p>
- </section>
- <section id="testing">
- <title>Testing</title>
- <p>
- Accessible PDFs can be tested, for example, using Adobe Acrobat Professional. Its
- Accessibility Check feature creates a report indicating any deficiencies with a PDF
- document. Alternatively, you can just let a screen reader read the document aloud.
- </p>
- </section>
- <section id="limitations">
- <title>Limitations</title>
- <p>
- Accessibility support in Apache FOP is relatively new, so there are certain
- limitations. Please help us identify and close any gaps.
- </p>
- <ul>
- <li>
- The natural language can currently only be specified at the page-sequence level. The
- document language is derived from the language of the first page-sequence. It is
- currently not possible to override the language inside the content below the
- page-sequence level.
- </li>
- <li>
- It's currently not possible to specify the expanded form of an abbreviation or acronym.
- </li>
- <li>
- SVG graphics (or images in general) are treated as a single figure. Text contained in
- SVGs is not accessible. It's only possible to work with <code>fox:alt-text</code>.
- </li>
- <li>
- The side regions (region-before, region-after etc.) are currently not specially
- identified. Screen readers may read their content at page changes.
- </li>
- </ul>
- </section>
- <section id="links">
- <title>Related Links</title>
- <p>
- Many resources providing guidance about creating accessible documents can be found on the
- web. Here are a few links, along with additional resources around the topic:
- </p>
- <ul>
- <li><a href="http://www.section508.gov/">US Government - Website on Section 508</a></li>
- <li><a href="http://en.wikipedia.org/wiki/Accessibility">Wikipedia on Accessibility in general</a></li>
- <li><a href="http://en.wikipedia.org/wiki/Portable_Document_Format#Accessibility">Wikipedia on Accessibility in PDF</a></li>
- <li id="PDFReference">
- <a href="http://partners.adobe.com/public/developer/en/pdf/PDFReference.pdf">PDF
- Reference 1.4</a> (look up chapters 9.7 "Tagged PDF" and 9.8 "Accessibility Support")
- </li>
- <li><a href="pdfa.html">PDF/A support in Apache FOP</a></li>
- <li><a href="http://wiki.apache.org/xmlgraphics-fop/PDF_Accessibility">Developer-oriented details on the accessibility features (on the Wiki)</a></li>
- </ul>
- </section>
- </body>
-</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1rc1/anttask.xml b/src/documentation/content/xdocs/1.1rc1/anttask.xml
deleted file mode 100644
index ba53fe7d1..000000000
--- a/src/documentation/content/xdocs/1.1rc1/anttask.xml
+++ /dev/null
@@ -1,236 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP: Ant task</title>
- <version>$Revision$</version>
- </header>
- <body>
- <p>
- Apacheâ„¢ FOP provides an Ant task for automating the document build process.
- </p>
- <section id="basics">
- <title>Description</title>
- <p>
- The FOP Ant task will convert XSL-FO documents to PDF, PS, PCL etc. output
- (see <a href="output.html">Output formats</a> for available formats).
- </p>
- <p>
- To call FOP tasks within Ant, first add a FOP task definition to your Ant build file.
- One method of defining the task is as follows:
- </p>
- <source><![CDATA[
-<property name="fop.home" value="....path to your FOP HOME directory..."/>
-
-<taskdef name="fop"
- classname="org.apache.fop.tools.anttasks.Fop">
- <classpath>
- <fileset dir="${fop.home}/lib">
- <include name="*.jar"/>
- </fileset>
- <fileset dir="${fop.home}/build">
- <include name="fop.jar"/>
- <include name="fop-hyph.jar" />
- </fileset>
- </classpath>
-</taskdef>
- ]]></source>
-<p>
- Then create FOP tasks within your Ant build file, using the FOP task parameters listed below.</p>
- </section>
- <!-- TODO: Installation/Configuration -->
- <section id="parameters"><title>Parameters for FOP Ant task</title>
- <table><caption>Parameters specified as attributes</caption>
- <tr>
- <th>Attribute</th>
- <th>Description</th>
- <th>Required</th>
- </tr>
- <tr>
- <td>fofile</td>
- <td>XSL-FO file to be rendered</td>
- <td>Yes, if no fileset nested element is used</td>
- </tr>
- <tr>
- <td>xmlfile</td>
- <td>XML input file</td>
- <td>Yes, if no fofile is specified</td>
- </tr>
- <tr>
- <td>xsltfile</td>
- <td>XSLT input file</td>
- <td>Yes, if no fofile is specified</td>
- </tr>
- <tr>
- <td>outfile</td>
- <td>Output filename</td>
- <td>Yes, when fofile is used. (This attribute is not valid for filesets.)</td>
- </tr>
- <tr>
- <td>format</td>
- <td>Possible output formats:<br/>
- <code>application/X-fop-awt-preview</code><br/>
- <code>application/X-fop-print</code><br/>
- <code>application/X-fop-areatree</code><br/>
- <code>application/pdf</code><br/>
- <code>application/postscript</code><br/>
- <code>application/mif</code><br/>
- <code>application/rtf</code>,
- <code>text/richtext</code>,
- <code>text/rtf</code><br/>
- <code>application/x-pcl</code>,
- <code>application/vnd.hp-PCL</code><br/>
- <code>application/x-afp</code>,
- <code>application/vnd.ibm.modcap</code><br/>
- <code>text/plain</code><br/>
- <code>image/svg+xml</code><br/>
- <code>image/gif</code><br/>
- <code>image/png</code><br/>
- <code>image/tiff</code><br/>
- </td>
- <td>No, defaults to <code>application/pdf</code></td>
- </tr>
- <tr>
- <td>outdir</td>
- <td>Output directory</td>
- <td>Required if a fileset is used to specify the files to render; optional for fofile. (Can alternatively specify the full path in the fofile value.)</td>
- </tr>
- <tr>
- <td>force</td>
- <td>Recreate target files, even if they are newer than their corresponding
- source files. Note: This attribute is available in post-0.20.5
- versions (0.20.x nightly build and 1.0dev) only; target files are
- always generated (i.e., force=true) in 0.20.5 release.
- </td>
- <td>No, default is <code>false</code></td>
- </tr>
- <tr>
- <td>basedir</td>
- <td>Base directory to resolve relative references (e.g., graphics files) within the
- FO document.
- </td>
- <td>No, for single FO File entry, default is to use the location
- of that FO file.
- </td>
- </tr>
- <tr>
- <td>relativebase</td>
- <td>For fileset usage only. A value of <code>true</code> specifies using the location
- of each .fo file as the base directory for resolving relative file references located
- within that .fo file. A value of <code>false</code> specifies using the value of
- basedir for all files within the fileset, or just the current working directory
- if basedir is not specified.
- </td>
- <td>No, default is <code>false</code>.
- </td>
- </tr>
- <tr>
- <td>userconfig</td>
- <td>User configuration file (same as the FOP "-c" command line option).</td>
- <td>No</td>
- </tr>
- <tr>
- <td>messagelevel</td>
- <td>Logging level<br/>
- Possible values: <code>error</code>, <code>warn</code>, <code>info</code>, <code>verbose</code>, <code>debug</code>. <strong>Currently doesn't work in FOP Trunk!!!</strong></td>
- <td>No, defaults to <code>verbose</code></td>
- </tr>
- <tr>
- <td>logFiles</td>
- <td>Controls whether the names of the files that are processed are logged
- (<code>true</code>) or not (<code>false</code>). <strong>Currently doesn't work in FOP Trunk!!!</strong></td>
- <td>No, default is <code>true</code></td>
- </tr>
- <tr>
- <td>throwexceptions</td>
- <td>Controls whether or not an exception is thrown if an error occurs during rendering.</td>
- <td>Default is <code>true</code></td>
- </tr>
- </table>
- <p/>
- <table><caption>Parameters specified as nested elements</caption>
- <tr>
- <th>Attribute</th>
- <th>Description</th>
- <th>Required</th>
- </tr>
- <tr>
- <td>fileset</td>
- <td><a href="http://ant.apache.org/manual/CoreTypes/fileset.html">FileSets</a>
- are used to specify multiple XSL-FO files to be rendered.</td>
- <td>Yes, if no fofile attribute is supplied</td>
- </tr>
- </table>
- </section>
- <section id="examples">
- <title>Examples</title>
- <p>
- The following example converts a single XSL-FO file to a PDF document:
- </p>
-
- <source><![CDATA[
-<target name="generate-pdf" description="Generates a single PDF file">
- <fop format="application/pdf"
- fofile="c:\working\foDirectory\foDocument.fo"
- outfile="c:\working\pdfDirectory\pdfDocument.pdf" />
-</target>
- ]]></source>
- <p>
- This example converts all XSL-FO files within an entire directory to PostScript:
- </p>
- <source><![CDATA[
-<target name="generate-multiple-ps"
- description="Generates multiple PostScript files">
- <fop format="application/postscript"
- outdir="${build.dir}" messagelevel="debug">
- <fileset dir="${fo.examples.dir}">
- <include name="*.fo"/>
- </fileset>
- </fop>
-</target>
- ]]></source>
- <p>
- The following example transforms and converts a single XML and XSLT file to an AFP document:
- </p>
- <source><![CDATA[
-<target name="generate-afp-from-transform" description="Generates a single AFP file from an XSLT stylesheet">
- <fop format="application/x-afp"
- xmlfile="c:\working\foDirectory\Document.xml"
- xsltfile="c:\working\foDirectory\Document.xslt"
- outfile="c:\working\afpDirectory\Document.afp" />
-</target>
- ]]></source>
- <p>
- This example transforms and converts all XML files within an entire directory to PostScript:
- </p>
- <source><![CDATA[
-<target name="generate-multiple-ps-from-transform" description="Generates multiple PostScript files using an XSLT stylesheet">
- <fop format="application/postscript"
- xsltfile="c:\working\foDirectory\Document.xslt"
- outdir="${build.dir}" messagelevel="debug">
- <fileset dir="${test.dir}">
- <include name="*.xml"/>
- </fileset>
- </fop>
-</target>
- ]]></source>
- </section>
- </body>
-</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1rc1/compiling.xml b/src/documentation/content/xdocs/1.1rc1/compiling.xml
deleted file mode 100644
index 7bfa165b5..000000000
--- a/src/documentation/content/xdocs/1.1rc1/compiling.xml
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP: Building from Source Code</title>
- <version>$Revision$</version>
- </header>
- <body>
- <section id="build-needed">
- <title>Do You Need To Build?</title>
-<!-- text for released versions -->
-<!-- <p>
- FOP distributions are either pre-compiled binary or source.
- If you are using a binary distribution, it is already built and there is no need to build it again.
- See the <a href="../download.html">Download Instructions</a> for information about whether a
- binary or source distribution is best for your needs.
- </p>-->
-<!-- /text for released versions -->
-<!-- text for trunk -->
- <p>
- Apacheâ„¢ FOP snapshots are either pre-compiled binary or source.
- If you are using a binary snapshot, it is already built and there is no need to build it again.
- If you got the source code from a repository snapshot or via Subversion you will need to build FOP.
- See the <a href="../download.html">Download Instructions</a> for information about where to obtain binary or repository snapshots, and whether a
- binary or source snapshot is best for your needs.
- </p>
-<!-- /text for trunk -->
- </section>
- <section id="env">
- <title>Set Up Your Environment</title>
- <section id="env-jdk">
- <title>JDK</title>
- <p>
- Building FOP requires a minimum Java Development Kit (JDK/SDK) of 1.4
- (A Java Runtime Environment is not sufficient).
- </p>
- </section>
- <section id="env-classpath">
- <title>CLASSPATH</title>
- <p>
- There is generally no need to setup a classpath. All libraries needed to compile FOP are included
- in the source distribution and are referenced by the build script.
- You will only need to adjust the classpath if you build FOP in some other way. See the build
- script build.xml for details.
- </p>
- </section>
- <section id="env-java-home">
- <title>JAVA_HOME</title>
- <p>
- The build script uses <a href="ext:ant">Apache Ant</a>, a popular
- Java-based build tool, which usually requires that the environment variable JAVA_HOME point to
- your local JDK root directory. This is true even if you use JDK 1.4 or above, which normally
- does not need this setting.
- </p>
- </section>
- <section id="env-ant">
- <title>Apache Ant</title>
- <p>
- <a href="ext:ant">Apache Ant</a> (Version 1.7 or later) must be installed in order to
- build FOP. Following best practices we don't include Ant with FOP anymore. You can find the
- <a href="ext:ant/manual/">instructions to install Ant in the Ant manual</a> on the web.
- </p>
- </section>
- </section>
- <section id="build-script">
- <title>Run the Build Script</title>
- <p>
- Change to the FOP root directory and build FOP by executing the build script (build.xml)
- using the "ant" command.
- </p>
- <note>
- The "ant" command is only available on your system if you've properly
- <a href="ext:ant/manual/">installed Apache Ant</a> and added Ant's location to the PATH
- environment variable.
- </note>
- <p>
- The file build.xml in the FOP root directory is the blueprint that Ant uses for the build. It
- contains information for numerous build targets, many of which are building blocks to more
- useful target, and others which are primarily used by the FOP developers.
- You may benefit from looking through this file to learn more about the various build targets.
- To obtain a complete list of useful build targets:
- </p>
- <source>ant -projecthelp</source>
- <p>The most useful targets are:</p>
- <ul>
- <li>
- <strong>package</strong>: Generates the JAR files (default). This is the normal build that
- produces a jar file usable for running FOP.
- </li>
- <li>
- <strong>clean </strong>: Cleans the build directory. This is useful for making sure that
- any build errors are cleaned up before starting a new build. It should not ordinarily be
- needed, but may be helpful if you are having problems with the build process itself.
- </li>
- <li>
- <strong>javadocs</strong>: Creates the FOP API documentation.
- <note>A minimum JDK version of 1.4.2 is required for generating the javadocs.</note>
- </li>
- </ul>
- <p>To run the build:</p>
- <source>ant [target ...]</source>
- <p>For example to do a normal build for the "all" target (which is the default):</p>
- <source>ant</source>
- <p>OR</p>
- <source>ant all</source>
- <p>To clean the build directory first:</p>
- <source>ant clean all</source>
- <note>
- If you want to shorten the build time you can just call the "package" target which
- doesn't perform any automated tests during the build.
- </note>
- </section>
- <section id="problems">
- <title id="Troubleshooting">Troubleshooting</title>
- <p>If you have problems building FOP, please try the following:</p>
- <ul>
- <li>Run the build with the target of "clean", then rerun the build.</li>
- <li>Delete the build directory completely, then rerun the build.</li>
- <li>
- Make sure you do not have a non-FOP version of xerces.jar, xalan.jar, batik.jar,
- or another dependency product somewhere in your CLASSPATH.
- </li>
- <li>
- If the build still fails, see the <a href="../gethelp.html">Getting Help</a>
- page for further help.
- </li>
- </ul>
- </section>
- </body>
-</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1rc1/complexscripts.xml b/src/documentation/content/xdocs/1.1rc1/complexscripts.xml
deleted file mode 100644
index 697205531..000000000
--- a/src/documentation/content/xdocs/1.1rc1/complexscripts.xml
+++ /dev/null
@@ -1,694 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP: Complex Scripts</title>
- </header>
- <body>
- <section id="overview">
- <title>Overview</title>
- <p>
- This page describes the
- <link href="http://en.wikipedia.org/wiki/Complex_scripts">complex scripts</link>
- features of Apacheâ„¢ FOP, which include:
- </p>
- <ul>
- <li>Support for languages written with right-to-left scripts, such as Arabic and Hebrew scripts.</li>
- <li>Support for languages written with South Asian and Southeast Asian scripts, such as Devanagari,
- Khmer, Tamil, Thai, and others.</li>
- <li>Support for advanced substitution, reordering, and positioning of glyphs according to language
- and script sensitive rules.</li>
- <li>Support for advanced number to string formatting.</li>
- </ul>
- </section>
- <section>
- <title>Disabling complex scripts</title>
- <p>Complex script features are enabled by default. If some application of FOP does not
- require this support, then it can be disabled in three ways:</p>
- <ol>
- <li>
- <strong>Command line:</strong> The command line option <code>-nocs</code> turns off complex script
- features: <code>fop -nocs -fo mydocument.fo -pdf mydocument.pdf</code>
- </li>
- <li>
- <strong>Embedding:</strong> <code>userAgent.setComplexScriptFeaturesEnabled(false);</code>
- </li>
- <li>
- <strong>Optional setting in fop.xconf file:</strong>
- <pre>
-&lt;fop version="1.0"&gt;
- &lt;complex-scripts disabled="true"/&gt;
- ...
-&lt;/fop&gt;
- </pre>
- </li>
- </ol>
- <p>
- When complex scripts features are enabled, additional information related to bidirectional
- level resolution, the association between characters and glyphs, and glyph position adjustments
- are added to the internal, parsed representation of the XSL-FO tree and its corresponding
- formatted area tree. This additional information will somewhat increase the memory requirements for
- processing documents that use these features.
- </p>
- <note>A document author need not make explicit use of any complex scripts feature in order
- for this additional information to be created. For example, if the author makes use of a font
- that contains OpenType GSUB and/or GPOS tables, then those tables will be automatically used
- unless complex scripts features are disabled.</note>
- </section>
- <section id="source">
- <title>Changes to your XSL-FO input files</title>
- <p>
- In most circumstances, XSL-FO content does not need to change in order to make use of
- complex scripts features; however, in certain contexts, fully automatic processing is not
- sufficient. In these cases, an author may make use of the following XSL-FO constructs:
- </p>
- <ul>
- <li>The <link href="http://www.w3.org/TR/2006/REC-xsl11-20061205/#script"><code>script</code></link> property.</li>
- <li>The <link href="http://www.w3.org/TR/2006/REC-xsl11-20061205/#language"><code>language</code></link> property.</li>
- <li>The <link href="http://www.w3.org/TR/2006/REC-xsl11-20061205/#writing-mode"><code>writing-mode</code></link> property.</li>
- <li>The number to string conversion properties:
- <link href="http://www.w3.org/TR/2006/REC-xsl11-20061205/#format"><code>format</code></link>,
- <link href="http://www.w3.org/TR/2006/REC-xsl11-20061205/#grouping-separator"><code>grouping-separator</code></link>,
- <link href="http://www.w3.org/TR/2006/REC-xsl11-20061205/#grouping-size"><code>grouping-size</code></link>,
- <link href="http://www.w3.org/TR/2006/REC-xsl11-20061205/#letter-value"><code>letter-value</code></link>,
- and <code>fox:number-conversion-features</code>.</li>
- <li>The <link href="http://www.w3.org/TR/2006/REC-xsl11-20061205/#fo_bidi-override"><code>fo:bidi-override</code></link> element.</li>
- <li>Explicit bidirectional control characters: U+200E LRM, U+200F RLM, U+202A LRE,
- U+202B RLE, U+202C PDF, U+202D LRO, U+202E RLO.</li>
- <li>Explicit join control characters: U+200C ZWNJ and U+200D ZWJ.</li>
- </ul>
- </section>
- <section id="details">
- <title>Authoring Details</title>
- <p>The complex scripts related effects of the above enumerated XSL-FO constructs are more
- fully described in the following sub-sections.</p>
- <section id="script_property">
- <title>Script Property</title>
- <p>In order to apply font specific complex script features, it is necessary to know
- the script that applies to the text undergoing layout processing. This script is determined
- using the following algorithm:
- </p>
- <ol>
- <li>If the FO element that governs the text specifies a
- <link href="http://www.w3.org/TR/2006/REC-xsl11-20061205/#script"><code>script</code></link>
- property and its value is not the empty string or <code>"auto"</code>, then that script is used.</li>
- <li>Otherwise, the dominant script of the text is determined automatically by finding the
- script whose constituent characters appear most frequently in the text.</li>
- </ol>
- <p>In case the automatic algorithm does not produce the desired results, an author may
- explicitly specify a <code>script</code> property with the desired script. If specified,
- it must be one of the four-letter script code specified in
- <link href="http://unicode.org/iso15924/iso15924-codes.html">ISO 15924 Code List</link> or
- in the <link href="#extended_script_codes">Extended Script Codes</link> table. Comparison
- of script codes is performed in a case-insensitive manner, so it does not matter what case
- is used when specifying these codes in an XSL-FO document.</p>
- <section id="standard_script_codes">
- <title>Standard Script Codes</title>
- <p>The following table enumerates the standard ISO 15924 4-letter codes recognized by FOP.</p>
- <table class="ForrestTable tw30">
- <tr>
- <th style="text-align:center">Code</th>
- <th style="text-align:left">Script</th>
- </tr>
- <tr>
- <td style="text-align:center"><code>arab</code></td>
- <td>Arabic</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>beng</code></td>
- <td>Bengali</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>bopo</code></td>
- <td>Bopomofo</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>cyrl</code></td>
- <td>Cyrillic</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>deva</code></td>
- <td>Devanagari</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>ethi</code></td>
- <td>Ethiopic</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>geor</code></td>
- <td>Georgian</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>grek</code></td>
- <td>Greek</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>gujr</code></td>
- <td>Gujarati</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>guru</code></td>
- <td>Gurmukhi</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>hang</code></td>
- <td>Hangul</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>hani</code></td>
- <td>Han</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>hebr</code></td>
- <td>Hebrew</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>hira</code></td>
- <td>Hiragana</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>kana</code></td>
- <td>Katakana</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>knda</code></td>
- <td>Kannada</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>khmr</code></td>
- <td>Khmer</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>laoo</code></td>
- <td>Lao</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>latn</code></td>
- <td>Latin</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>mlym</code></td>
- <td>Malayalam</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>mymr</code></td>
- <td>Burmese</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>mong</code></td>
- <td>Mongolian</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>orya</code></td>
- <td>Oriya</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>sinh</code></td>
- <td>Sinhalese</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>taml</code></td>
- <td>Tamil</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>telu</code></td>
- <td>Telugu</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>thai</code></td>
- <td>Thai</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>tibt</code></td>
- <td>Tibetan</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>zmth</code></td>
- <td>Math</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>zsym</code></td>
- <td>Symbol</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>zyyy</code></td>
- <td>Undetermined</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>zzzz</code></td>
- <td>Uncoded</td>
- </tr>
- </table>
- </section>
- <section id="extended_script_codes">
- <title>Extended Script Codes</title>
- <p>The following table enumerates a number of non-standard extended script codes recognized by FOP.</p>
- <table class="ForrestTable tw70">
- <colgrp>
- <col style="width:10%"/>
- <col style="width:20%"/>
- <col style="width:80%"/>
- </colgrp>
- <tr>
- <th>Code</th>
- <th>Script</th>
- <th>Comments</th>
- </tr>
- <tr>
- <td style="text-align:center"><code>bng2</code></td>
- <td>Bengali</td>
- <td>OpenType Indic Version 2 (May 2008 and following) behavior.</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>dev2</code></td>
- <td>Devanagari</td>
- <td>OpenType Indic Version 2 (May 2008 and following) behavior.</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>gur2</code></td>
- <td>Gurmukhi</td>
- <td>OpenType Indic Version 2 (May 2008 and following) behavior.</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>gjr2</code></td>
- <td>Gujarati</td>
- <td>OpenType Indic Version 2 (May 2008 and following) behavior.</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>knd2</code></td>
- <td>Kannada</td>
- <td>OpenType Indic Version 2 (May 2008 and following) behavior.</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>mlm2</code></td>
- <td>Malayalam</td>
- <td>OpenType Indic Version 2 (May 2008 and following) behavior.</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>ory2</code></td>
- <td>Oriya</td>
- <td>OpenType Indic Version 2 (May 2008 and following) behavior.</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>tml2</code></td>
- <td>Tamil</td>
- <td>OpenType Indic Version 2 (May 2008 and following) behavior.</td>
- </tr>
- <tr>
- <td style="text-align:center"><code>tel2</code></td>
- <td>Telugu</td>
- <td>OpenType Indic Version 2 (May 2008 and following) behavior.</td>
- </tr>
- </table>
- <warning>
- Explicit use of one of the above extended script codes is not portable,
- and should be limited to use with FOP only.
- </warning>
- <note>
- When performing automatic script determination, FOP selects the OpenType Indic
- Version 2 script codes by default. If the author requires Version 1 behavior, then
- an explicit, non-extension script code should be specified in a governing <code>script</code>
- property.
- </note>
- </section>
- </section>
- <section id="language_property">
- <title>Language Property</title>
- <p>Certain fonts that support complex script features can make use of language information in order for
- language specific processing rules to be applied. For example, a font designed for the Arabic script may support
- typographic variations according to whether the written language is Arabic, Farsi (Persian), Sindhi, Urdu, or
- another language written with the Arabic script. In order to apply these language specific features, the author
- may explicitly mark the text with a <link href="http://www.w3.org/TR/2006/REC-xsl11-20061205/#language"><code>language</code></link>
- property.</p>
- <p>When specifying the <code>language</code> property, the value of the property must be either an
- <link href="http://en.wikipedia.org/wiki/List_of_ISO_639-2_codes">ISO639-2 3-letter code</link> or an
- <link href="http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes">ISO639-1 2-letter code</link>. Comparison of language
- codes is performed in a case-insensitive manner, so it does not matter what case is used when specifying these
- codes in an XSL-FO document.</p>
- </section>
- <section id="writing_mode_property">
- <title>Writing Mode Property</title>
- <p>The <code>writing-mode</code> property is used to determine the axes and direction of the inline
- progression direction, the block progression direction, the column progression direction (in tables
- and flows), the shift direction, region placement, the resolution of writing-mode relative property
- values (such as start, end, before, after), and the default block (paragraph) bidirectionality
- level.
- </p>
- <p>The <code>writing-mode</code> property is inherited, so it can appear on any XSL-FO element type; however,
- it applies (semantically) only to the following element types:
- </p>
- <ul>
- <li><code>fo:page-sequence</code></li>
- <li><code>fo:simple-page-master</code></li>
- <li><code>fo:region-*</code></li>
- <li><code>fo:block-container</code></li>
- <li><code>fo:inline-container</code></li>
- <li><code>fo:table</code></li>
- </ul>
- <p>If it is not specified on one of these element types, but is specified on an ancestor element, then the value specified on that
- ancestor element (the inherited value) is used; otherwise, the initial value <code>lr-tb</code> is used.</p>
- <p>At present, only the following values of the <code>writing-mode</code> property are supported:</p>
- <ul>
- <li><code>lr-tb</code></li>
- <li><code>rl-tb</code></li>
- <li><code>lr</code></li>
- <li><code>rl</code></li>
- </ul>
- <p>Writing modes that employ a vertical inline progression direction are not yet supported.</p>
- </section>
- <!-- [TBD] - NEED TO DOCUMENT
- <section id="number_conversion_properties">
- <title>Number Conversion Properties</title>
- </section>
- -->
- <section id="bidi_override_element">
- <title>Bidi Override Element</title>
- <p>The <link href="http://www.w3.org/TR/2006/REC-xsl11-20061205/#fo_bidi-override"><code>fo:bidi-override</code></link>
- element may be used to override default bidirectional processing behavior,
- including default embedding levels and default character directionality. In the absence of either this element
- or use of explicit <link href="#bidi_controls">Bidi Control Characters</link>, the default behavior prescribed
- by the <link href="http://www.w3.org/TR/2006/REC-xsl11-20061205/#fo_bidi-override">Unicode Bidirectional Algorithm</link>
- applies.
- </p>
- </section>
- <section id="bidi_controls">
- <title>Bidi Control Characters</title>
- <p>In addition to the use of the <link href="#bidi_override_element">Bidi Override Element</link>, an author
- may make use of the following explicit Unicode Bidi Control Characters:</p>
- <ul>
- <li>U+200E - LEFT-TO-RIGHT MARK (LRM)</li>
- <li>U+200F - RIGHT-TO-LEFT MARK (RLM)</li>
- <li>U+202A - LEFT-TO-RIGHT EMBEDDING (LRE)</li>
- <li>U+202B - RIGHT-TO-LEFT EMBEDDING (RLE)</li>
- <li>U+202C - POP DIRECTIONAL FORMATTING (PDF)</li>
- <li>U+202D - LEFT-TO-RIGHT OVERRIDE (LRO)</li>
- <li>U+202E - RIGHT-TO-LEFT OVERRIDE (RLO)</li>
- </ul>
- <p>If an embedding or override is not terminated (using U+202C PDF) prior to the end of a
- <link href="http://www.w3.org/TR/2006/REC-xsl11-20061205/#d0e4879">delimited text range</link>,
- then it is automatically terminated by FOP.
- </p>
- </section>
- <section id="join_controls">
- <title>Join Control Characters</title>
- <p>In order to prevent joining behavior in contexts where joining occurs by default,
- for example, between U+0628 ARABIC LETTER BEH and U+0646 ARABIC LETTER NOON,
- an author may used a U+200C ZERO WIDTH NON-JOINER (ZWNJ).
- </p>
- <p>Conversely, in order to force joining behavior in contexts where joining does not occur by default,
- for example, between U+0628 ARABIC LETTER BEH and U+0020 SPACE, an author may used a U+200D ZERO WIDTH JOINER (ZWJ).
- </p>
- <p>The behavior of ZWNJ and ZWJ is script specific. See
- <link href="http://www.unicode.org/versions/Unicode6.1.0/ch08.pdf">The Unicode Standard, Chapter 8,
- Middle Eastern Scripts</link> for information on the use of these control characters with the Arabic
- script. See
- <link href="http://www.unicode.org/versions/Unicode6.1.0/ch09.pdf">The Unicode Standard, Chapter 9,
- South Asian Scripts - I</link> for information on the use of these control characters with common
- Indic scripts.
- </p>
- </section>
- </section>
- <section id="supported_scripts">
- <title>Supported Scripts</title>
- <p>Support for specific complex scripts is enumerated in the following table. Support
- for those marked as not being supported is expected to be added in future revisions.</p>
- <table>
- <colgrp>
- <col style="width: 15%"/>
- <col style="width: 10%"/>
- <col style="width: 10%"/>
- <col style="width: 65%"/>
- </colgrp>
- <tr>
- <th style="text-align:left">Script</th>
- <th>Support</th>
- <th>Tested</th>
- <th style="text-align:left">Comments</th>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Arabic_alphabet">Arabic</link></td>
- <td class="yes">full</td>
- <td class="yes">full</td>
- <td></td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Bengali_alphabet">Bengali</link></td>
- <td class="no">none</td>
- <td class="no">none</td>
- <td></td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Burmese_alphabet">Burmese</link></td>
- <td class="no">none</td>
- <td class="no">none</td>
- <td></td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Devanagari_alphabet">Devanagari</link></td>
- <td class="partial">partial</td>
- <td class="partial">partial</td>
- <td style="text-align:left">join controls (ZWJ, ZWNJ) not yet supported</td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Khmer_alphabet">Khmer</link></td>
- <td class="no">none</td>
- <td class="no">none</td>
- <td></td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Gujarati_alphabet">Gujarati</link></td>
- <td class="partial">partial</td>
- <td class="no">none</td>
- <td style="text-align:left">pre-alpha</td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Gurmukhī_alphabet">Gurmukhi</link></td>
- <td class="partial">partial</td>
- <td class="no">none</td>
- <td style="text-align:left">pre-alpha</td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Hebrew_alphabet">Hebrew</link></td>
- <td class="yes">full</td>
- <td class="partial">partial</td>
- <td></td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Kannada_alphabet">Kannada</link></td>
- <td class="no">none</td>
- <td class="no">none</td>
- <td></td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Lao_alphabet">Lao</link></td>
- <td class="no">none</td>
- <td class="no">none</td>
- <td></td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Malayalam_alphabet">Malayalam</link></td>
- <td class="no">none</td>
- <td class="no">none</td>
- <td></td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Mongolian_script">Mongolian</link></td>
- <td class="no">none</td>
- <td class="no">none</td>
- <td></td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Oriya_script">Oriya</link></td>
- <td class="no">none</td>
- <td class="no">none</td>
- <td></td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Tamil_alphabet">Tamil</link></td>
- <td class="no">none</td>
- <td class="no">none</td>
- <td></td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Telugu_alphabet">Telugu</link></td>
- <td class="no">none</td>
- <td class="no">none</td>
- <td></td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Tibetan_alphabet">Tibetan</link></td>
- <td class="no">none</td>
- <td class="no">none</td>
- <td></td>
- </tr>
- <tr>
- <td><link href="http://en.wikipedia.org/wiki/Thai_alphabet">Thai</link></td>
- <td class="no">none</td>
- <td class="no">none</td>
- <td></td>
- </tr>
- </table>
- </section>
- <section id="supported_fonts">
- <title>Supported Fonts</title>
- <p>Support for specific fonts is enumerated in the following sub-sections. If a given
- font is not listed, then it has not been tested with these complex scripts features.</p>
- <section id="fonts_arabic">
- <title>Arabic Fonts</title>
- <table>
- <colgrp>
- <col style="width: 15%"/>
- <col style="width: 10%"/>
- <col style="width: 10%"/>
- <col style="width: 65%"/>
- </colgrp>
- <tr>
- <th style="text-align:left">Font</th>
- <th style="text-align:left">Version</th>
- <th style="text-align:center">Glyphs</th>
- <th style="text-align:left">Comments</th>
- </tr>
- <tr>
- <td><link href="http://www.microsoft.com/typography/fonts/family.aspx?FID=24">Arial Unicode MS</link></td>
- <td class="yes" style="text-align:left"><link href="http://www.microsoft.com/typography/fonts/font.aspx?FMID=1081">1.01</link></td>
- <td style="text-align:center">50377</td>
- <td>limited GPOS support</td>
- </tr>
- <tr>
- <td><link href="http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&amp;id=ArabicFonts">Lateef</link></td>
- <td class="yes" style="text-align:left">1.0</td>
- <td style="text-align:center">1147</td>
- <td>language features for Kurdish (KUR), Sindhi (SND), Urdu (URD)</td>
- </tr>
- <tr>
- <td><link href="http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&amp;id=ArabicFonts">Scheherazade</link></td>
- <td class="yes" style="text-align:left">1.0</td>
- <td style="text-align:center">1197</td>
- <td>language features for Kurdish (KUR), Sindhi (SND), Urdu (URD)</td>
- </tr>
- <tr>
- <td><link href="http://www.microsoft.com/typography/fonts/family.aspx?FID=261">Simplified Arabic</link></td>
- <td class="no" style="text-align:left"><link href="http://www.microsoft.com/typography/fonts/font.aspx?FMID=867">1.01</link></td>
- <td/>
- <td>contains invalid, out of order coverage table entries</td>
- </tr>
- <tr>
- <td><link href="http://www.microsoft.com/typography/fonts/font.aspx?FID=261">Simplified Arabic</link></td>
- <td class="yes" style="text-align:left"><link href="http://www.microsoft.com/typography/fonts/font.aspx?FMID=1645">5.00</link></td>
- <td style="text-align:center">414</td>
- <td>lacks GPOS support</td>
- </tr>
- <tr>
- <td><link href="http://www.microsoft.com/typography/fonts/font.aspx?FID=261">Simplified Arabic</link></td>
- <td class="yes" style="text-align:left">5.92</td>
- <td style="text-align:center">473</td>
- <td>includes GPOS for advanced position adjustment</td>
- </tr>
- <tr>
- <td><link href="http://www.microsoft.com/typography/fonts/family.aspx?FID=264">Traditional Arabic</link></td>
- <td class="yes" style="text-align:left"><link href="http://www.microsoft.com/typography/fonts/family.aspx?FMID=877">1.01</link></td>
- <td style="text-align:center">530</td>
- <td>lacks GPOS support</td>
- </tr>
- <tr>
- <td><link href="http://www.microsoft.com/typography/fonts/font.aspx?FID=264">Traditional Arabic</link></td>
- <td class="yes" style="text-align:left"><link href="http://www.microsoft.com/typography/fonts/font.aspx?FMID=1658">5.00</link></td>
- <td style="text-align:center">530</td>
- <td>lacks GPOS support</td>
- </tr>
- <tr>
- <td><link href="http://www.microsoft.com/typography/fonts/font.aspx?FID=264">Traditional Arabic</link></td>
- <td class="yes" style="text-align:left">5.92</td>
- <td style="text-align:center">589</td>
- <td>includes GPOS for advanced position adjustment</td>
- </tr>
- </table>
- </section>
- <section id="devanagari_fonts">
- <title>Devanagari Fonts</title>
- <table>
- <colgrp>
- <col style="width: 15%"/>
- <col style="width: 10%"/>
- <col style="width: 10%"/>
- <col style="width: 65%"/>
- </colgrp>
- <tr>
- <th style="text-align:left">Font</th>
- <th style="text-align:left">Version</th>
- <th style="text-align:center">Glyphs</th>
- <th style="text-align:left">Comments</th>
- </tr>
- <tr>
- <td><link href="http://www.microsoft.com/typography/fonts/family.aspx?FID=370">Aparajita</link></td>
- <td class="yes" style="text-align:left"><link href="http://www.microsoft.com/typography/fonts/font.aspx?FMID=1700">1.00</link></td>
- <td style="text-align:center">706</td>
- <td/>
- </tr>
- <tr>
- <td><link href="http://www.microsoft.com/typography/fonts/family.aspx?FID=374">Kokila</link></td>
- <td class="yes" style="text-align:left"><link href="http://www.microsoft.com/typography/fonts/font.aspx?FMID=1749">1.00</link></td>
- <td style="text-align:center">706</td>
- <td/>
- </tr>
- <tr>
- <td><link href="http://www.microsoft.com/typography/fonts/family.aspx?FID=243">Mangal</link></td>
- <td class="yes" style="text-align:left"><link href="http://www.microsoft.com/typography/fonts/font.aspx?FMID=1759">5.01</link></td>
- <td style="text-align:center">885</td>
- <td>designed for use in user interfaces</td>
- </tr>
- <tr>
- <td><link href="http://www.microsoft.com/typography/fonts/family.aspx?FID=384">Utsaah</link></td>
- <td class="yes" style="text-align:left"><link href="http://www.microsoft.com/typography/fonts/font.aspx?FMID=1811">1.00</link></td>
- <td style="text-align:center">706</td>
- <td/>
- </tr>
- </table>
- </section>
- </section>
- <section id="limitations">
- <title>Other Limitations</title>
- <p>
- Complex scripts support in Apache FOP is relatively new, so there are certain
- limitations. Please help us identify and close any gaps.
- </p>
- <ul>
- <li>Only the PDF output format fully supports complex scripts features at the present time.</li>
- <li>Shaping context does not extend across an element boundary. This limitation prevents the use of
- <code>fo:character</code>, <code>fo:inline</code> or <code>fo:wrapper</code> in order to colorize
- individual Arabic letters without affecting shaping behavior across the element boundary.</li>
- </ul>
- </section>
- <section id="links">
- <title>Related Links</title>
- <p>
- In addition to the XSL-FO specification, a number of external resources provide
- guidance about authoring documents that employ complex scripts and the features
- described above:
- </p>
- <ul>
- <li><link href="http://www.unicode.org/">The Unicode Standard</link></li>
- <li><link href="http://www.w3.org/TR/2006/REC-xsl11-20061205/#fo_bidi-override">Unicode Bidirectional Algorithm</link></li>
- <li><link href="http://www.microsoft.com/typography/otspec/ttochap1.htm">OpenType Advanced Typographic Extensions</link></li>
- <li><link href="http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&amp;item_id=CmplxRndExamples">Examples of Complex Rendering</link></li>
- </ul>
- </section>
- </body>
-</document>
diff --git a/src/documentation/content/xdocs/1.1rc1/configuration.xml b/src/documentation/content/xdocs/1.1rc1/configuration.xml
deleted file mode 100644
index b30a091a5..000000000
--- a/src/documentation/content/xdocs/1.1rc1/configuration.xml
+++ /dev/null
@@ -1,541 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP: Configuration</title>
- <version>$Revision$</version>
- </header>
-
- <body>
- <section id="general">
- <title>Configuration File Basics</title>
- <p>
- The Apacheâ„¢ FOP configuration file is an XML file containing a variety of settings that are useful
- for controlling FOP's behavior, and for helping it find resources that you wish it to use.
- </p>
- <p>
- The easiest way to get started using a FOP configuration file is to copy the sample found
- at <code>{fop-dir}/conf/fop.xconf</code> to a location of your choice, and then to
- edit it according to your needs.
- It contains templates for the various configuration options, most of which are commented
- out. Remove the comments and change the settings for entries that you wish to use.
- Be sure to follow any instructions, including comments which specify the value range.
- Also, since the configuration file is XML, be sure to keep it well-formed.
- </p>
- <section id="general-available">
- <title>Making Configuration Available to FOP</title>
- <p>After creating your configuration file, you must tell FOP how to find it:</p>
- <ul>
- <li>
- If running FOP from the command-line, see the "-c" command-line option in
- <a href="running.html">Running FOP</a>.
- </li>
- <li>
- If running FOP as an embedded application, see
- <a href="embedding.html#config-external">Embedding, Using a Configuration File</a>.
- </li>
- </ul>
- <p>
- See <a href="embedding.html#config-internal">Setting the Configuration Programmatically</a>
- for instructions on how to do so in an embedded environment.
- </p>
- </section>
- </section>
- <section id="general-elements">
- <title>Summary of the General Configuration Options</title>
- <table>
- <tr>
- <th>Element</th>
- <th>Data Type (for the value)</th>
- <th>Description</th>
- <th>Default Value</th>
- </tr>
- <tr>
- <td>base</td>
- <td>URL or directory</td>
- <td>Specifies the base URL based on which relative URL will be resolved.</td>
- <td>current directory</td>
- </tr>
- <tr>
- <td>font-base</td>
- <td>URL or directory</td>
- <td>Specifies the base URL based on which relative font URLs will be resolved.
- </td>
- <td>base URL/directory (above)</td>
- </tr>
- <tr>
- <td>hyphenation-base</td>
- <td>URL or directory</td>
- <td>Specifies the base URL based on which relative URLs to hyphenation pattern
- files will be resolved. If not specified, support for user-supplied hyphenation
- patterns remains disabled.
- </td>
- <td>disabled</td>
- </tr>
- <tr>
- <td colspan="4">Relative URIs for the above three properties are evaluated relative to the base URI of the configuration file. If the configuration is provided programmatically, the base URI can be set with <code>FopFactory.setUserConfigBaseURI</code>; default is the current working directory.</td>
- </tr>
- <tr>
- <td>hyphenation-pattern</td>
- <td>String, attribute lang, attribute country (optional)</td>
- <td>Register a file name for the hyphenation pattern for the mentioned language and country. Language ll and country CC must both consist of two letters.</td>
- <td>ll_CC</td>
- </tr>
- <tr>
- <td>source-resolution</td>
- <td>Integer, dpi</td>
- <td>
- Resolution in dpi (dots per inch) which is used internally to determine the pixel
- size for SVG images and bitmap images without resolution information.
- </td>
- <td>72 dpi</td>
- </tr>
- <tr>
- <td>target-resolution</td>
- <td>Integer, dpi</td>
- <td>
- Resolution in dpi (dots per inch) used to specify the output resolution for bitmap
- images generated by bitmap renderers (such as the TIFF renderer) and by bitmaps
- generated by Apache Batik for filter effects and such.
- </td>
- <td>72 dpi</td>
- </tr>
- <tr>
- <td>strict-configuration</td>
- <td>Boolean (true, false)</td>
- <td>
- Setting this option to 'true' will cause FOP to strictly verify the contents of the
- FOP configuration file to ensure that defined resources (such as fonts and base
- URLs/directories) are valid and available to FOP. Any errors found will cause FOP to
- immediately raise an exception.</td>
- <td>false</td>
- </tr>
- <tr>
- <td>strict-validation</td>
- <td>Boolean (true, false)</td>
- <td>
- Setting this option to 'false' causes FOP to be more forgiving about XSL-FO validity,
- for example, you're allowed to specify a border on a region-body which is supported
- by some FO implementations but is non-standard. Note that such a border would
- currently have no effect in Apache FOP.</td>
- <td>true</td>
- </tr>
- <tr>
- <td>break-indent-inheritance</td>
- <td>Boolean (true, false)</td>
- <td>
- Setting this option to 'true' causes FOP to use an alternative rule set to determine
- text indents specified through margins, start-indent and end-indent. Many commercial
- FO implementations have chosen to break the XSL specification in this aspect. This
- option tries to mimic their behaviour. Please note that Apache FOP may still not
- behave exactly like those implementations either because FOP has not fully matched
- the desired behaviour and because the behaviour among the commercial implementations
- varies. The default for this option (i.e. false) is to behave exactly like the
- specification describes.</td>
- <td>false</td>
- </tr>
- <tr>
- <td>complex-scripts</td>
- <td>attribute disabled (optional)</td>
- <td>
- If present and if an attribute 'disabled' is specified with the value 'false', then
- complex script features are disabled. The same result can be obtained on an FOP
- per-invocation basis by specifying a '-nocs' command line option when invoking FOP.
- When complex script features are disabled, all bidirectional processing and complex
- character to glyph mapping processing is disabled; in addition, the loading of
- GDEF, GSUB, and GPOS advanced typographic tables is disabled for OpenType and
- TrueType fonts. Unless disabled by this mechanism or by use of the '-nocs' command
- line option, complex script features will be enabled by default.
- </td>
- <td>n/a</td>
- </tr>
- <tr>
- <td>default-page-settings</td>
- <td>n/a</td>
- <td>
- Specifies the default width and height of a page if "auto" is specified
- for either or both values. Use "height" and "width" attributes on the
- default-page-settings element to specify the two values.</td>
- <td>"height" 11 inches, "width" 8.26 inches</td>
- </tr>
- <!-- Disabled: no simultaneous Renderer and IF implementations at the moment
- <tr>
- <td>prefer-renderer</td>
- <td>boolean (true, false)</td>
- <td>
- By default, FOP prefers the newer output implementations based on the
- <code>IFDocumentHandler</code> interface. If no such implementation can be found for
- a given MIME type, it looks for an implementation of the <code>Renderer</code> interface.
- If necessary, you can invert the lookup order to prefer the Renderer variant over the
- IFDocumentHandler variant by setting this value to true.
- </td>
- <td>false</td>
- </tr>
- -->
- <tr>
- <td>use-cache</td>
- <td>boolean (true, false)</td>
- <td>All fonts information that has been gathered as a result of "directory"
- or "auto-detect" font configurations will be cached for future rendering runs.
- This setting should improve performance on systems where
- fonts have been configured using the "directory" or "auto-detect" tag mechanisms.
- By default this option is switched on.</td>
- <td>true</td>
- </tr>
- <tr>
- <td>cache-file</td>
- <td>String</td>
- <td>This option specifies the file/directory path of the fop cache file.
- This file is currently only used to cache font triplet information for future reference.</td>
- <td>${base}/conf/fop.cache</td>
- </tr>
- <tr>
- <td>renderers</td>
- <td>(see text below)</td>
- <td>Contains the configuration for each renderer. See below.</td>
- <td>N/A</td>
- </tr>
- </table>
- <p>
- This is an excerpt from the example configuration file coming with FOP:
- </p>
- <source><![CDATA[
-<fop version="1.0">
-
- <!-- Strict user configuration -->
- <strict-configuration>true</strict-configuration>
-
- <!-- Strict FO validation -->
- <strict-validation>true</strict-validation>
-
- <!-- Base URL for resolving relative URLs -->
- <base>./</base>
-
- <!-- Font Base URL for resolving relative font URLs -->
- <font-base>./</font-base>
-
- <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
- <source-resolution>72</source-resolution>
- <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->
- <target-resolution>72</target-resolution>
-
- <!-- default page-height and page-width, in case
- value is specified as auto -->
- <default-page-settings height="11in" width="8.26in"/>
-
- <!-- Use file name nl_Bel instead of the default nl_BE -->
- <hyphenation-pattern lang="nl" country="BE">nl_Bel</hyphenation-pattern>
-
- <!-- etc. etc..... -->
-</fop>]]></source>
- </section>
- <section id="image-loading">
- <title>Image Loading Customization</title>
- <p>
- Apache FOP uses the image loading framework from
- <a href="http://xmlgraphics.apache.org/commons/">Apache XML Graphics Commons</a> to load
- images using various plug-ins. Every image loader plug-in has a hard-coded usage penalty
- that influences which solution is chosen if there are multiple possibilities to load an image.
- Sometimes, though, these penalties need to be tweaked and this can be done in the FOP
- configuration. An example:
- </p>
- <source><![CDATA[<fop version="1.0">
- [..]
- <image-loading>
- <penalty value="10000"
- class="org.apache.xmlgraphics.image.loader.impl.ImageLoaderRawCCITTFax"/>
- <penalty value="INFINITE"
- class="org.apache.xmlgraphics.image.loader.impl.ImageLoaderInternalTIFF"/>
- </image-loading>
- <renderers....
-</fop>]]></source>
- <p>
- The first penalty element increases the penalty for the raw CCITT loader. This practically
- forces the decoding of CCITT compressed TIFF images except if there are no TIFF codecs
- available.
- </p>
- <p>
- The second penalty element sets an "infinite" penalty for the TIFF loader using the internal
- TIFF codec. This practically disables that plug-in as it will never be chosen as a possible
- solution.
- </p>
- <p>
- Negative penalties are possible to promote a plug-in but a negative penalty sum will be
- treated as zero penalty in most cases. For more details on the image loading framework,
- please consult the documentation there.
- </p>
- </section>
- <section id="renderers">
- <title>Renderer configuration</title>
- <p>
- Each Renderer has its own configuration section which is identified by the
- MIME type the Renderer is written for, ex. "application/pdf" for the PDF Renderer.
- </p>
- <p>
- The configuration for the PDF Renderer could look like this:
- </p>
- <source><![CDATA[
- <renderers>
- <renderer mime="application/pdf">
- <filterList>
- <!-- provides compression using zlib flate (default is on) -->
- <value>flate</value>
- </filterList>
- <fonts>
- <font metrics-url="arial.xml" kerning="yes" embed-url="arial.ttf">
- <font-triplet name="Arial" style="normal" weight="normal"/>
- <font-triplet name="ArialMT" style="normal" weight="normal"/>
- </font>
- <font metrics-url="arialb.xml" kerning="yes" embed-url="arialb.ttf">
- <font-triplet name="Arial" style="normal" weight="bold"/>
- <font-triplet name="ArialMT" style="normal" weight="bold"/>
- </font>
- </fonts>
- </renderer>
-
- <renderer mime="application/postscript">
- <!-- etc. etc..... -->]]></source>
- <p>
- The details on the font configuration can be found on the separate <a href="fonts.html">Fonts</a> page.
- Note especially the section entitled <a href="fonts.html#register">Register Fonts with FOP</a>.
- </p>
- <section id="pdf-renderer">
- <title>Special Settings for the PDF Renderer</title>
- <p>
- The configuration element for the PDF renderer contains two elements. One is for the font configuration
- (please follow the link above) and one is for the "filter list". The filter list controls how the
- individual objects in a PDF file are encoded. By default, all objects get "flate" encoded (i.e. simply
- compressed with the same algorithm that is also used in ZIP files). Most users don't need to change that
- setting. For debugging purposes, it may be desired not to compress the internal objects at all so the
- generated PDF commands can be read. In that case, you can simply use the following filter list. The
- second filter list (type="image") ensures that all images still get compressed but also ASCII-85 encoded
- so the produced PDF file is still easily readable in a text editor.
- </p>
- <source><![CDATA[
- <renderer mime="application/pdf">
- <filterList>
- <value>null</value>
- </filterList>
- <filterList type="image">
- <value>flate</value>
- <value>ascii-85</value>
- </filterList>
-
- <fonts....
- </renderer>]]></source>
- <p>
- Another (optional) setting specific to the PDF Renderer is an output color profile, an ICC
- color profile which indicates the target color space the PDF file is generated for. This
- setting is mainly used in conjunction with the <a href="pdfx.html">PDF/X</a> feature.
- An example:
- </p>
- <source><![CDATA[
- <renderer mime="application/pdf">
- <filterList...
-
- <output-profile>C:\FOP\Color\EuropeISOCoatedFOGRA27.icc</output-profile>
-
- <fonts....
- </renderer>]]></source>
- <p>
- Some people don't have high requirements on color fidelity but instead want the smallest
- PDF file sizes possible. In this case it's possible to disable the default sRGB color space
- which XSL-FO requires. This will cause RGB colors to be generated as device-specific RGB.
- Please note that this option is unavailable (and will cause an error) if you enable
- PDF/A or PDF/X functionality or if you specify an output profile. This setting will make the
- PDF about 4KB smaller. To disable the sRGB color space add the following setting:
- </p>
- <source><![CDATA[
- <renderer mime="application/pdf">
- <filterList...
-
- <disable-srgb-colorspace>true</disable-srgb-colorspace>
-
- <fonts....
- </renderer>]]></source>
-
- <p>FOP supports encryption of PDF output, thanks to Patrick C. Lankswert.
- This feature is commonly used to prevent unauthorized viewing, printing, editing, copying text
- from the document and doing annotations. It is also possible to ask the user for a password in
- order to view the contents. Note that there already exist third party applications which can
- decrypt an encrypted PDF without effort and allow the aforementioned operations, therefore the
- degree of protection is limited. For further information about features and restrictions
- regarding PDF encryption, look at the documentation coming with Adobe Acrobat or the technical
- documentation on the Adobe web site.</p>
- <source><![CDATA[
- <renderer mime="application/pdf">
- <encryption-params>
- <encryption-length>128</encryption-length>
- <user-password>testuserpass</user-password>
- <owner-password>testownerpass</owner-password>
- <noprint/>
- <nocopy/>
- <noedit/>
- <noannotations/>
- <nofillinforms/>
- <noaccesscontent/>
- <noassembledoc/>
- <noprinthq/>
- </encryption-params>
- </renderer>]]></source>
- <p>
- By default FOP produces PDF files of version 1.4, but this can be changed in order to benefit
- from features that appeared in newer versions of PDF. At the moment, only a few features from
- PDF 1.5 have been implemented, but the configuration element will accept any value between
- 1.4 and 1.7. This is the value that will appear in the PDF header, although only features up
- to 1.5 will actually be used.
- <source><![CDATA[
- <renderer mime="application/pdf">
- <version>1.5</version>
- <!-- Versions 1.4, 1.5, 1.6 and 1.7 are accepted, all other values are invalid -->
- </renderer>]]></source>
- </p>
-
- </section>
- <section id="ps-renderer">
- <title>Special Settings for the PostScript Renderer</title>
- <p>
- Besides the normal font configuration (the same "fonts" element as for the PDF renderer) the PostScript
- renderer has an additional setting to force landscape pages to be rotated to fit on a page inserted into
- the printer in portrait mode. Set the value to "true" to activate this feature. The default is "false".
- Example:
- </p>
- <source><![CDATA[
- <renderer mime="application/postscript">
- <auto-rotate-landscape>true</auto-rotate-landscape>
-
- <fonts>
- <font metrics-url="arial.xml" kerning="yes" embed-url="arial.ttf">
- <font-triplet name="Arial" style="normal" weight="normal"/>
- <font-triplet name="ArialMT" style="normal" weight="normal"/>
- </font>
- <font metrics-url="arialb.xml" kerning="yes" embed-url="arialb.ttf">
- <font-triplet name="Arial" style="normal" weight="bold"/>
- <font-triplet name="ArialMT" style="normal" weight="bold"/>
- </font>
- </fonts>
- </renderer>]]></source>
- </section>
- <section id="pcl-renderer">
- <title>Special Settings for the PCL Renderer</title>
- <p>
- Non-standard fonts for the PCL renderer are made available through the Java2D subsystem which means that
- you don't have to do any custom font configuration in this case but you have to use the font names
- offered by Java.
- </p>
- <p>
- Additionally, there are certain settings that control how the renderer handles various elements.
- </p>
-<source><![CDATA[<renderer mime="application/x-pcl">
- <rendering>quality</rendering>
- <text-rendering>bitmap</text-rendering>
-</renderer>]]></source>
- <p>
- The default value for the "rendering" setting is "speed" which causes borders
- to be painted as plain rectangles. In this mode, no special borders (dotted,
- dashed etc.) are available. If you want support for all border modes, set the
- value to "quality" as indicated above. This will cause the borders to be painted
- as bitmaps.
- </p>
- <p>
- The default value for the "text-rendering" setting is "auto" which paints the
- base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D.
- If the mix of painting methods results in unwelcome output, you can set this
- to "bitmap" which causes all text to be rendered as bitmaps.
- </p>
- </section>
- <section id="afp-renderer">
- <title>Special Settings for the AFP Renderer</title>
- <p>
- </p>
- <p>
- Additionally, there are certain settings that control how the renderer handles various elements.
- </p>
-<source><![CDATA[<renderer mime="application/x-afp">
- <images mode="b+w" bits-per-pixel="8" native="true"/>
- <renderer-resolution>240</renderer-resolution>
- <line-width-correction>2.5</line-width-correction>
-
- <!-- a default external resource group file -->
- <resource-group-file>resources.afp</resource-group-file>
-</renderer>]]></source>
- <p>
- The default value for the images "mode" setting is "b+w" (black and white). When the images "mode" setting is "b+w" a "bits-per-pixel" setting can be provided to aid the grayscale conversion process. With this setting all images referenced in your source document are converted to an IOCA FS45 grayscale bitmap image form.
- When the setting is "color" all images are converted to an IOCA FS45 color bitmap image form. When "native" setting is "true", all images encountered (TIFF, GIF, JPEG and Encapsulated Postscript etc.) will be embedded directly in the datastream in their native form using a MO:DCA Object Container.
- </p>
- <p>
- The default value for the "renderer-resolution" is 240 dpi.
- </p>
- <p>
- The default line width is device dependent and may need to be fine tuned so that the output matches the expected result. The default correction value is 2.5.
- </p>
- <!--
- <p>
- The default value for the MO:DCA "interchange-set" is "MO:DCA-L". Other compliance settings include presentation interchange sets "MO:DCA-P IS/1" and "MO:DCA-P IS/2" (Resource Groups).
- </p>
- -->
- <p>
- By default if there is no configuration definition for "resource-group-file", external resources will be placed in a file called resources.afp.
- </p>
- </section>
- </section>
-
- <section>
- <title>When it does not work</title>
-
- <p>FOP searches the configuration file for the information it
-expects, at the position it expects. When that information is not
-present, FOP will not complain, it will just continue. When there is
-other information in the file, FOP will not complain, it will just
-ignore it. That means that when your configuration information is in
-the file but in a different XML element, or in a different XML path,
-than FOP expects, it will be silently ignored.</p>
-
- <p>Check the following possibilities:</p>
-
- <ul>
- <li>The format of the configuration file has changed
-considerably between FOP 0.20.5 and FOP 1.0 and its beta versions. Did
-you convert your file to the new format?</li>
-
- <li>The FOP distribution contains a schema for configuration
-files, at src/foschema/fop-configuration.xsd. Did you validate your
-configuration file against it? Add the following schema location to
-the <code>schema</code> element:
-
-<source><![CDATA[<fop
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-xsi:noNamespaceSchemaLocation=
-"http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/foschema/fop-configuration.xsd?view=co">]]>
-</source>
-
-and run the configuration file through a validating schema
-parser. Note that the schema cannot detect all errors, and that it is
-stricter about the order of some elements than FOP itself is.</li>
-
- <li>Run FOP in debug mode (command line option
-<code>-d</code>). This makes FOP report which configuration
-information it finds. Check if FOP finds what you expect.</li>
-
- </ul>
-
- </section>
- </body>
-</document>
diff --git a/src/documentation/content/xdocs/1.1rc1/embedding.xml b/src/documentation/content/xdocs/1.1rc1/embedding.xml
deleted file mode 100644
index 24c74f970..000000000
--- a/src/documentation/content/xdocs/1.1rc1/embedding.xml
+++ /dev/null
@@ -1,752 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<!-- Embedding FOP -->
-<document>
- <header>
- <title>Apacheâ„¢ FOP: Embedding</title>
- <subtitle>How to Embed FOP in a Java application</subtitle>
- <version>$Revision$</version>
- </header>
-
- <body>
- <section id="overview">
- <title>Overview</title>
- <p>
- Review <a href="running.html">Running Apacheâ„¢ FOP</a> for important information that applies
- to embedded applications as well as command-line use, such as options and performance.
- </p>
- <p>
- To embed Apacheâ„¢ FOP in your application, first create a new
- org.apache.fop.apps.FopFactory instance. This object can be used to launch multiple
- rendering runs. For each run, create a new org.apache.fop.apps.Fop instance through
- one of the factory methods of FopFactory. In the method call you specify which output
- format (i.e. MIME type) to use and, if the selected output format requires an
- OutputStream, which OutputStream to use for the results of the rendering. You can
- customize FOP's behaviour in a rendering run by supplying your own FOUserAgent
- instance. The FOUserAgent can, for example, be used to set your own document handler
- instance (details below). Finally, you retrieve a SAX DefaultHandler instance from
- the Fop object and use that as the SAXResult of your transformation.
- </p>
- </section>
- <section id="API">
- <title>The API</title>
- <p>
- FOP has many classes which express the "public" access modifier, however, this is not
- indicative of their inclusion into the public API. Every attempt will be made to keep the
- public API static, to minimize regressions for existing users, however, since the API is not
- clearly defined, the list of classes below are the generally agreed public API:
- <source><![CDATA[
-org.apache.fop.apps.*
-org.apache.fop.fo.FOEventHandler
-org.apache.fop.fo.ElementMappingRegistry
-org.apache.fop.fonts.FontManager
-org.apache.fop.events.EventListener
-org.apache.fop.events.Event
-org.apache.fop.events.model.EventSeverity
-org.apache.fop.render.ImageHandlerRegistry
-org.apache.fop.render.RendererFactory
-org.apache.fop.render.intermediate.IFContext
-org.apache.fop.render.intermediate.IFDocumentHandler
-org.apache.fop.render.intermediate.IFException
-org.apache.fop.render.intermediate.IFParser
-org.apache.fop.render.intermediate.IFSerializer
-org.apache.fop.render.intermediate.IFUtil
-org.apache.fop.render.intermediate.util.IFConcatenator]]></source>
- </p>
- </section>
- <section id="basics">
- <title>Basic Usage Pattern</title>
- <p>
- Apache FOP relies heavily on JAXP. It uses SAX events exclusively to receive the XSL-FO
- input document. It is therefore a good idea that you know a few things about JAXP (which
- is a good skill anyway). Let's look at the basic usage pattern for FOP...
- </p>
- <p>Here is the basic pattern to render an XSL-FO file to PDF:
- </p>
- <source><![CDATA[
-import org.apache.fop.apps.FopFactory;
-import org.apache.fop.apps.Fop;
-import org.apache.fop.apps.MimeConstants;
-
-/*..*/
-
-// Step 1: Construct a FopFactory
-// (reuse if you plan to render multiple documents!)
-FopFactory fopFactory = FopFactory.newInstance();
-
-// Step 2: Set up output stream.
-// Note: Using BufferedOutputStream for performance reasons (helpful with FileOutputStreams).
-OutputStream out = new BufferedOutputStream(new FileOutputStream(new File("C:/Temp/myfile.pdf")));
-
-try {
- // Step 3: Construct fop with desired output format
- Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);
-
- // Step 4: Setup JAXP using identity transformer
- TransformerFactory factory = TransformerFactory.newInstance();
- Transformer transformer = factory.newTransformer(); // identity transformer
-
- // Step 5: Setup input and output for XSLT transformation
- // Setup input stream
- Source src = new StreamSource(new File("C:/Temp/myfile.fo"));
-
- // Resulting SAX events (the generated FO) must be piped through to FOP
- Result res = new SAXResult(fop.getDefaultHandler());
-
- // Step 6: Start XSLT transformation and FOP processing
- transformer.transform(src, res);
-
-} finally {
- //Clean-up
- out.close();
-}]]></source>
- <p>
- Let's discuss these 5 steps in detail:
- </p>
- <ul>
- <li>
- <strong>Step 1:</strong> You create a new FopFactory instance. The FopFactory instance holds
- references to configuration information and cached data. It's important to reuse this
- instance if you plan to render multiple documents during a JVM's lifetime.
- </li>
- <li>
- <strong>Step 2:</strong> You set up an OutputStream that the generated document
- will be written to. It's a good idea to buffer the OutputStream as demonstrated
- to improve performance.
- </li>
- <li>
- <strong>Step 3:</strong> You create a new Fop instance through one of the factory
- methods on the FopFactory. You tell the FopFactory what your desired output format
- is. This is done by using the MIME type of the desired output format (ex. "application/pdf").
- You can use one of the MimeConstants.* constants. The second parameter is the
- OutputStream you've setup up in step 2.
- </li>
- <li>
- <strong>Step 4</strong> We recommend that you use JAXP Transformers even
- if you don't do XSLT transformations to generate the XSL-FO file. This way
- you can always use the same basic pattern. The example here sets up an
- "identity transformer" which just passes the input (Source) unchanged to the
- output (Result). You don't have to work with a SAXParser if you don't do any
- XSLT transformations.
- </li>
- <li>
- <strong>Step 5:</strong> Here you set up the input and output for the XSLT
- transformation. The Source object is set up to load the "myfile.fo" file.
- The Result is set up so the output of the XSLT transformation is sent to FOP.
- The FO file is sent to FOP in the form of SAX events which is the most efficient
- way. Please always avoid saving intermediate results to a file or a memory buffer
- because that affects performance negatively.
- </li>
- <li>
- <strong>Step 6:</strong> Finally, we start the XSLT transformation by starting
- the JAXP Transformer. As soon as the JAXP Transformer starts to send its output
- to FOP, FOP itself starts its processing in the background. When the
- <code>transform()</code> method returns FOP will also have finished converting
- the FO file to a PDF file and you can close the OutputStream.
- <note label="Tip!">
- It's a good idea to enclose the whole conversion in a try..finally statement. If
- you close the OutputStream in the finally section, this will make sure that the
- OutputStream is properly closed even if an exception occurs during the conversion.
- </note>
- </li>
- </ul>
- <p>
- If you're not totally familiar with JAXP Transformers, please have a look at the
- <a href="#examples">Embedding examples</a> below. The section contains examples
- for all sorts of use cases. If you look at all of them in turn you should be able
- to see the patterns in use and the flexibility this approach offers without adding
- too much complexity.
- </p>
- <p>
- This may look complicated at first, but it's really just the combination of an
- XSL transformation and a FOP run. It's also easy to comment out the FOP part
- for debugging purposes, for example when you're tracking down a bug in your
- stylesheet. You can easily write the XSL-FO output from the XSL transformation
- to a file to check if that part generates the expected output. An example for that
- can be found in the <a href="#examples">Embedding examples</a> (See "ExampleXML2FO").
- </p>
- <section id="basic-logging">
- <title>Logging</title>
- <p>
- Logging is now a little different than it was in FOP 0.20.5. We've switched from
- Avalon Logging to <a href="ext:commons-logging">Jakarta Commons Logging</a>.
- While with Avalon Logging the loggers were directly given to FOP, FOP now retrieves
- its logger(s) through a statically available LogFactory. This is similar to the
- general pattern that you use when you work with Apache Log4J directly, for example.
- We call this "static logging" (Commons Logging, Log4J) as opposed to "instance logging"
- (Avalon Logging). This has a consequence: You can't give FOP a logger for each
- processing run anymore. The log output of multiple, simultaneously running FOP instances
- is sent to the same logger.
- </p>
- <p>
- By default, <a href="ext:commons-logging">Jakarta Commons Logging</a> uses
- JDK logging (available in JDKs 1.4 or higher) as its backend. You can configure Commons
- Logging to use an alternative backend, for example Log4J. Please consult the
- <a href="ext:commons-logging">documentation for Jakarta Commons Logging</a> on
- how to configure alternative backends.
- </p>
- <p>
- As a result of the above we differentiate between two kinds of "logging":
- </p>
- <ul>
- <li>(FOP-)Developer-oriented logging</li>
- <li><a href="events.html">User/Integrator-oriented feedback</a> (NEW!)</li>
- </ul>
- <p>
- The use of "feedback" instead of "logging" is intentional. Most people were using
- log output as a means to get feedback from events within FOP. Therefore, FOP now
- includes an <code>event</code> package which can be used to receive feedback from
- the layout engine and other components within FOP <strong>per rendering run</strong>.
- This feedback is not just some
- text but event objects with parameters so these events can be interpreted by code.
- Of course, there is a facility to turn these events into normal human-readable
- messages. For details, please read on on the <a href="events.html">Events page</a>.
- This leaves normal logging to be mostly a thing used by the FOP developers
- although anyone can surely activate certain logging categories but the feedback
- from the loggers won't be separated by processing runs. If this is required,
- the <a href="events.html">Events subsystem</a> is the right approach.
- </p>
- </section>
-
- <section id="render">
- <title>Processing XSL-FO</title>
- <p>
- Once the Fop instance is set up, call <code>getDefaultHandler()</code> to obtain a SAX
- DefaultHandler instance to which you can send the SAX events making up the XSL-FO
- document you'd like to render. FOP processing starts as soon as the DefaultHandler's
- <code>startDocument()</code> method is called. Processing stops again when the
- DefaultHandler's <code>endDocument()</code> method is called. Please refer to the basic
- usage pattern shown above to render a simple XSL-FO document.
- </p>
- </section>
-
- <section id="render-with-xslt">
- <title>Processing XSL-FO generated from XML+XSLT</title>
- <p>
- If you want to process XSL-FO generated from XML using XSLT we recommend
- again using standard JAXP to do the XSLT part and piping the generated SAX
- events directly through to FOP. The only thing you'd change to do that
- on the basic usage pattern above is to set up the Transformer differently:
- </p>
- <source><![CDATA[
- //without XSLT:
- //Transformer transformer = factory.newTransformer(); // identity transformer
-
- //with XSLT:
- Source xslt = new StreamSource(new File("mystylesheet.xsl"));
- Transformer transformer = factory.newTransformer(xslt);]]></source>
- </section>
- </section>
- <section id="input">
- <title>Input Sources</title>
- <p>
- The input XSL-FO document is always received by FOP as a SAX stream (see the
- <a href="../dev/design/parsing.html">Parsing Design Document</a> for the rationale).
- </p>
- <p>
- However, you may not always have your input document available as a SAX stream.
- But with JAXP it's easy to convert different input sources to a SAX stream so you
- can pipe it into FOP. That sounds more difficult than it is. You simply have
- to set up the right Source instance as input for the JAXP transformation.
- A few examples:
- </p>
- <ul>
- <li>
- <strong>URL:</strong> <code>Source src = new StreamSource("http://localhost:8080/testfile.xml");</code>
- </li>
- <li>
- <strong>File:</strong> <code>Source src = new StreamSource(new File("C:/Temp/myinputfile.xml"));</code>
- </li>
- <li>
- <strong>String:</strong> <code>Source src = new StreamSource(new StringReader(myString)); // myString is a String</code>
- </li>
- <li>
- <strong>InputStream:</strong> <code>Source src = new StreamSource(new MyInputStream(something));</code>
- </li>
- <li>
- <strong>Byte Array:</strong> <code>Source src = new StreamSource(new ByteArrayInputStream(myBuffer)); // myBuffer is a byte[] here</code>
- </li>
- <li>
- <strong>DOM:</strong> <code>Source src = new DOMSource(myDocument); // myDocument is a Document or a Node</code>
- </li>
- <li>
- <strong>Java Objects:</strong> Please have a look at the <a href="#examples">Embedding examples</a> which contain an example for this.
- </li>
- </ul>
- <p>
- There are a variety of upstream data manipulations possible.
- For example, you may have a DOM and an XSL stylesheet; or you may want to
- set variables in the stylesheet. Interface documentation and some cookbook
- solutions to these situations are provided in
- <a href="http://xml.apache.org/xalan-j/usagepatterns.html">Xalan Basic Usage Patterns</a>.
- </p>
- </section>
- <section id="config-internal">
- <title>Configuring Apache FOP Programmatically</title>
- <p>
- Apache FOP provides two levels on which you can customize FOP's
- behaviour: the FopFactory and the user agent.
- </p>
- <section id="fop-factory">
- <title>Customizing the FopFactory</title>
- <p>
- The FopFactory holds configuration data and references to objects which are reusable over
- multiple rendering runs. It's important to instantiate it only once (except in special
- environments) and reuse it every time to create new FOUserAgent and Fop instances.
- </p>
- <p>
- You can set all sorts of things on the FopFactory:
- </p>
- <ul>
- <li>
- <p>
- The <strong>font base URL</strong> to use when resolving relative URLs for fonts. Example:
- </p>
- <source>fopFactory.getFontManager().setFontBaseURL("file:///C:/Temp/fonts");</source>
- </li>
- <li>
- <p>
- The <strong>hyphenation base URL</strong> to use when resolving relative URLs for
- hyphenation patterns. Example:
- </p>
- <source>fopFactory.setHyphenBaseURL("file:///C:/Temp/hyph");</source>
- </li>
- <li>
- <p>
- Disable <strong>strict validation</strong>. When disabled FOP is less strict about the rules
- established by the XSL-FO specification. Example:
- </p>
- <source>fopFactory.setStrictValidation(false);</source>
- </li>
- <li>
- <p>
- Enable an <strong>alternative set of rules for text indents</strong> that tries to mimic the behaviour of many commercial
- FO implementations, that chose to break the specification in this respect. The default of this option is
- 'false', which causes Apache FOP to behave exactly as described in the specification. To enable the
- alternative behaviour, call:
- </p>
- <source>fopFactory.setBreakIndentInheritanceOnReferenceAreaBoundary(true);</source>
- </li>
- <li>
- <p>
- Set the <strong>source resolution</strong> for the document. This is used internally to determine the pixel
- size for SVG images and bitmap images without resolution information. Default: 72 dpi. Example:
- </p>
- <source>fopFactory.setSourceResolution(96); // =96dpi (dots/pixels per Inch)</source>
- </li>
- <li>
- <p>
- Manually add an <strong>ElementMapping instance</strong>. If you want to supply a special FOP extension
- you can give the instance to the FOUserAgent. Normally, the FOP extensions can be automatically detected
- (see the documentation on extension for more info). Example:
- </p>
- <source>fopFactory.addElementMapping(myElementMapping); // myElementMapping is a org.apache.fop.fo.ElementMapping</source>
- </li>
- <li>
- <p>
- Set a <strong>URIResolver</strong> for custom URI resolution. By supplying a JAXP URIResolver you can add
- custom URI resolution functionality to FOP. For example, you can use
- <a href="ext:xml.apache.org/commons/resolver">Apache XML Commons Resolver</a> to make use of XCatalogs. Example:
- </p>
- <source>fopFactory.setURIResolver(myResolver); // myResolver is a javax.xml.transform.URIResolver</source>
- <note>
- Both the FopFactory and the FOUserAgent have a method to set a URIResolver. The URIResolver on the FopFactory
- is primarily used to resolve URIs on factory-level (hyphenation patterns, for example) and it is always used
- if no other URIResolver (for example on the FOUserAgent) resolved the URI first.
- </note>
- </li>
- </ul>
- </section>
- <section id="user-agent">
- <title>Customizing the User Agent</title>
- <p>
- The user agent is the entity that allows you to interact with a single rendering run, i.e. the processing of a single
- document. If you wish to customize the user agent's behaviour, the first step is to create your own instance
- of FOUserAgent using the appropriate factory method on FopFactory and pass that
- to the factory method that will create a new Fop instance:
- </p>
- <source><![CDATA[
- FopFactory fopFactory = FopFactory.newInstance(); // Reuse the FopFactory if possible!
- // do the following for each new rendering run
- FOUserAgent userAgent = fopFactory.newFOUserAgent();
- // customize userAgent
- Fop fop = fopFactory.newFop(MimeConstants.MIME_POSTSCRIPT, userAgent, out);]]></source>
- <p>
- You can do all sorts of things on the user agent:
- </p>
- <ul>
- <li>
- <p>
- The <strong>base URL</strong> to use when resolving relative URLs. Example:
- </p>
- <source>userAgent.setBaseURL("file:///C:/Temp/");</source>
- </li>
- <li>
- <p>
- Set the <strong>producer</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. The default producer is "Apache FOP". Example:
- </p>
- <source>userAgent.setProducer("MyKillerApplication");</source>
- </li>
- <li>
- <p>
- Set the <strong>creating user</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
- </p>
- <source>userAgent.setCreator("John Doe");</source>
- </li>
- <li>
- <p>
- Set the <strong>author</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
- </p>
- <source>userAgent.setAuthor("John Doe");</source>
- </li>
- <li>
- <p>
- Override the <strong>creation date and time</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
- </p>
- <source>userAgent.setCreationDate(new Date());</source>
- </li>
- <li>
- <p>
- Set the <strong>title</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
- </p>
- <source>userAgent.setTitle("Invoice No 138716847");</source>
- </li>
- <li>
- <p>
- Set the <strong>keywords</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
- </p>
- <source>userAgent.setKeywords("XML XSL-FO");</source>
- </li>
- <li>
- <p>
- Set the <strong>target resolution</strong> for the document. This is used to
- specify the output resolution for bitmap images generated by bitmap renderers
- (such as the TIFF renderer) and by bitmaps generated by Apache Batik for filter
- effects and such. Default: 72 dpi. Example:
- </p>
- <source>userAgent.setTargetResolution(300); // =300dpi (dots/pixels per Inch)</source>
- </li>
- <li>
- <p>
- Set <strong>your own Document Handler</strong>. This feature can be used for several purposes, the most likey usage of which would probably be
- binding a MIME type when the output is Intermediate Format (see <a href="#documenthandlers">Document Handlers</a>). This also allows advanced
- users to create their own implementation of the document handler.
- </p>
- <source>userAgent.setDocumentHandlerOverride(documentHandler) // documentHandler is an instance of org.apache.fop.render.intermediate.IFDocumentHandler</source>
- </li>
- <li>
- <p>
- Set <strong>your own FOEventHandler instance</strong>. If you want to supply your own FOEventHandler or
- configure an FOEventHandler subclass in a special way you can give the instance to the FOUserAgent. Normally,
- the FOEventHandler instance is created by FOP. Example:
- </p>
- <source>userAgent.setFOEventHandlerOverride(myFOEventHandler); // myFOEventHandler is an org.apache.fop.fo.FOEventHandler</source>
- </li>
- <li>
- <p>
- Set a <strong>URIResolver</strong> for custom URI resolution. By supplying a JAXP URIResolver you can add
- custom URI resolution functionality to FOP. For example, you can use
- <a href="ext:xml.apache.org/commons/resolver">Apache XML Commons Resolver</a> to make use of XCatalogs. Example:
- </p>
- <source>userAgent.setURIResolver(myResolver); // myResolver is a javax.xml.transform.URIResolver</source>
- <note>
- Both the FopFactory and the FOUserAgent have a method to set a URIResolver. The URIResolver on the FOUserAgent is
- used for resolving URIs which are document-related. If it's not set or cannot resolve a URI, the URIResolver
- from the FopFactory is used.
- </note>
- </li>
- </ul>
- <note>
- You should not reuse an FOUserAgent instance between FOP rendering runs although you can. Especially
- in multi-threaded environment, this is a bad idea.
- </note>
- </section>
- </section>
- <section id="config-external">
- <title>Using a Configuration File</title>
- <p>
- Instead of setting the parameters manually in code as shown above you can also set
- many values from an XML configuration file:
- </p>
- <source><![CDATA[
-import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
-
-/*..*/
-
-DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
-Configuration cfg = cfgBuilder.buildFromFile(new File("C:/Temp/mycfg.xml"));
-fopFactory.setUserConfig(cfg);
-
-/* ..or.. */
-
-fopFactory.setUserConfig(new File("C:/Temp/mycfg.xml"));]]></source>
- <p>
- The layout of the configuration file is described on the <a href="configuration.html">Configuration page</a>.
- </p>
- </section>
- <section id="documenthandlers">
- <title>Document Handlers</title>
- <p>
- The document handlers are classes that inherit from <code>org.apache.fop.render.intermediate.IFDocumentHandler</code>. This
- is an interface for which a MIME type specific implementation can be created. This same handler is used either when XSL-FO
- is used as the input or when Intermediate Format is used. Since IF is output format agnostic, if custom fonts or other
- configuration information that affect layout (specific to a particular MIME type) are given then FOP needs that contextual
- information. The document handler provides that context so that when the IF is rendered, it is more visually consistent with
- FO rendering. The code below shows an example of how a document handler can be used to provide PDF configuration data to the
- IFSerializer.
- <source><![CDATA[
-IFDocumentHandler targetHandler = userAgent.getRendererFactory().createDocumentHandler(userAgent, MimeConstants.MIME_PDF);
-
-IFSerializer ifSerializer = new IFSerializer(); //Create the IFSerializer to write the intermediate format
-ifSerializer.setContext(new IFContext(userAgent));
-ifSerializer.mimicDocumentHandler(targetHandler); //Tell the IFSerializer to mimic the target format
-
-userAgent.setDocumentHandlerOverride(ifSerializer); //Make sure the prepared document handler is used
- ]]></source>
- The rest of the code is the same as in <a href="#basics">Basic Usage Patterns</a>.
- </p>
- </section>
- <section id="hints">
- <title>Hints</title>
- <section id="object-reuse">
- <title>Object reuse</title>
- <p>
- Fop instances shouldn't (and can't) be reused. Please recreate
- Fop and FOUserAgent instances for each rendering run using the FopFactory.
- This is a cheap operation as all reusable information is held in the
- FopFactory. That's why it's so important to reuse the FopFactory instance.
- </p>
- </section>
- <section id="awt">
- <title>AWT issues</title>
- <p>
- If your XSL-FO files contain SVG then Apache Batik will be used. When Batik is
- initialised it uses certain classes in <code>java.awt</code> that
- intialise the Java AWT classes. This means that a daemon thread
- is created by the JVM and on Unix it will need to connect to a
- DISPLAY.
- </p>
- <p>
- The thread means that the Java application may not automatically quit
- when finished, you will need to call <code>System.exit()</code>. These
- issues should be fixed in the JDK 1.4.
- </p>
- <p>
- If you run into trouble running FOP on a head-less server, please see the
- <a href="graphics.html#batik">notes on Batik</a>.
- </p>
- </section>
- <section id="render-info">
- <title>Getting information on the rendering process</title>
- <p>
- To get the number of pages that were rendered by FOP you can call
- <code>Fop.getResults()</code>. This returns a <code>FormattingResults</code> object
- where you can look up the number of pages produced. It also gives you the
- page-sequences that were produced along with their id attribute and their
- numbers of pages. This is particularly useful if you render multiple
- documents (each enclosed by a page-sequence) and have to know the number of
- pages of each document.
- </p>
- </section>
- </section>
- <section id="performance">
- <title>Improving performance</title>
- <p>
- There are several options to consider:
- </p>
- <ul>
- <li>
- Whenever possible, try to use SAX to couple the individual components involved
- (parser, XSL transformer, SQL datasource etc.).
- </li>
- <li>
- Depending on the target OutputStream (in case of a FileOutputStream, but not
- for a ByteArrayOutputStream, for example) it may improve performance considerably
- if you buffer the OutputStream using a BufferedOutputStream:
- <code>out = new java.io.BufferedOutputStream(out);</code>
- <br/>
- Make sure you properly close the OutputStream when FOP is finished.
- </li>
- <li>
- Cache the stylesheet. If you use the same stylesheet multiple times
- you can set up a JAXP <code>Templates</code> object and reuse it each time you do
- the XSL transformation. (More information can be found
- <a class="fork" href="http://www.javaworld.com/javaworld/jw-05-2003/jw-0502-xsl.html">here</a>.)
- </li>
- <li>
- Use an XSLT compiler like <a class="fork" href="http://xml.apache.org/xalan-j/xsltc_usage.html">XSLTC</a>
- that comes with Xalan-J.
- </li>
- <li>
- Fine-tune your stylesheet to make the XSLT process more efficient and to create XSL-FO that can
- be processed by FOP more efficiently. Less is more: Try to make use of property inheritance where possible.
- </li>
- <li>
- You may also wish to consider trying to reduce <a href="http://xmlgraphics.apache.org/fop/trunk/running.html#memory">memory usage</a>.
- </li>
- </ul>
- </section>
- <section id="multithreading">
- <title>Multithreading FOP</title>
- <p>
- Apache FOP may currently not be completely thread safe.
- The code has not been fully tested for multi-threading issues, yet.
- If you encounter any suspicious behaviour, please notify us.
- </p>
- <p>
- There is also a known issue with fonts being jumbled between threads when using
- the Java2D/AWT renderer (which is used by the -awt and -print output options).
- In general, you cannot safely run multiple threads through the AWT renderer.
- </p>
- </section>
-<section id="examples">
- <title>Examples</title>
- <p>
- The directory "{fop-dir}/examples/embedding" contains several working examples.
- </p>
- <section id="ExampleFO2PDF">
- <title>ExampleFO2PDF.java</title>
- <p>This
- <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleFO2PDF.java?view=markup">
- example</a>
-demonstrates the basic usage pattern to transform an XSL-FO
-file to PDF using FOP.
- </p>
- <figure src="images/EmbeddingExampleFO2PDF.png" alt="Example XSL-FO to PDF"/>
- </section>
- <section id="ExampleXML2FO">
- <title>ExampleXML2FO.java</title>
- <p>This
- <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2FO.java?view=markup">
- example</a>
-has nothing to do with FOP. It is there to show you how an XML
-file can be converted to XSL-FO using XSLT. The JAXP API is used to do the
-transformation. Make sure you've got a JAXP-compliant XSLT processor in your
-classpath (ex. <a href="http://xml.apache.org/xalan-j">Xalan</a>).
- </p>
- <figure src="images/EmbeddingExampleXML2FO.png" alt="Example XML to XSL-FO"/>
- </section>
- <section id="ExampleXML2PDF">
- <title>ExampleXML2PDF.java</title>
- <p>This
- <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2PDF.java?view=markup">
- example</a>
-demonstrates how you can convert an arbitrary XML file to PDF
-using XSLT and XSL-FO/FOP. It is a combination of the first two examples
-above. The example uses JAXP to transform the XML file to XSL-FO and FOP to
-transform the XSL-FO to PDF.
- </p>
- <figure src="images/EmbeddingExampleXML2PDF.png" alt="Example XML to PDF (via XSL-FO)"/>
- <p>
-The output (XSL-FO) from the XSL transformation is piped through to FOP using
-SAX events. This is the most efficient way to do this because the
-intermediate result doesn't have to be saved somewhere. Often, novice users
-save the intermediate result in a file, a byte array or a DOM tree. We
-strongly discourage you to do this if it isn't absolutely necessary. The
-performance is significantly higher with SAX.
- </p>
- </section>
- <section id="ExampleObj2XML">
- <title>ExampleObj2XML.java</title>
- <p>This
- <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleObj2XML.java?view=markup">
- example</a>
-is a preparatory example for the next one. It's an example that
-shows how an arbitrary Java object can be converted to XML. It's an often
-needed task to do this. Often people create a DOM tree from a Java object and
-use that. This is pretty straightforward. The example here, however, shows how
-to do this using SAX, which will probably be faster and not even more
-complicated once you know how this works.
- </p>
- <figure src="images/EmbeddingExampleObj2XML.png" alt="Example Java object to XML"/>
- <p>
-For this example we've created two classes: ProjectTeam and ProjectMember
-(found in xml-fop/examples/embedding/java/embedding/model). They represent
-the same data structure found in
-xml-fop/examples/embedding/xml/xml/projectteam.xml. We want to serialize to XML a
-project team with several members which exist as Java objects.
-Therefore we created the two classes: ProjectTeamInputSource and
-ProjectTeamXMLReader (in the same place as ProjectTeam above).
- </p>
- <p>
-The XMLReader implementation (regard it as a special kind of XML parser) is
-responsible for creating SAX events from the Java object. The InputSource
-class is only used to hold the ProjectTeam object to be used.
- </p>
- <p>
-Have a look at the source of ExampleObj2XML.java to find out how this is
-used. For more detailed information see other resources on JAXP (ex.
-<a class="fork" href="http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/xslt/3_generate.html">An older JAXP tutorial</a>).
- </p>
- </section>
- <section id="ExampleObj2PDF">
- <title>ExampleObj2PDF.java</title>
- <p>This
- <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleObj2PDF.java?view=markup">
- example</a>
-combines the previous and the third to demonstrate
-how you can transform a Java object to a PDF directly in one smooth run
-by generating SAX events from the Java object that get fed to an XSL
-transformation. The result of the transformation is then converted to PDF
-using FOP as before.
- </p>
- <figure src="images/EmbeddingExampleObj2PDF.png" alt="Example Java object to PDF (via XML and XSL-FO)"/>
- </section>
- <section id="ExampleDOM2PDF">
- <title>ExampleDOM2PDF.java</title>
- <p>This
- <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleDOM2PDF.java?view=markup">
- example</a>
-has FOP use a DOMSource instead of a StreamSource in order to
-use a DOM tree as input for an XSL transformation.
- </p>
- </section>
- <section id="ExampleSVG2PDF">
- <title>ExampleSVG2PDF.java (PDF Transcoder example)</title>
- <p>This
- <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleSVG2PDF.java?view=markup">
- example</a>
-shows the usage of the PDF Transcoder, a sub-application within FOP.
-It is used to generate a PDF document from an SVG file.
- </p>
- </section>
- <section id="ExampleConcat">
- <title>ExampleConcat.java (IF Concatenation example)</title>
- <p>
-This can be found in the <code>embedding.intermediate</code> package within the
-examples and describes how IF can be concatenated to produce a document. Because
-IF has been through FOPs layout engine, it should be visually consistent with FO
-rendered documents while allowing the user to merge numerous documents together.
- </p>
- </section>
- <section id="example-notes">
- <title>Final notes</title>
- <p>
-These examples should give you an idea of what's possible. It should be easy
-to adjust these examples to your needs. Also, if you have other examples that you
-think should be added here, please let us know via either the fop-users or fop-dev
-mailing lists. Finally, for more help please send your questions to the fop-users
-mailing list.
- </p>
- </section>
-</section>
- </body>
-</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1rc1/events.xml b/src/documentation/content/xdocs/1.1rc1/events.xml
deleted file mode 100644
index 27daad59b..000000000
--- a/src/documentation/content/xdocs/1.1rc1/events.xml
+++ /dev/null
@@ -1,449 +0,0 @@
-<?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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP: Events/Processing Feedback</title>
- <version>$Revision$</version>
- </header>
- <body>
- <section id="introduction">
- <title>Introduction</title>
- <p>
- In versions until 0.20.5, Apacheâ„¢ FOP used
- <a href="http://excalibur.apache.org/framework/index.html">Avalon-style Logging</a> where
- it was possible to supply a logger per processing run. During the redesign
- the logging infrastructure was switched over to
- <a href="http://commons.apache.org/logging/">Commons Logging</a> which is (like Log4J or
- java.util.logging) a "static" logging framework (the logger is accessed through static
- variables). This made it very difficult in a multi-threaded system to retrieve information
- for a single processing run.
- </p>
- <p>
- With FOP's event subsystem, we'd like to close this gap again and even go further. The
- first point is to realize that we have two kinds of "logging". Firstly, we have the logging
- infrastructure for the (FOP) developer who needs to be able to enable finer log messages
- for certain parts of FOP to track down a certain problem. Secondly, we have the user who
- would like to be informed about missing images, overflowing lines or substituted fonts.
- These messages (or events) are targeted at less technical people and may ideally be
- localized (translated). Furthermore, tool and solution builders would like to integrate
- FOP into their own solutions. For example, an FO editor should be able to point the user
- to the right place where a particular problem occurred while developing a document template.
- Finally, some integrators would like to abort processing if a resource (an image or a font)
- has not been found, while others would simply continue. The event system allows to
- react on these events.
- </p>
- <p>
- On this page, we won't discuss logging as such. We will show how the event subsystem can
- be used for various tasks. We'll first look at the event subsystem from the consumer side.
- Finally, the production of events inside FOP will be discussed (this is mostly interesting
- for FOP developers only).
- </p>
- </section>
- <section id="consumer">
- <title>The consumer side</title>
- <p>
- The event subsystem is located in the <code>org.apache.fop.events</code> package and its
- base is the <code>Event</code> class. An instance is created for each event and is sent
- to a set of <code>EventListener</code> instances by the <code>EventBroadcaster</code>.
- An <code>Event</code> contains:
- </p>
- <ul>
- <li>an event ID,</li>
- <li>a source object (which generated the event),</li>
- <li>a severity level (Info, Warning, Error and Fatal Error) and</li>
- <li>a map of named parameters.</li>
- </ul>
- <p>
- The <code>EventFormatter</code> class can be used to translate the events into
- human-readable, localized messages.
- </p>
- <p>
- A full example of what is shown here can be found in the
- <code>examples/embedding/java/embedding/events</code> directory in the FOP distribution.
- The example can also be accessed
- <a href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/events/">via the web</a>.
- </p>
- <section id="write-listener">
- <title>Writing an EventListener</title>
- <p>
- The following code sample shows a very simple EventListener. It basically just sends
- all events to System.out (stdout) or System.err (stderr) depending on the event severity.
- </p>
- <source><![CDATA[import org.apache.fop.events.Event;
-import org.apache.fop.events.EventFormatter;
-import org.apache.fop.events.EventListener;
-import org.apache.fop.events.model.EventSeverity;
-
-/** A simple event listener that writes the events to stdout and stderr. */
-public class SysOutEventListener implements EventListener {
-
- /** {@inheritDoc} */
- public void processEvent(Event event) {
- String msg = EventFormatter.format(event);
- EventSeverity severity = event.getSeverity();
- if (severity == EventSeverity.INFO) {
- System.out.println("[INFO ] " + msg);
- } else if (severity == EventSeverity.WARN) {
- System.out.println("[WARN ] " + msg);
- } else if (severity == EventSeverity.ERROR) {
- System.err.println("[ERROR] " + msg);
- } else if (severity == EventSeverity.FATAL) {
- System.err.println("[FATAL] " + msg);
- } else {
- assert false;
- }
- }
-}]]></source>
- <p>
- You can see that for every event the method <code>processEvent</code> of the
- <code>EventListener</code> will be called. Inside this method you can do whatever
- processing you would like including throwing a <code>RuntimeException</code>, if you want
- to abort the current processing run.
- </p>
- <p>
- The code above also shows how you can turn an event into a human-readable, localized
- message that can be presented to a user. The <code>EventFormatter</code> class does
- this for you. It provides additional methods if you'd like to explicitly specify
- the locale.
- </p>
- <p>
- It is possible to gather all events for a whole processing run so they can be
- evaluated afterwards. However, care should be taken about memory consumption since
- the events provide references to objects inside FOP which may themselves have
- references to other objects. So holding on to these objects may mean that whole
- object trees cannot be released!
- </p>
- </section>
- <section id="add-listener">
- <title>Adding an EventListener</title>
- <p>
- To register the event listener with FOP, get the <code>EventBroadcaster</code> which
- is associated with the user agent (<code>FOUserAgent</code>) and add it there:
- </p>
- <source><![CDATA[FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
-foUserAgent.getEventBroadcaster().addEventListener(new SysOutEventListener());]]></source>
- <p>
- Please note that this is done separately for each processing run, i.e. for each
- new user agent.
- </p>
- </section>
- <section id="listener-example1">
- <title>An additional listener example</title>
- <p>
- Here's an additional example of an event listener:
- </p>
- <p>
- By default, FOP continues processing even if an image wasn't found. If you have
- more strict requirements and want FOP to stop if an image is not available, you can
- do something like the following in the simplest case:
- </p>
- <source><![CDATA[public class MyEventListener implements EventListener {
-
- public void processEvent(Event event) {
- if ("org.apache.fop.ResourceEventProducer".equals(
- event.getEventGroupID())) {
- event.setSeverity(EventSeverity.FATAL);
- } else {
- //ignore all other events (or do something of your choice)
- }
- }
-
-}]]></source>
- <p>
- Increasing the event severity to FATAL will signal the event broadcaster to throw
- an exception and stop further processing. In the above case, all resource-related
- events will cause FOP to stop processing.
- </p>
- <p>
- You can also customize the exception to throw (you can may throw a RuntimeException
- or subclass yourself) and/or which event to respond to:
- </p>
- <source><![CDATA[public class MyEventListener implements EventListener {
-
- public void processEvent(Event event) {
- if ("org.apache.fop.ResourceEventProducer.imageNotFound"
- .equals(event.getEventID())) {
-
- //Get the FileNotFoundException that's part of the event's parameters
- FileNotFoundException fnfe = (FileNotFoundException)event.getParam("fnfe");
-
- throw new RuntimeException(EventFormatter.format(event), fnfe);
- } else {
- //ignore all other events (or do something of your choice)
- }
- }
-
-}]]></source>
- <p>
- This throws a <code>RuntimeException</code> with the <code>FileNotFoundException</code>
- as the cause. Further processing effectively stops in FOP. You can catch the exception
- in your code and react as you see necessary.
- </p>
- </section>
- </section>
- <section id="producer">
- <title>The producer side (for FOP developers)</title>
- <p>
- This section is primarily for FOP and FOP plug-in developers. It describes how to use
- the event subsystem for producing events.
- </p>
- <note>
- The event package has been designed in order to be theoretically useful for use cases
- outside FOP. If you think this is interesting independently from FOP, please talk to
- <a href="mailto:fop-dev@xmlgraphics.apache.org">us</a>.
- </note>
- <section id="basic-event-production">
- <title>Producing and sending an event</title>
- <p>
- The basics are very simple. Just instantiate an <code>Event</code> object and fill
- it with the necessary parameters. Then pass it to the <code>EventBroadcaster</code>
- which distributes the events to the interested listeneners. Here's a code example:
- </p>
- <source><![CDATA[Event ev = new Event(this, "complain", EventSeverity.WARN,
- Event.paramsBuilder()
- .param("reason", "I'm tired")
- .param("blah", new Integer(23))
- .build());
-EventBroadcaster broadcaster = [get it from somewhere];
-broadcaster.broadcastEvent(ev);
-]]></source>
- <p>
- The <code>Event.paramsBuilder()</code> is a
- <a href="http://en.wikipedia.org/wiki/Fluent_interface">fluent interface</a>
- to help with the build-up of the parameters. You could just as well instantiate a
- <code>Map</code> (<code>Map&lt;String, Object&gt;</code>) and fill it with values.
- </p>
- </section>
- <section id="event-producer">
- <title>The EventProducer interface</title>
- <p>
- To simplify event production, the event subsystem provides the <code>EventProducer</code>
- interface. You can create interfaces which extend <code>EventProducer</code>. These
- interfaces will contain one method per event to be generated. By contract, each event
- method must have as its first parameter a parameter named "source" (Type Object) which
- indicates the object that generated the event. After that come an arbitrary number of
- parameters of any type as needed by the event.
- </p>
- <p>
- The event producer interface does not need to have any implementation. The implementation
- is produced at runtime by a dynamic proxy created by <code>DefaultEventBroadcaster</code>.
- The dynamic proxy creates <code>Event</code> instances for each method call against
- the event producer interface. Each parameter (except "source") is added to the event's
- parameter map.
- </p>
- <p>
- To simplify the code needed to get an instance of the event producer interface it is
- suggested to create a public inner provider class inside the interface.
- </p>
- <p>
- Here's an example of such an event producer interface:
- </p>
- <source><![CDATA[public interface MyEventProducer extends EventProducer {
-
- public class Provider {
-
- public static MyEventProducer get(EventBroadcaster broadcaster) {
- return (MyEventProducer)broadcaster.getEventProducerFor(MyEventProducer.class);
- }
- }
-
- /**
- * Complain about something.
- * @param source the event source
- * @param reason the reason for the complaint
- * @param blah the complaint
- * @event.severity WARN
- */
- void complain(Object source, String reason, int blah);
-
-}]]></source>
- <p>
- To produce the same event as in the first example above, you'd use the following code:
- </p>
- <source><![CDATA[EventBroadcaster broadcaster = [get it from somewhere];
-TestEventProducer producer = TestEventProducer.Provider.get(broadcaster);
-producer.complain(this, "I'm tired", 23);]]></source>
- </section>
- <section id="event-model">
- <title>The event model</title>
- <p>
- Inside an invocation handler for a dynamic proxy, there's no information about
- the names of each parameter. The JVM doesn't provide it. The only thing you know is
- the interface and method name. In order to properly fill the <code>Event</code>'s
- parameter map we need to know the parameter names. These are retrieved from an
- event object model. This is found in the <code>org.apache.fop.events.model</code>
- package. The data for the object model is retrieved from an XML representation of the
- event model that is loaded as a resource. The XML representation is generated using an
- Ant task at build time (<code>ant resourcegen</code>). The Ant task (found in
- <code>src/codegen/java/org/apache/fop/tools/EventProducerCollectorTask.java</code>)
- scans FOP's sources for descendants of the <code>EventProducer</code> interface and
- uses <a href="http://qdox.codehaus.org/">QDox</a> to parse these interfaces.
- </p>
- <p>
- The event model XML files are generated during build by the Ant task mentioned above when
- running the "resourcegen" task. So just run <code>"ant resourcegen"</code> if you receive
- a <code>MissingResourceException</code> at runtime indicating that
- <code>"event-model.xml"</code> is missing.
- </p>
- <p>
- Primarily, the QDox-based collector task records the parameters' names and types.
- Furthermore, it extracts additional attributes embedded as Javadoc comments from
- the methods. At the moment, the only such attribute is "@event.severity" which indicates
- the default event severity (which can be changed by event listeners). The example event
- producer above shows the Javadocs for an event method.
- </p>
- <p>
- There's one more information that is extracted from the event producer information for
- the event model: an optional primary exception. The first exception in the "throws"
- declaration of an event method is noted. It is used to throw an exception from
- the invocation handler if the event has an event severity of "FATAL" when all
- listeners have been called (listeners can update the event severity). Please note
- that an implementation of
- <code>org.apache.fop.events.EventExceptionManager$ExceptionFactory</code> has to be
- registered for the <code>EventExceptionManager</code> to be able to construct the
- exception from an event.
- </p>
- <p>
- For a given application, there can be multiple event models active at the same time.
- In FOP, each renderer is considered to be a plug-in and provides its own specific
- event model. The individual event models are provided through an
- <code>EventModelFactory</code>. This interface is implemented for each event model
- and registered through the service provider mechanism
- (see the <a href="#plug-ins">plug-ins section</a> for details).
- </p>
- </section>
- <section id="event-severity">
- <title>Event severity</title>
- <p>
- Four different levels of severity for events has been defined:
- </p>
- <ol>
- <li>INFO: informational only</li>
- <li>WARN: a Warning</li>
- <li>ERROR: an error condition from which FOP can recover. FOP will continue processing.</li>
- <li>FATAL: a fatal error which causes an exception in the end and FOP will stop processing.</li>
- </ol>
- <p>
- Event listeners can choose to ignore certain events based on their event severity.
- Please note that you may recieve an event "twice" in a specific case: if there is
- a fatal error an event is generated and sent to the listeners. After that an exception
- is thrown with the same information and processing stops. If the fatal event is
- shown to the user and the following exception is equally presented to the user it
- may appear that the event is duplicated. Of course, the same information is just
- published through two different channels.
- </p>
- </section>
- <section id="plug-ins">
- <title>Plug-ins to the event subsystem</title>
- <p>
- The event subsystem is extensible. There are a number of extension points:
- </p>
- <ul>
- <li>
- <strong><code>org.apache.fop.events.model.EventModelFactory</code>:</strong> Provides
- an event model to the event subsystem.
- </li>
- <li>
- <strong><code>org.apache.fop.events.EventExceptionManager$ExceptionFactory</code>:</strong>
- Creates exceptions for events, i.e. turns an event into a specific exception.
- </li>
- </ul>
- <p>
- The names in bold above are used as filenames for the service provider files that
- are placed in the <code>META-INF/services</code> directory. That way, they are
- automatically detected. This is a mechanism defined by the
- <a href="http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Service%20Provider">JAR file specification</a>.
- </p>
- </section>
- <section id="l10n">
- <title>Localization (L10n)</title>
- <p>
- One goal of the event subsystem was to have localized (translated) event messages.
- The <code>EventFormatter</code> class can be used to convert an event to a
- human-readable message. Each <code>EventProducer</code> can provide its own XML-based
- translation file. If there is none, a central translation file is used, called
- "EventFormatter.xml" (found in the same directory as the <code>EventFormatter</code>
- class).
- </p>
- <p>
- The XML format used by the <code>EventFormatter</code> is the same as
- <a href="ext:cocoon">Apache Cocoon's</a> catalog format. Here's an example:
- </p>
- <source><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<catalogue xml:lang="en">
- <message key="locator">
- [ (See position {loc})| (See {#gatherContextInfo})| (No context info available)]
- </message>
- <message key="org.apache.fop.render.rtf.RTFEventProducer.explicitTableColumnsRequired">
- RTF output requires that all table-columns for a table are defined. Output will be incorrect.{{locator}}
- </message>
- <message key="org.apache.fop.render.rtf.RTFEventProducer.ignoredDeferredEvent">
- Ignored deferred event for {node} ({start,if,start,end}).{{locator}}
- </message>
-</catalogue>
-]]></source>
- <p>
- The example (extracted from the RTF handler's event producer) has message templates for
- two event methods. The class used to do variable replacement in the templates is
- <code>org.apache.fop.util.text.AdvancedMessageFormat</code> which is more powerful
- than the <code>MessageFormat</code> classes provided by the Java class library
- (<code>java.util.text</code> package).
- </p>
- <p>
- "locator" is a template that is reused by the other message templates
- by referencing it through "{{locator}}". This is some kind of include command.
- </p>
- <p>
- Normal event parameters are accessed by name inside single curly braces, for example:
- "{node}". For objects, this format just uses the <code>toString()</code> method to turn
- the object into a string, unless there is an <code>ObjectFormatter</code> registered
- for that type (there's an example for <code>org.xml.sax.Locator</code>).
- </p>
- <p>
- The single curly braces pattern supports additional features. For example, it is possible
- to do this: "{start,if,start,end}". "if" here is a special field modifier that evaluates
- "start" as a boolean and if that is true returns the text right after the second comma
- ("start"). Otherwise it returns the text after the third comma ("end"). The "equals"
- modifier is similar to "if" but it takes as an additional (comma-separated) parameter
- right after the "equals" modifier, a string that is compared to the value of the variable.
- An example: {severity,equals,EventSeverity:FATAL,,some text} (this adds "some text" if
- the severity is not FATAL).
- </p>
- <p>
- Additional such modifiers can be added by implementing the
- <code>AdvancedMessageFormat$Part</code> and <code>AdvancedMessageFormat$PartFactory</code>
- interfaces.
- </p>
- <p>
- Square braces can be used to specify optional template sections. The whole section will
- be omitted if any of the variables used within are unavailable. Pipe (|) characters can
- be used to specify alternative sub-templates (see "locator" above for an example).
- </p>
- <p>
- Developers can also register a function (in the above example:
- <code>{#gatherContextInfo})</code>
- to do more complex information rendering. These functions are implementations of the
- <code>AdvancedMessageFormat$Function</code> interface. Please take care that this is
- done in a locale-independent way as there is no locale information available, yet.
- </p>
- </section>
- </section>
- </body>
-</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1rc1/extensions.xml b/src/documentation/content/xdocs/1.1rc1/extensions.xml
deleted file mode 100644
index 02d83db96..000000000
--- a/src/documentation/content/xdocs/1.1rc1/extensions.xml
+++ /dev/null
@@ -1,339 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<document>
- <header>
- <title>Standard Apacheâ„¢ FOP Extensions</title>
- <version>$Revision$</version>
- </header>
- <body>
- <p>
- By "extension", we mean any data that can be placed in the input XML document that
- is not addressed by the XSL-FO standard.
- By having a mechanism for supporting extensions, Apacheâ„¢ FOP is able to add features that
- are not covered in the specification.
- </p>
- <p>
- The extensions documented here are included with FOP, and are automatically available
- to you. If you wish to add an extension of your own to FOP, please see the
- <a href="../dev/extensions.html">Developers' Extension Page</a>.
- </p>
- <note>All extensions require the correct use of an appropriate namespace in your input document.</note>
- <section id="svg">
- <title>SVG</title>
- <p>
- Please see the <a href="graphics.html#svg">SVG documentation</a> for more details.
- </p>
- </section>
- <section id="fo-extensions">
- <title>FO Extensions</title>
- <section id="fox-namespace">
- <title>Namespace</title>
- <p>
- By convention, FO extensions in FOP use the "fox" namespace prefix.
- To use any of the FO extensions, add a namespace entry for
- <code>http://xmlgraphics.apache.org/fop/extensions</code> to the root element:
- </p>
- <source><![CDATA[<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">]]></source>
- </section>
- <section id="bookmarks">
- <title>PDF Bookmarks</title>
- <p>
- In old versions of Apache FOP there was a <code>fox:outline</code> element
- which was used to create outlines in PDF files. The redesigned code makes use
- of the <a href="http://www.w3.org/TR/xsl11/#fo_bookmark-tree">bookmark feature defined in the W3C XSL 1.1 standard</a>.
- </p>
- </section>
- <section id="named-destinations">
- <title>Anchors or Named Destinations</title>
- <p>Use the fox:destination element to define "named destinations" inside a PDF document.
-These are useful as fragment identifiers, e.g. "http://server/document.pdf#anchor-name".
-fox:destination elements can be placed almost anywhere in the fo document, including a child of
-root, a block-level element, or an inline-level element.
-For the destination to actually work, it must correspond to an "id" attribute on some fo element
-within the document. In other words, the "id" attribute actually creates the "view" within the
-PDF document. The fox:destination simply gives that view an independent name.
-</p>
- <source><![CDATA[<fox:destination internal-destination="table-of-contents"/>
-...
-<fo:block id="table-of-contents">Table of Contents</fo:block>]]></source>
- <warning>It is possible that in some future release of FOP, <em>all </em>elements with
-"id" attributes will generate named-destinations, which will eliminate the need for
-fox:destination.</warning>
- </section>
- <section id="table-continue-label">
- <title>Table Continuation Label</title>
- <p>This extension element hasn't been reimplemented for the redesigned code, yet.</p>
- <!--p>Use the fox:continued-label element to create content in table-header and
-table-footer cells that will appear only on pages after the first page that the table
-appears. fox:continued-label is itself inline content, and is a container of fo:inline
-content. This content will be laid out only if the table does not fit on a single page and flows
-to following pages. Here is an example of FO code creating such a table-header:</p>
-<source><![CDATA[<fo:table-header>
- <fo:table-row>
- <fo:table-cell>
- <fo:block>Header column 1 with continued label
- <fox:continued-label><fo:inline> (cont.)</fo:inline></fox:continued-label>
- </fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block>Header column 2 with no continued label</fo:block>
- </fo:table-cell>
- </fo:table-row>
-</fo:table-header>]]></source-->
- </section>
- <section id="widow-orphan-content-limit">
- <title>fox:orphan-content-limit and fox:widow-content-limit</title>
- <p>
- The two proprietary extension properties, fox:orphan-content-limit and
- fox:widow-content-limit, are used to improve the layout of list-blocks and tables.
- If you have a table with many entries, you don't want a single row to be left over
- on a page. You will want to make sure that at least two or three lines are kept
- together. The properties take an absolute length which specifies the area at the
- beginning (fox:widow-content-limit) or at the end (fox:orphan-content-limit) of a
- table or list-block. The properties are inherited and only have an effect on fo:table
- and fo:list-block. An example: fox:widow-content-limit="3 * 1.2em" would make sure
- the you'll have at least three lines (assuming line-height="1.2") together on a table
- or list-block.
- </p>
- </section>
- <section id="external-document">
- <title>fox:external-document</title>
- <note>
- This feature is incomplete. Support for multi-page documents will be added shortly.
- At the moment, only single-page images will work. And this will not work with RTF output.
- </note>
- <p>
- This is a proprietary extension element which allows to add whole images as pages to
- an FO document. For example, if you have a scanned document or a fax as multi-page TIFF
- file, you can append or insert this document using the <code>fox:external-document</code>
- element. Each page of the external document will create one full page in the target
- format.
- </p>
- <p>
- The <code>fox:external-document</code> element is structurally a peer to
- <code>fo:page-sequence</code>, so wherever you can put an <code>fo:page-sequence</code>
- you could also place a <code>fox:external-document</code>.
- Therefore, the specified contents for <code>fo:root</code> change to:
- </p>
- <p>
- <code>
- (layout-master-set, declarations?, bookmark-tree?, (page-sequence|page-sequence-wrapper|fox:external-document|fox:destination)+)
- </code>
- </p>
- <section>
- <title>Specification</title>
- <p>
- The <code>fox:external-document</code> extension formatting object is used to specify
- how to create a (sub-)sequence of pages within a document. The content of these pages
- comes from the individual subimages/pages of an image or paged document (for example:
- multi-page TIFF in the form of faxes or scanned documents, or PDF files). The
- formatting object creates the necessary areas to display one image per page.
- </p>
- <p>
- In terms of page numbers, the behaviour is the same as for
- <code>fo:page-sequence</code>. The placement of the image inside the page is similar
- to that of <code>fo:external-graphic</code> or <code>fo:instream-foreign-object</code>,
- i.e. the viewport (and therefore the page size) is defined by either the intrinsic
- size of the image or by the size properties that apply to this formatting object.
- </p>
- <p>Content: EMPTY</p>
- <p>The following properties apply to this formatting object:</p>
- <ul>
- <li>(Common Accessibility Properties) (not implemented, yet)</li>
- <li>(Common Aural Properties) (not implemented, yet)</li>
- <li>block-progression-dimension</li>
- <li>content-height</li>
- <li>content-type</li>
- <li>content-width</li>
- <li>display-align</li>
- <li>height</li>
- <li>id</li>
- <li>inline-progression-dimension</li>
- <li>overflow</li>
- <li>pages: &lt;page-set&gt; (see below) (not implemented, yet)</li>
- <li>reference-orientation</li>
- <li>scaling</li>
- <li>scaling-method</li>
- <li>src</li>
- <li>text-align</li>
- <li>width</li>
- </ul>
- <p>
- Datatype "page-set": Value: auto | &lt;integer-range&gt;,
- Default: "auto" which means all pages/subimages of the document.
- &lt;integer-range&gt; allows values such as "7" or "1-3"
- </p>
- <note>
- <code>fox:external-document</code> is not suitable for concatenating FO documents.
- For this, XInclude is recommended.
- </note>
- </section>
- </section>
- <section id="transform">
- <title>Free-form Transformation for fo:block-container</title>
- <p>
- For <code>fo:block-container</code> elements whose <code>absolute-position</code> set to
- "absolute" or "fixed" you can use the extension attribute <code>fox:transform</code>
- to apply a free-form transformation to the whole block-container. The content of the
- <code>fox:transform</code> attribute is the same as for
- <a href="http://www.w3.org/TR/SVG/coords.html#TransformAttribute">SVG's transform attribute</a>.
- The transformation specified here is performed in addition to other implicit
- transformations of the block-container (resulting from top, left and other properties)
- and after them.
- </p>
- <p>
- Examples: <code>fox:transform="rotate(45)"</code> would rotate the block-container
- by 45 degrees clock-wise around its upper-left corner.
- <code>fox:transform="translate(10000,0)"</code> would move the block-container to the
- right by 10 points (=10000 millipoints, FOP uses millipoints internally!).
- </p>
- <note>
- This extension attribute doesn't work for all output formats! It's currently only
- supported for PDF, PS and Java2D-based renderers.
- </note>
- </section>
- <section id="color-functions">
- <title>Color functions</title>
- <p>
- XSL-FO supports specifying color using the rgb(), rgb-icc() and system-color() functions.
- Apache FOP provides additional color functions for special use cases. Please note that
- using these functions compromises the interoperability of an FO document.
- </p>
- <section id="color-function-cmyk">
- <title>cmyk()</title>
- <p><code>color cmyk(numeric, numeric, numeric, numeric)</code></p>
- <p>
- This function will construct a color in device-specific CMYK color space. The numbers
- must be between 0.0 and 1.0. For output formats that don't support device-specific
- color space the CMYK value is converted to an sRGB value.
- </p>
- </section>
- <section id="pseudo-color-profiles">
- <title>#CMYK pseudo-profile</title>
- <p><code>color rgb-icc(numeric, numeric, numeric, #CMYK, numeric, numeric, numeric, numeric)</code></p>
- <p>
- The <code>rgb-icc</code> function will respond to a pseudo-profile called "#CMYK"
- which indicates a device-specific CMYK color space. The "#CMYK" profile is implicitely
- available and doesn't have to be (and cannot be) defined through an
- <code>fo:color-profile</code> element. It is provided for compatibility with certain
- commercial XSL-FO implementations. Please note that this is not part of the official
- specification but rather a convention. The following two color specifications are
- equivalent:
- </p>
- <ul>
- <li><code>cmyk(0%,0%,20%,40%)</code></li>
- <li><code>rgb-icc(153, 153, 102, #CMYK, 0, 0, 0.2, 0.4)</code></li>
- </ul>
- </section>
- </section>
- <section id="prepress">
- <title>Prepress Support</title>
-
- <p>
- This section defines a number of extensions related to
- <a href="http://en.wikipedia.org/wiki/Prepress">prepress</a> support.
- <code>fox:scale</code> defines a general scale factor for the generated pages.
- <code>fox:bleed</code> defines the
- <a href="http://en.wikipedia.org/wiki/Bleed_%28printing%29">bleed area</a> for a page.
- <code>fox:crop-offset</code> defines the outer edges of the area in which crop marks,
- registration marks, color bars and page information are placed.
- For details, please read on below.
- </p>
- <note>
- Those extensions have been implemented in the PDF and Java2D renderers only.
- </note>
-
- <section id="scale">
- <title>fox:scale</title>
- <p>Value: &lt;number&gt;{1,2}</p>
- <p>Initial: 1</p>
- <p>Applies to: fo:simple-page-master</p>
- <p>
- This property specifies a scale factor along resp. the x and y axes. If only one number
- is provided it is used for both the x and y scales. A scale factor smaller than 1
- shrinks the page. A scale factor greater than 1 enlarges the page.
- </p>
- </section>
- <section id="bleed">
- <title>fox:bleed</title>
- <p>
- Value: &lt;length&gt;{1,4}
- </p>
- <p>
- Initial: 0pt
- </p>
- <p>Applies to: fo:simple-page-master</p>
- <p>
- If there is only one value, it applies to all sides. If there are two values, the top and bottom
- bleed widths are set to the first value and the right and left bleed widths are set to the second.
- If there are three values, the top is set to the first value, the left and right are set to the second,
- and the bottom is set to the third. If there are four values, they apply to the top, right, bottom, and
- left, respectively.
- (Corresponds to <a href="http://www.w3.org/TR/xsl11/#padding">the definition of
- padding</a>).
- </p>
- <p>
- This extension indirectly defines the BleedBox and is calculated by expanding the TrimBox by
- the bleed widths. The lengths must be non-negative.
- </p>
- </section>
- <section id="cropOffset">
- <title>fox:crop-offset</title>
- <p>
- Value: &lt;length&gt;{1,4}
- </p>
- <p>
- Initial: bleed (see below)
- </p>
- <p>Applies to: fo:simple-page-master</p>
- <p>
- Same behaviour as with fox:bleed. The initial value is set to the same values as the
- fox:bleed property.
- </p>
- <p>
- This extension indirectly defines the MediaBox and is calculated by expanding
- the TrimBox by the crop offsets. The lengths must be non-negative.
- </p>
- </section>
- <section id="cropBox">
- <title>fox:crop-box</title>
- <p>
- Value: [trim-box | bleed-box | media-box]
- </p>
- <p>
- Initial: media-box
- </p>
- <p>Applies to: fo:simple-page-master</p>
- <p>
- The crop box controls how Acrobat displays the page (CropBox in PDF) or how the Java2DRenderer sizes
- the output media. The PDF specification defines that the CropBox defaults to the MediaBox. This extension
- follows that definition. To simplify usage and cover most use cases, the three supported enumeration
- values "trim-box", "bleed-box" and "media-box" set the CropBox to one of those three other boxes.
- </p>
- <p>
- If requested in the future, we could offer to specify the CropBox in absolute coordinates rather
- than just by referencing another box.
- </p>
- </section>
- </section>
- </section>
- </body>
-</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1rc1/fonts.xml b/src/documentation/content/xdocs/1.1rc1/fonts.xml
deleted file mode 100644
index f3481607d..000000000
--- a/src/documentation/content/xdocs/1.1rc1/fonts.xml
+++ /dev/null
@@ -1,579 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP: Fonts</title>
- <version>$Revision$</version>
- <authors>
- <person name="Jeremias M&#xE4;rki" email=""/>
- <person name="Tore Engvig" email=""/>
- <person name="Adrian Cumiskey" email=""/>
- <person name="Max Berger" email=""/>
- </authors>
- </header>
- <body>
- <section id="intro">
- <title>Summary</title>
- <p>The following table summarizes the font capabilities of the various Apache� FOP renderers:</p>
- <table>
- <tr>
- <th>Renderer</th>
- <th>Base-14</th>
- <th>AWT/OS</th>
- <th>Custom</th>
- <th>Custom Embedding</th>
- </tr>
- <tr>
- <td>PDF</td>
- <td>yes</td>
- <td>no</td>
- <td>yes</td>
- <td>yes</td>
- </tr>
- <tr>
- <td>PostScript</td>
- <td>yes</td>
- <td>no</td>
- <td>yes</td>
- <td>yes</td>
- </tr>
- <tr>
- <td>PCL</td>
- <td>yes (modified)</td>
- <td>yes (painted as bitmaps)</td>
- <td>yes (painted as bitmaps)</td>
- <td>no</td>
- </tr>
- <tr>
- <td>AFP</td>
- <td>no</td>
- <td>no</td>
- <td>yes</td>
- <td>yes</td>
- </tr>
- <tr>
- <td>Java2D/AWT/Bitmap</td>
- <td>if available from OS</td>
- <td>yes</td>
- <td>yes</td>
- <td>n/a (display only)</td>
- </tr>
- <tr>
- <td>Print</td>
- <td>if available from OS</td>
- <td>yes</td>
- <td>yes</td>
- <td>controlled by OS printer driver</td>
- </tr>
- <tr>
- <td>RTF</td>
- <td>n/a (font metrics not needed)</td>
- <td>n/a</td>
- <td>n/a</td>
- <td>n/a</td>
- </tr>
- <tr>
- <td>TXT</td>
- <td>yes (used for layout but not for output)</td>
- <td>no</td>
- <td>yes (used for layout but not for output)</td>
- <td>no</td>
- </tr>
-<!--tr> NOT AVAILABLE
- <td>MIF</td>
- <td>n/a (font metrics not needed)</td>
- <td>n/a</td>
- <td>n/a</td>
- <td>n/a</td>
- </tr-->
-<!--tr> NOT AVAILABLE
- <td>SVG</td>
- <td>if available from OS</td>
- <td>yes</td>
- <td>no</td>
- <td>no</td>
- </tr-->
- <tr>
- <td>XML</td>
- <td>yes</td>
- <td>no</td>
- <td>yes</td>
- <td>n/a</td>
- </tr>
- </table>
- </section>
- <section>
- <title>Base-14 Fonts</title>
- <p>
- The Adobe PostScript and PDF Specification specify a set of 14 fonts that must be
- available to every PostScript interpreter and PDF reader:
- Helvetica (normal, bold, italic, bold italic),
- Times (normal, bold, italic, bold italic),
- Courier (normal, bold, italic, bold italic),
- Symbol and ZapfDingbats.
- </p>
- <p>
- The following font family names are hard-coded into FOP for the Base-14 font set:
- </p>
- <table>
- <tr>
- <th>Base-14 font</th>
- <th>font families</th>
- </tr>
- <tr>
- <td>Helvetica</td>
- <td>Helvetica, sans-serif, SansSerif</td>
- </tr>
- <tr>
- <td>Times</td>
- <td>Times, Times Roman, Times-Roman, serif, any</td>
- </tr>
- <tr>
- <td>Courier</td>
- <td>Courier, monospace, Monospaced</td>
- </tr>
- <tr>
- <td>Symbol</td>
- <td>Symbol</td>
- </tr>
- <tr>
- <td>ZapfDingbats</td>
- <td>ZapfDingbats</td>
- </tr>
- </table>
- <p>
- Please note that recent versions of Adobe Acrobat Reader replace
- "Helvetica" with "Arial" and "Times" with "Times New Roman" internally.
- GhostScript replaces "Helvetica" with "Nimbus Sans L" and "Times" with
- "Nimbus Roman No9 L". Other document viewers may do similar font
- substitutions. If you need to make sure that there are no such
- substitutions, you need to specify an explicit font and embed it in
- the target document.
- </p>
- </section>
- <section id="missing-fonts">
- <title>Missing Fonts</title>
- <p>
- When FOP does not have a specific font at its disposal (because it's
- not installed in the operating system or set up in FOP's configuration),
- the font is replaced with "any". "any" is internally mapped to the
- Base-14 font "Times" (see above).
- </p>
- </section>
- <section id="missing-glyphs">
- <title>Missing Glyphs</title>
- <p>
- Every font contains a particular set of
- <a href="http://en.wikipedia.org/wiki/Glyph">glyphs</a>. If no glyph can be found for
- a given character, FOP will issue a warning and use the glpyh for "#" (if available)
- instead. Before it does that, it consults a (currently hard-coded) registry of
- glyph substitution groups (see Glyphs.java in Apache XML Graphics Commons).
- This registry can supply alternative glyphs in some cases (like using space when a no-break
- space is requested). But there's no guarantee that the result will be as expected (for
- example, in the case of hyphens and similar glyphs). A better way is to use a font that
- has all the necessary glyphs. This glyph substitution is only a last resort.
- </p>
- </section>
- <section id="awt">
- <title>Java2D/AWT/Operating System Fonts</title>
- <p>
- The Java2D family of renderers (Java2D, AWT, Print, TIFF, PNG), use the
- Java AWT subsystem for font metric information. Through operating system
- registration, the AWT subsystem knows what fonts are available on the system,
- and the font metrics for each one.
- </p>
- <p>
- When working with one of these output formats and you're missing a font, just
- install it in your operating system and they should be available for these
- renderers. Please note that this is not true for other output formats such as
- PDF or PostScript.
- </p>
- </section>
- <section id="custom">
- <title>Custom Fonts</title>
- <p>
- Support for custom fonts is highly output format dependent (see above table).
- This section shows how to add Type 1 and TrueType fonts to the PDF, PostScript and
- Java2D-based renderers. Other renderers (like AFP) support other font formats. Details
- in this case can be found on the page about <a href="output.html">output formats</a>.
- </p>
- <p>
- In earlier FOP versions, it was always necessary to create an XML font metrics file
- if you wanted to add a custom font. This unconvenient step has been removed and in
- addition to that, FOP supports auto-registration of fonts, i.e. FOP can find fonts
- installed in your operating system or can scan user-specified directories for fonts.
- Font registration via XML font metrics file is still supported and may still be necessary
- for some very special cases as fallback variant while we stabilize font auto-detection.
- </p>
- <p>
- Basic information about fonts can be found at:
- </p>
- <ul>
- <li>
- <a href="http://partners.adobe.com/asn/developer/type/ftypes.html">Adobe font types</a>
- </li>
- <li>
- <a href="http://partners.adobe.com/asn/developer/technotes/fonts.html">Adobe Font Technote</a>
- </li>
- </ul>
- </section>
- <section id="basics">
- <title>Basic font configuration</title>
- <p>
- If you want FOP to use custom fonts, you need to tell it where to find them. This
- is done in the configuration file and once per renderer (because each output format
- is a little different). In the basic form, you can either tell FOP to find your
- operating system fonts or you can specify directories that it will search for
- support fonts. These fonts will then automatically be registered.
- </p>
- <source><![CDATA[
-<renderers>
- <renderer mime="application/pdf">
- <fonts>
- <!-- register all the fonts found in a directory -->
- <directory>C:\MyFonts1</directory>
-
- <!-- register all the fonts found in a directory and all of its sub directories (use with care) -->
- <directory recursive="true">C:\MyFonts2</directory>
-
- <!-- automatically detect operating system installed fonts -->
- <auto-detect/>
- </fonts>
- </renderer>
-</renderers>]]></source>
- <note>
- Review the documentation for <a href="configuration.html">FOP Configuration</a>
- for instructions on making the FOP configuration available to FOP when it runs.
- Otherwise, FOP has no way of finding your custom font information. It is currently
- not possible to easily configure fonts from Java code.
- </note>
- </section>
- <section id="advanced">
- <title>Advanced font configuration</title>
- <p>
- The instructions found above should be sufficient for most users. Below are some
- additional instructions in case the basic font configuration doesn't lead to
- the desired results.
- </p>
- <section id="type1-metrics">
- <title>Type 1 Font Metrics</title>
- <p>FOP includes PFMReader, which reads the PFM file that normally comes with a Type 1 font, and generates an appropriate font metrics file for it.
- To use it, run the class org.apache.fop.fonts.apps.PFMReader:</p>
- <p>Windows:</p>
- <source>java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
- org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
- <p>Unix:</p>
- <source>java -cp build/fop.jar:lib/avalon-framework.jar:lib/commons-logging.jar:lib/commons-io.jar
- org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
- <p>PFMReader [options]:</p>
- <ul>
- <li><strong>-fn &lt;fontname&gt;</strong> By default, FOP uses the fontname from the
- .pfm file when embedding the font. Use the "-fn" option to override this name with one you have
- chosen. This may be useful in some cases to ensure that applications using the output document
- (Acrobat Reader for example) use the embedded font instead of a local font with the same
- name.</li>
- </ul>
- <note>The classpath in the above example has been simplified for readability.
- You will have to adjust the classpath to the names of the actual JAR files in the lib directory.
- xml-apis.jar, xercesImpl.jar, xalan.jar and serializer.jar are not necessary for JDK version 1.4 or later.</note>
- <note>The tool will construct some values (FontBBox, StemV and ItalicAngle) based on assumptions and calculations which are only an approximation to the real values.
- FontBBox and Italic Angle can be found in the human-readable part of the PFB file or in the AFM file.
- The PFMReader tool does not yet interpret PFB or AFM files, so if you want to be correct, you may have to adjust the values in the XML file manually.
- The constructed values however appear to have no visible influence.</note>
- </section>
- <section id="truetype-metrics">
- <title>TrueType Font Metrics</title>
- <p>FOP includes TTFReader, which reads the TTF file and generates an appropriate font metrics file for it.
- Use it in a similar manner to PFMReader.
- For example, to create such a metrics file in Windows from the TrueType font at c:\myfonts\cmr10.ttf:</p>
- <source>java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
- org.apache.fop.fonts.apps.TTFReader [options]
- C:\myfonts\cmr10.ttf ttfcm.xml</source>
- <p>TTFReader [options]:</p>
- <ul>
- <li><strong>-d &lt;DEBUG | INFO &gt;</strong> Sets the debug level (default is
- INFO).</li>
- <li><strong>-fn &lt;fontname&gt;</strong> Same as for PFMReader.</li>
- <li><strong>-ttcname &lt;fontname&gt;</strong> If you're reading data from a
- TrueType Collection (.ttc file) you must specify which font from the collection you will read
- metrics from.
- If you read from a .ttc file without this option, the fontnames will be listed for you.</li>
- <li><strong>-enc ansi</strong> Creates a WinAnsi-encoded font metrics file.
- Without this option, a CID-keyed font metrics file is created.
- The table below summarizes the differences between these two encoding options as currently
- used within FOP.
- Please note that this information only applies to TrueType fonts and TrueType collections:</li>
- </ul>
- <table id="ttf-encoding">
- <tr>
- <th>Issue</th>
- <th>WinAnsi</th>
- <th>CID-keyed</th>
- </tr>
- <tr>
- <td>Usable Character Set</td>
- <td>Limited to WinAnsi character set, which is roughly equivalent to iso-8889-1.</td>
- <td>Limited only by the characters in the font itself.</td>
- </tr>
- <tr>
- <td>Embedding the Font</td>
- <td>Optional.</td>
- <td>Mandatory. Not embedding the font produces invalid PDF documents.</td>
- </tr>
- </table>
- <warning>
- You may experience failures with certain TrueType fonts, especially if they don't contain
- the so-called Unicode "cmap" table. TTFReader can currently not deal with font like this.
- </warning>
- </section>
- <section id="truetype-collections-metrics">
- <title>TrueType Collections</title>
- <p>TrueType collections (.ttc files) contain more than one font.
- To create metrics files for these fonts, you must specify which font in the collection should be generated, by using the "-ttcname" option with the TTFReader.</p>
- <p>To get a list of the fonts in a collection, just start the TTFReader as if it were a normal TrueType file (without the -ttcname option).
- It will display all of the font names and exit with an Exception.</p>
- <p>Here is an example of generating a metrics file for a .ttc file:</p>
- <source>java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
- org.apache.fop.fonts.apps.TTFReader -ttcname "MS Mincho"
- msmincho.ttc msminch.xml</source>
- <p>
- Alternatively, the individual sub-fonts of a TrueType Collections can be selected
- using the "sub-font" attribute on the "font" element. That means that generating
- an XML font metrics file for TrueType collections is not necessary anymore. Example:
- </p>
- <source><![CDATA[<font embed-url="gulim.ttc" sub-font="GulimChe">
- <font-triplet name="GulimChe" style="normal" weight="normal"/>
-</font>]]></source>
- </section>
- <section id="register">
- <title>Register Fonts with FOP</title>
- <p>You must tell FOP how to find and use the font metrics files by registering them in the <a href="configuration.html">FOP Configuration</a>. Add entries for your custom fonts, regardless of font type, to the configuration file in a manner similar to the following:</p>
- <source><![CDATA[
-<renderers>
- <renderer mime="application/pdf">
- <fonts>
- <!-- register a particular font -->
- <font metrics-url="file:///C:/myfonts/FTL_____.xml" kerning="yes"
- embed-url="file:///C:/myfonts/FTL_____.pfb"
- encoding-mode="single-byte">
- <font-triplet name="FrutigerLight" style="normal" weight="normal"/>
- </font>
-
- <!-- register all the fonts found in a directory -->
- <directory>C:\MyFonts1</directory>
-
- <!-- register all the fonts found in a directory and all of its sub directories (use with care) -->
- <directory recursive="true">C:\MyFonts2</directory>
-
- <!-- automatically detect operating system installed fonts -->
- <auto-detect/>
- </fonts>
- </renderer>
-</renderers>]]></source>
- <ul>
- <li>
- URLs are used to access the font metric and font files.
- Relative URLs are resolved relative to the font-base property (or base) if available.
- See <a href="configuration.html">FOP: Configuration</a> for more information.
- </li>
- <li>The "metrics-url" attribute is generally not necessary except if you run into problems with certain fonts.</li>
- <li>Either an "embed-url" or a "metrics-url" must be specified for font tag configurations.</li>
- <li>The font "kerning" attribute is optional. Default is "true".</li>
- <li>If embedding is off (i.e. embed-url is not set), the output will position the text correctly (from the metrics file), but it will not be displayed or printed correctly unless the viewer has the applicable font available to their local system.</li>
- <li>When setting the "embed-url" attribute for Type 1 fonts, be sure to specify the PFB (actual font data), not PFM (font metrics) file that you used to generate the XML font metrics file.</li>
- <li>The attribute "encoding-mode" is optional an may have the following values:
- <ul>
- <li>auto: default font encoding mode ("cid" for Truetype, "single-byte" for Type 1)</li>
- <li>single-byte: use single-byte encodings in the target format (if applicable)</li>
- <li>cid: encode as CID-keyed font (currently only supported for PDF output with TrueType fonts)</li>
- </ul>
- </li>
- <li>The fonts "directory" tag can be used to register fonts contained within a single or list of directory paths. The "recursive" attribute can be specified to recursively add fonts from all sub directories.</li>
- <li>The fonts "auto-detect" tag can be used to automatically register fonts that are found to be installed on the native operating system.</li>
- <li>Fonts registered with "font" tag configurations override fonts found by means of "directory" tag definitions.</li>
- <li>Fonts found as a result of a "directory" tag configuration override fonts found as a result of the "auto-detect" tag being specified.</li>
- <li>
- If relative URLs are specified, they are evaluated relative to the value of the
- "font-base" setting. If there is no "font-base" setting, the fonts are evaluated
- relative to the base directory.
- </li>
- </ul>
-<!--note>Cocoon users will need to setup the config, see FOPSerializer for more information.</note-->
- </section>
- <section id="autodetect">
- <title>Auto-Detect and auto-embed feature</title>
- <p>When the "auto-detect" flag is set in the configuration, FOP will automatically search for fonts in the default paths for your operating system.</p>
- <p>FOP will also auto-detect fonts which are available in the classpath, if they are described as "application/x-font" in the MANIFEST.MF file. For example, if your .jar file contains font/myfont.ttf:</p>
- <source>Manifest-Version: 1.0
-
- Name: font/myfont.ttf
- Content-Type: application/x-font</source>
- <p>This feature allows you to create JAR files containing fonts. The JAR files can be added to fop by providem them in the classpath, e.g. copying them into the lib/ directory.</p>
- <section id="font-cache">
- <title>The font cache</title>
- <p>
- Apache FOP maintains a cache file that is used to speed up auto-detection. This file
- is usually found in the ".fop" directory under the user's home directory. It's called
- "fop-fonts.cache". When the user's home directory is not writable, the font cache file
- is put in the directory for temporary files.
- </p>
- <p>
- If there was a problem loading a particular font, it is flagged in the cache file so
- it is not loaded anymore. So, if a font is actually around but is still not found
- by Apache FOP, it's worth a try to delete the font cache file which forces Apache FOP
- to reparse all fonts.
- </p>
- </section>
- </section>
- <section id="embedding">
- <title>Embedding</title>
- <p>
- By default, all fonts are embedded if an output format supports font embedding. In some
- cases, however, it is preferred that some fonts are only referenced. When working
- with referenced fonts it is important to be in control of the target environment where
- the produced document is consumed, i.e. the necessary fonts have to be installed there.
- </p>
- <p>
- There are two different ways how you can specify that a font should be referenced:
- </p>
- <ol>
- <li>
- When using the old-style "font" element to configure a single font, font referencing
- is controlled by the embed-url attribute. If you don't specify the embed-url attribute
- the font will not be embedded, but will only be referenced.
- </li>
- <li>
- For automatically configured fonts there's a different mechanism to specify which
- fonts should be referenced rather than embedded. This is done in the "referenced-fonts"
- element in the configuration. Here's an example:
- </li>
- </ol>
- <source><![CDATA[
-<fop version="1.0">
- <fonts>
- <referenced-fonts>
- <match font-family="Helvetica"/>
- <match font-family="DejaVu.*"/>
- </referenced-fonts>
- </fonts>
-</fop>]]></source>
- <p>
- At the moment, you can only match fonts against their font-family. It is possible to use
- regular expressions as is shown in the second example above ("DejaVu.*"). The syntax for
- the regular expressions used here are the one used by the
- <a href="http://java.sun.com/j2se/1.4/docs/api/java/util/regex/package-summary.html"><code>java.util.regex</code> package</a>.
- So, in the above snippet "Helvetica" and all variants of the "DejaVu" font family are
- referenced. If you want to reference all fonts, just specify <code>font-family=".*"</code>.
- </p>
- <p>
- The <code>referenced-fonts</code> element can be placed either inside the general
- <code>fonts</code> element (right under the root) or in the <code>fonts</code> element
- under the renderer configuration. In the first case, matches apply to all renderers.
- In the second case, matches only apply to the renderer where the element was specified.
- Both cases can be used at the same time.
- </p>
- <p>
- Various notes related to embedded fonts:
- </p>
- <ul>
- <li>The PostScript renderer does not yet support TrueType fonts, but can embed Type 1 fonts.</li>
- <li>The font is simply embedded into the PDF file, it is not converted.</li>
- <li>When FOP embeds a font, it adds a prefix to the fontname to ensure that the name will not match the fontname of an installed font.
- This is helpful with older versions of Acrobat Reader that preferred installed fonts over embedded fonts.</li>
- <li>When embedding PostScript fonts, the entire font is always embedded.</li>
- <li>When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a subset of the
- original font, containing only the glyphs used, is embedded in the output document.
- That's the default, but if you specify encoding-mode="single-byte" (see above), the
- complete font is embedded.</li>
- </ul>
- </section>
- <section id="substitution">
- <title>Substitution</title>
- <p>When a &lt;substitutions/&gt; section is defined in the configuration, FOP will re-map any font-family references found in your FO input to a given substitution font.</p>
- <ul>
- <li>If a &lt;substitution/&gt; is declared, it is mandatory that both a &lt;from/&gt; and &lt;to/&gt; child element is declared with a font-family attribute.</li>
- <li>Both font-weight and font-style are optional attributes, if they are provided then a value of 'normal' is assumed.</li>
- </ul>
- <p>For example you could make all FO font-family references to 'Arial' with weights between 700 and 900 reference the normal 'Arial Black' font.</p>
- <source><![CDATA[
-<fop version="1.0">
- <fonts>
- <substitutions>
- <substitution>
- <from font-family="Arial" font-weight="700..900"/>
- <to font-family="Arial Black"/>
- </substitution>
- <substitution>
- <from font-family="FrutigerLight"/>
- <to font-family="Times" font-weight="bold" font-style="italic"/>
- </substitution>
- </substitutions>
- </fonts>
-</fop>]]></source>
- </section>
-<!-- The following section should no longer be required
- <section id="embedding-base14">
- <title>Explicitly embedding the base 14 fonts</title>
- <p>
- There are cases where you might want to force the embedding of one or more of the base 14 fonts that
- can normally be considered available on the target platform (viewer, printer). One of these cases is
- <a href="pdfa.html">PDF/A</a> which mandates the embedding of even the base 14 fonts. Embedding a font such as Helvetica or
- Courier is straight-forward. The "Symbol" and "ZapfDingbats" fonts, however, currently present a
- problem because FOP cannot correctly determine the encoding of these two single-byte fonts through
- the PFM file. FOP now correctly interprets the "encoding" value in the XML font metrics file, but the
- PFMReader application writes "UnknownEncoding" to the generated XML file. In order to embed "Symbol"
- and "ZapfDingbats" you have to manually change the XML font metrics file and specify "SymbolEncoding"
- or "ZapfdingbatsEncoding" encoding respectively as the value for the "encoding" element.
- </p>
- <p>Example:</p>
- <source><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<font-metrics type="TYPE1">
- <font-name>Symbol</font-name>
- <embed/>
- <encoding>SymbolEncoding</encoding>
- <cap-height>673</cap-height>
- <x-height>766</x-height>
- [..]]]></source>
- </section-->
- </section>
- <section id="selection">
- <title>Font Selection Strategies</title>
- <p>
- There are two font selection strategies: character-by-character or auto. The default is auto.</p>
- <p>Auto selected the first font from the list which is able to display the most characters in a given word. This means (assume font A has characters for abclmn, font B for lnmxyz, fontlist is A,B):</p>
- <ul>
- <li>aaa lll xxx would be displayed in fonts A A B</li>
- <li>aaaxx would be displayed in font A</li>
- <li>aaaxxx would be displayed in font A</li>
- <li>aaaxxxx would be displayed in font B</li>
- </ul>
- <p>Character-by-Character is NOT yet supported!</p>
- </section>
- <section id="font-list">
- <title>Font List Command-Line Tool</title>
- <p>
- FOP contains a small command-line tool that lets you generate a list of all configured
- fonts. Its class name is: <code>org.apache.fop.tools.fontlist.FontListMain</code>.
- Run it with the "-?" parameter to get help for the various options.
- </p>
- </section>
- </body>
-</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1rc1/fotree/disabled-testcases.xml b/src/documentation/content/xdocs/1.1rc1/fotree/disabled-testcases.xml
deleted file mode 100644
index 196eafcc4..000000000
--- a/src/documentation/content/xdocs/1.1rc1/fotree/disabled-testcases.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?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$ -->
-<disabled-testcases>
- <testcase>
- <name>demo test failure</name>
- <file>demo-test-failure.fo</file>
- <description></description>
- </testcase>
- <testcase>
- <name>Markers and core function evaluation</name>
- <file>from-table-column_marker.fo</file>
- <description>The code currently evaluates this function according to the column in which the
- marker appears in the source document, rather than the column it is retrieved in.</description>
- </testcase>
-</disabled-testcases>
diff --git a/src/documentation/content/xdocs/1.1rc1/graphics.xml b/src/documentation/content/xdocs/1.1rc1/graphics.xml
deleted file mode 100644
index b1653443a..000000000
--- a/src/documentation/content/xdocs/1.1rc1/graphics.xml
+++ /dev/null
@@ -1,590 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP: Graphics Formats</title>
- <version>$Revision$</version>
- </header>
- <body>
- <section id="introduction">
- <title>Introduction</title>
- <p>
- Some noteworthy features of the image handling subsystem are:
- </p>
- <ul>
- <li>
- The image libraries Jimi and JAI are not supported. Instead, Apacheâ„¢ FOP uses the
- Image I/O API that was introduced with Java 1.4 for all bitmap codecs.
- </li>
- <li>
- Some bitmap images are not converted to a standardized 24 bit RGB image but are
- instead handled in their native format.
- </li>
- <li>
- A plug-in mechanism offers a possibility to add support for new formats without changing
- the FOP's source code.
- </li>
- </ul>
- <p>
- The actual <a href="http://xmlgraphics.apache.org/commons/image-loader.html">image loading framework</a>
- does not reside in Apache FOP, but in
- <a href="ext:xmlgraphics.apache.org/commons/">XML Graphics Commons</a>.
- </p>
- </section>
- <section id="support-overview">
- <title>Overview of Graphics Support</title>
- <p>
- The table below summarizes the <em>theoretical</em> support for graphical formats
- within FOP. In other words, within the constraints of the limitations listed here,
- these formats <em>should</em> work. However, many of them have not been tested,
- and there may be limitations that have not yet been discovered or documented.
- The packages needed to support some formats are not included in the FOP distribution
- and must be installed separately. Follow the links in the "Support Through" columns
- for more details.
- </p>
- <table>
- <tr>
- <th rowspan="2">Format</th>
- <th rowspan="2">Type</th>
- <th colspan="3">Support Through</th>
- </tr>
- <tr>
- <th><a href="#native">Apache FOP (native)</a></th>
- <th><a href="#batik">Apache Batik</a></th>
- <th><a href="#imageio">Image I/O</a></th>
- </tr>
- <tr>
- <td><a href="#bmp">BMP</a> (Microsoft Windows Bitmap)</td>
- <td>bitmap</td>
- <td/>
- <td/>
- <td>X [1]</td>
- </tr>
- <tr>
- <td><a href="#emf">EMF</a> (Windows Enhanced Metafile)</td>
- <td>vector (with embedded bitmaps)</td>
- <td>(X)</td>
- <td/>
- <td/>
- </tr>
- <tr>
- <td><a href="#eps">EPS</a> (Encapsulated PostScript)</td>
- <td>metafile (both bitmap and vector), most frequently used for vector drawings</td>
- <td>(X)</td>
- <td/>
- <td/>
- </tr>
- <tr>
- <td>GIF (Graphics Interchange Format)</td>
- <td>bitmap</td>
- <td/>
- <td/>
- <td>X</td>
- </tr>
- <tr>
- <td><a href="#jpeg">JPEG</a> (Joint Photographic Experts Group)</td>
- <td>bitmap</td>
- <td>(X)</td>
- <td/>
- <td>X</td>
- </tr>
- <tr>
- <td><a href="#png">PNG</a> (Portable Network Graphic)</td>
- <td>bitmap</td>
- <td/>
- <td/>
- <td>X</td>
- </tr>
- <tr>
- <td><a href="#svg">SVG</a> (Scalable Vector Graphics)</td>
- <td>vector (with embedded bitmaps)</td>
- <td/>
- <td>X</td>
- <td/>
- </tr>
- <tr>
- <td><a href="#tiff">TIFF</a> (Tag Image Format File)</td>
- <td>bitmap</td>
- <td>(X)</td>
- <td/>
- <td>X [1]</td>
- </tr>
- <tr>
- <td><a href="#wmf">WMF</a> (Windows Metafile)</td>
- <td>vector (with embedded bitmaps)</td>
- <td/>
- <td>(X)</td>
- <td/>
- </tr>
- </table>
- <p>
- Legend:
- </p>
- <ul>
- <li>"(X)" means restricted support. Please see the details below.</li>
- <li>
- [1]: Requires the presence of <a href="http://jai-imageio.dev.java.net/">JAI Image I/O Tools</a>
- (or an equivalent Image I/O compatible codec) in the classpath. JAI Image I/O Tools also
- adds support for JPEG 2000, WBMP, RAW and PNM. Other Image I/O codecs may provide
- support for additional formats.
- </li>
- </ul>
- <note>
- <a href="http://jai-imageio.dev.java.net/">JAI Image I/O Tools</a> is not the same as the
- <a href="http://java.sun.com/javase/technologies/desktop/media/jai/">JAI library</a>! The
- former simply exposes JAI's codecs using the Image&amp;nbsp;I/O API but does not include all
- the image manipulation functionality.
- </note>
- <section id="format-map">
- <title>Map of supported image formats by output format</title>
- <p>
- Not all image formats are supported for all output formats! For example, while you can
- use EPS (Encapsulated PostScript) files when you generate PostScript output, this format
- will not be supported by any other output format. Here's an overview of which image
- formats are supported by which output format:
- </p>
- <table>
- <tr>
- <th>Image Format</th>
- <th>PDF</th>
- <th>PostScript</th>
- <th>Java2D, PNG, TIFF, AWT</th>
- <th>PCL</th>
- <th>AFP</th>
- <th>RTF</th>
- </tr>
- <tr>
- <td><a href="#bmp">BMP</a> (Microsoft Windows Bitmap)</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- </tr>
- <tr>
- <td><a href="#emf">EMF</a> (Windows Enhanced Metafile)</td>
- <td/>
- <td/>
- <td/>
- <td/>
- <td/>
- <td>X [1]</td>
- </tr>
- <tr>
- <td><a href="#eps">EPS</a> (Encapsulated PostScript)</td>
- <td/>
- <td>X [1]</td>
- <td/>
- <td/>
- <td/>
- <td/>
- </tr>
- <tr>
- <td>GIF (Graphics Interchange Format)</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- </tr>
- <tr>
- <td><a href="#jpeg">JPEG</a> (Joint Photographic Experts Group)</td>
- <td>X [1]</td>
- <td>X [1]</td>
- <td>X</td>
- <td>X</td>
- <td>X [1]</td>
- <td>X</td>
- </tr>
- <tr>
- <td><a href="#png">PNG</a> (Portable Network Graphic)</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- </tr>
- <tr>
- <td><a href="#svg">SVG</a> (Scalable Vector Graphics)</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- </tr>
- <tr>
- <td><a href="#tiff">TIFF</a> (Tag Image Format File)</td>
- <td>X [2]</td>
- <td>X [2]</td>
- <td>X</td>
- <td>X</td>
- <td>X [2]</td>
- <td>X</td>
- </tr>
- <tr>
- <td><a href="#wmf">WMF</a> (Windows Metafile)</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- <td>X</td>
- </tr>
- </table>
- <p>
- Legend:
- </p>
- <ul>
- <li>
- [1]: Supported without the need to decode the image.
- </li>
- <li>
- [2]: Supported without the need to decode the image, but only for certain subtypes.
- </li>
- </ul>
- </section>
- </section>
- <section id="packages">
- <title>Graphics Packages</title>
- <section id="native">
- <title>XML Graphics Commons Native</title>
- <p>
- <a href="ext:xmlgraphics.apache.org/commons">XML Graphics Commons</a> supports a number
- of graphic file formats natively as basic functionality: all bitmap formats for which
- there are Image I/O codecs available (JPEG, PNG, GIF, TIFF, etc.), EPS and EMF.
- </p>
- </section>
- <section id="fop-native">
- <title>FOP Native</title>
- <p>
- FOP has no native image plug-ins for the image loading framework of its own but currently
- hosts the Batik-dependent SVG and WMF plug-ins until they can be moved to
- <a href="ext:xmlgraphics.apache.org/batik">Apache Batik</a>.
- </p>
- </section>
- <section id="batik">
- <title>Apache Batik</title>
- <p>
- <a href="ext:xmlgraphics.apache.org/batik">Apache Batik</a> will later receive the
- SVG and WMF plug-ins for the image loading framework that are currently hosted inside
- FOP.
- </p>
- <p>
- Current FOP distributions include a distribution of the
- <a class="fork" href="ext:xmlgraphics.apache.org/batik">Apache Batik</a>.
- Because Batik's API changes frequently, it is highly recommended that you use the
- version that ships with FOP, at least when running FOP.
- </p>
- <warning>Batik must be run in a graphical environment.</warning>
- <p>
- Batik must be run in a graphical environment.
- It uses AWT classes for rendering SVG, which in turn require an X server on Unixish
- systems. If you run a server without X, or if you can't connect to the X server due to
- security restrictions or policies (a so-called "headless" environment), SVG rendering
- will fail.
- </p>
- <p>Here are some workarounds:</p>
- <ul>
- <li>
- Start Java with the <code>-Djava.awt.headless=true</code> command line option.
- </li>
- <li>
- Install an X server which provides an in-memory framebuffer without actually using a
- screen device or any display hardware. One example is Xvfb.
- </li>
- <li>
- Install a toolkit which emulates AWT without the need for an underlying X server. One
- example is the <a href="http://www.eteks.com/pja/en">PJA toolkit</a>, which is free
- and comes with detailed installation instructions.
- </li>
- </ul>
- </section>
- <section id="imageio">
- <title>Image I/O</title>
- <p>
- The image loading framework in <a href="ext:xmlgraphics.apache.org/commons">XML Graphics Commons</a>
- provides a wrapper to load images through the
- <a class="fork" href="http://java.sun.com/j2se/1.4.2/docs/guide/imageio/index.html">JDK's Image I/O API</a> (JSR 015).
- Image I/O allows to dynamically add additional image codecs. An example of such an
- add-on library are the
- <a class="fork" href="http://java.sun.com/products/java-media/jai/">JAI Image I/O Tools</a>
- available from Sun.
- </p>
- </section>
- </section>
- <section id="image-formats">
- <title>Details on image formats</title>
- <section id="bmp">
- <title>BMP</title>
- <p>
- BMP images are supported through an Image I/O codec. There may be limitations of the
- codec which are outside the control of Apache FOP.
- </p>
- </section>
- <section id="emf">
- <title>EMF</title>
- <p>
- Windows Enhanced Metafiles (EMF) are only supported in RTF output where they are
- embedded without decoding.
- </p>
- </section>
- <section id="eps">
- <title>EPS</title>
- <p>Apache FOP allows to use EPS files when generating PostScript output only.</p>
- <p>
- Other output targets can't be supported at the moment because
- FOP lacks a PostScript interpreter. Furthermore, FOP is currently not able
- to parse the preview bitmaps sometimes contained in EPS files.
- </p>
- </section>
- <section id="gif">
- <title>GIF</title>
- <p>
- GIF images are supported through an Image&amp;nbsp;I/O codec. Transparency is supported but
- not guaranteed to work with every output format.
- </p>
- </section>
- <section id="jpeg">
- <title>JPEG</title>
- <p>
- FOP native support (i.e. the handling of undecoded images) of JPEG does not include all
- variants, especially those containing unusual color lookup tables and color profiles.
- If you have trouble with a JPEG image in FOP, try opening it with an image processing
- program (such as Photoshop or Gimp) and then saving it. Specifying 24-bit color output
- may also help. For the PDF and PostScript renderers most JPEG images can be passed
- through without decompression. User reports indicate that grayscale, RGB, and
- CMYK color spaces are all rendered properly. However, for other output formats, the
- JPEG images have to be decompressed. Tests have shown that there are some limitation
- in some Image&amp;nbsp;I/O codecs concerning images in the CMYK color space. Work-arounds are
- in place but may not always work as expected.
- </p>
- </section>
- <section id="png">
- <title>PNG</title>
- <p>
- PNG images are supported through an Image&amp;nbsp;I/O codec. Transparency is supported but
- not guaranteed to work with every output format.
- </p>
- </section>
- <section id="svg">
- <title>SVG</title>
- <section id="svg-intro">
- <title>Introduction</title>
- <p>FOP uses <a href="#batik"> Apache Batik</a> for SVG support.
- This format can be handled as an <code>fo:instream-foreign-object</code> or in a separate
- file referenced with <code>fo:external-graphic</code>.</p>
- <note>
- Batik's SVG Rasterizer utility may also be used to convert standalone SVG
- documents into PDF. For more information please see the
- <a href="http://xmlgraphics.apache.org/batik/svgrasterizer.html">SVG Rasterizer documentation</a>
- on the Batik site.
- </note>
- </section>
- <section id="svg-pdf-graphics">
- <title>Placing SVG Graphics into PDF</title>
- <p>
- The SVG is rendered into PDF by using PDF commands to draw and fill
- lines and curves. This means that the graphical objects created with
- this remain as vector graphics. The same applies to PostScript output.
- For other output formats the SVG graphic may be converted to a bitmap
- image.
- </p>
- <p>
- There are a number of SVG things that cannot be converted directly into
- PDF. Parts of the graphic such as effects, patterns and images are inserted
- into the PDF as a raster graphic. The resolution of these raster images can
- be controlled through the "target resolution" setting in the
- <a href="configuration.html">configuration</a>.</p>
- <p>
- Currently transparency is limited in PDF so some SVG images that
- contain effects or graphics with transparent areas may not be displayed
- correctly.
- </p>
- </section>
- <section id="svg-pdf-text">
- <title>Placing SVG Text into PDF and PostScript</title>
- <p>If possible, Batik will use normal PDF or PostScript text when inserting text. It does
- this by checking if the text can be drawn normally and the font is
- supported. This example svg <a href="../dev/svg/text.svg">text.svg</a> /
- <a href="../dev/svg/text.pdf">text.pdf</a> / <a href="../dev/svg/text.png">text.png</a>
- shows how various types and effects with text are handled.
- Note that SVG font support is not yet implemented. Furthermore, text handling in
- PostScript output is inferior to PDF output - more text will be painted as shapes in
- PS than in PDF.
- </p>
- <p>
- When there's no support to paint text using native text operations,
- text is converted and drawn as a set of shapes by Batik, using the
- stroking text painter. This means that a typical character will
- have about 10 curves (each curve consists of at least 20 characters).
- This can make the output files large and when it is viewed the
- viewer may not normally draw those fine curves very well (In Adobe Acrobat, turning on
- "Smooth Line Art" in the preferences will fix this). Copy/paste functionality
- will not be supported in this case.
- If the text is inserted into the output file using the inbuilt text commands
- it will use a single character.
- </p>
- <p>
- Note that because SVG text can be rendered as either text or a vector graphic, you
- may need to consider settings in your viewer for both. The Acrobat viewer has both
- "smooth line art" and "smooth text" settings that may need to be set for SVG images
- to be displayed nicely on your screen (see Edit / Preferences / Display).
- This setting will not affect the printing of your document, which should be OK in
- any case, but will only affect the quality of the screen display.
- </p>
- </section>
- <section id="svg-font-selection">
- <title>Font selection notes</title>
- <p>
- Apache Batik uses the AWT/Java2D subsystem as font source while FOP has its own font
- subsystem. Great care has been taken that font selection does the best possible choices.
- But it must be noted when creating PDF or PostScript that a font used in SVG graphics
- needs to be registered with the operating system as well as in FOP's configuration.
- By using FOP's font auto-detection, you simply have to install the font in the operating
- system and not care about anything else. This is less of an issue if you create
- formats like TIFFs, PNGs or PCL because in these cases SVG graphics are usually rendered
- to bitmaps which means that on both sides (Batik and FOP), AWT/Java2D is used as the
- single font source.
- </p>
- <p>
- Whenever an SVG is converted into a PDF or PostScript file, the font that has been used
- inside Batik has to be mapped to a font used by the actual output format. Features like
- font substitution in FOP may need to be taken into account but can also be an advantage
- when working around font mapping issues. Like for XSL-FO content, you'll get a warning
- if a particular font could not be found and had to be substituted, or if a particular
- glyph is missing in a font.
- </p>
- </section>
- <section id="svg-scaling">
- <title>Scaling</title>
- <p>
- Currently, SVG images are rendered with the dimensions specified <em>in the SVG
- file</em>, within the viewport specified in the fo:external-graphic element.
- For everything to work properly, the two should be equal. The SVG standard leaves
- this issue as an implementation detail. Additional scaling options are available
- through XSL-FO means.
- </p>
- <p>
- If you use pixels to specify the size of an SVG graphic the "source resolution" setting
- in the <a href="configuration.html">configuration</a> will be used to determine the
- size of a pixel. The use of pixels to specify sizes is discouraged as they may
- be interpreted differently in different environments.
- </p>
- </section>
- <section id="svg-problems">
- <title>Known Problems</title>
- <ul>
- <li>
- Soft mask transparency is combined with white so that it looks better
- on PDF 1.3 viewers but this causes the soft mask to be slightly lighter
- or darker on PDF 1.4 viewers.
- </li>
- <li>
- There is some problem with a gradient inside a pattern which may cause a PDF
- error when viewed in Acrobat 5.
- </li>
- <li>
- Text is not always handled correctly, it may select the wrong font
- especially if characters have multiple fonts in the font list.
- </li>
- <li>
- Uniform transparency for images and other SVG elements that are converted
- into a raster graphic are not drawn properly in PDF. The image is opaque.
- </li>
- </ul>
- </section>
- </section>
- <section id="tiff">
- <title>TIFF</title>
- <p>
- FOP can embed TIFF images without decompression into PDF, PostScript and AFP if they
- have either CCITT T.4, CCITT T.6, or JPEG compression. Otherwise, a TIFF-capable
- Image&amp;nbsp;I/O codec is necessary for decoding the image.
- </p>
- <p>
- There may be some limitation concerning images in the CMYK color space.
- </p>
- </section>
- <section id="wmf">
- <title>WMF</title>
- <p>
- Windows Metafiles (WMF) are supported through classes in
- <a href="ext:xmlgraphics.apache.org/batik">Apache Batik</a>. At the moment, support
- for this format is experimental and may not always work as expected.
- </p>
- </section>
- </section>
- <section id="resolution">
- <title>Graphics Resolution</title>
- <p>
- Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution
- values. FOP tries to use this resolution information whenever possible to determine
- the image's intrinsic size. This size is used during the layout process when it is not
- superseded by an explicit size on fo:external-graphic (content-width and content-height
- properties).
- </p>
- <p>
- Please note that not all images contain resolution information. If it's not available
- the source resolution set on the FopFactory (or through the user configuration XML) is used.
- The default here is 72 dpi.
- </p>
- <p>
- Bitmap images are generally embedded into the output format at their original resolution
- (as is). No resampling of the image is performed. Explicit resampling is on our wishlist,
- but hasn't been implemented, yet. Bitmaps included in SVG graphics may be resampled to
- the resolution specified in the "target resolution" setting in the
- <a href="configuration.html">configuration</a> if SVG filters are applied. This can be
- used as a work-around to resample images in FO documents.
- </p>
- </section>
- <section id="page-selection">
- <title>Page selection for multi-page formats</title>
- <p>
- Some image formats such as TIFF support multiple pages/sub-images per file. You can
- select a particular page using a special URI fragment in the form:
- &lt;uri&gt;#page=&lt;nr&gt;
- (for example: <code>http://localhost/images/myimage.tiff#page=3</code>)
- </p>
- </section>
- <section id="caching">
- <title>Image caching</title>
- <p>
- FOP caches images between runs. There is one cache per FopFactory instance. The URI is
- used as a key to identify images which means that when a particular URI appears again,
- the image is taken from the cache. If you have a servlet that generates a different
- image each time it is called with the same URI you need to use a constantly
- changing dummy parameter on the URI to avoid caching.
- </p>
- <p>
- The image cache has been improved considerably in the redesigned code. Therefore,
- resetting the image cache should be a thing of the past. If you
- still experience OutOfMemoryErrors, please notify us.
- </p>
- <p>
- If all else fails, the image cache can be cleared like this:
- <code>fopFactory.getImageManager().getCache().clearCache();</code>
- </p>
- </section>
- </body>
-</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1rc1/hyphenation.xml b/src/documentation/content/xdocs/1.1rc1/hyphenation.xml
deleted file mode 100644
index e6f666826..000000000
--- a/src/documentation/content/xdocs/1.1rc1/hyphenation.xml
+++ /dev/null
@@ -1,237 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP: Hyphenation</title>
- <version>$Revision$</version>
- </header>
- <body>
- <section id="support">
- <title>Hyphenation Support</title>
- <section id="intro">
- <title>Introduction</title>
- <p>Apacheâ„¢ FOP uses Liang's hyphenation algorithm, well known from TeX. It needs
- language specific pattern and other data for operation.</p>
- <p>Because of <a href="#license-issues">licensing issues</a> (and for
- convenience), all hyphenation patterns for FOP are made available through
- the <a class="fork" href="http://offo.sourceforge.net/hyphenation/index.html">Objects For
- Formatting Objects</a> project.</p>
- <note>If you have made improvements to an existing Apacheâ„¢ FOP hyphenation pattern,
- or if you have created one from scratch, please consider contributing these
- to OFFO so that they can benefit other FOP users as well.
- Please inquire on the <a href="../maillist.html#fop-user">FOP User
- mailing list</a>.</note>
- </section>
- <section id="license-issues">
- <title>License Issues</title>
- <p>Many of the hyphenation files distributed with TeX and its offspring are
- licenced under the <a class="fork" href="http://www.latex-project.org/lppl.html">LaTeX
- Project Public License (LPPL)</a>, which prevents them from being
- distributed with Apache software. The LPPL puts restrictions on file names
- in redistributed derived works which we feel can't guarantee. Some
- hyphenation pattern files have other or additional restrictions, for
- example against use for commercial purposes.</p>
- <p>Although Apache FOP cannot redistribute hyphenation pattern files that do
- not conform with its license scheme, that does not necessarily prevent users
- from using such hyphenation patterns with FOP. However, it does place on
- the user the responsibility for determining whether the user can rightly use
- such hyphenation patterns under the hyphenation pattern license.</p>
- <warning>The user is responsible to settle license issues for hyphenation
- pattern files that are obtained from non-Apache sources.</warning>
- </section>
- <section id="sources">
- <title>Sources of Custom Hyphenation Pattern Files</title>
- <p>The most important source of hyphenation pattern files is the
- <a class="fork" href="http://www.ctan.org/tex-archive/language/hyphenation/">CTAN TeX
- Archive</a>.</p>
- </section>
- <section id="install">
- <title>Installing Custom Hyphenation Patterns</title>
- <p>To install a custom hyphenation pattern for use with FOP:</p>
- <ol>
- <li>Convert the TeX hyphenation pattern file to the FOP format. The FOP
- format is an xml file conforming to the DTD found at
- <code>{fop-dir}/hyph/hyphenation.dtd</code>.</li>
- <li>Name this new file following this schema:
- <code>languageCode_countryCode.xml</code>. The country code is
- optional, and should be used only if needed. For example:
- <ul>
- <li><code>en_US.xml</code> would be the file name for American
- English hyphenation patterns.</li>
- <li><code>it.xml</code> would be the file name for Italian
- hyphenation patterns.</li>
- </ul>
- The language and country codes must match the XSL-FO input, which
- follows <a href="http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt">ISO
- 639</a> (languages) and <a href="http://www.ics.uci.edu/pub/ietf/http/related/iso3166.txt">ISO
- 3166</a> (countries). NOTE: The ISO 639/ISO 3166 convention is that
- language names are written in lower case, while country codes are written
- in upper case. FOP does not check whether the language and country specified
- in the FO source are actually from the current standard, but it relies
- on it being two letter strings in a few places. So you can make up your
- own codes for custom hyphenation patterns, but they should be two
- letter strings too (patches for proper handling extensions are welcome)</li>
- <li>There are basically three ways to make the FOP-compatible hyphenation pattern
- file(s) accessible to FOP:
- <ul>
- <li>Download the precompiled JAR from <a class="fork" href="http://offo.sourceforge.net/hyphenation/index.html">OFFO
- </a> and place it either in the <code>{fop-dir}/lib</code> directory, or
- in a directory of your choice (and append the full path to the JAR to
- the environment variable <code>FOP_HYPHENATION_PATH</code>).</li>
- <li>Download the desired FOP-compatible hyphenation pattern file(s) from
- <a class="fork" href="http://offo.sourceforge.net/hyphenation/index.html">OFFO</a>,
- and/or take your self created hyphenation pattern file(s),
- <ul>
- <li>place them in the directory <code>{fop-dir}/hyph</code>, </li>
- <li>or place them in a directory of your choice and set the Ant variable
- <code>user.hyph.dir</code> to point to that directory (in
- <code>build-local.properties</code>),</li>
- </ul>
- and run Ant with build target
- <code>jar-hyphenation</code>. This will create a JAR containing the
- compiled patterns in <code>{fop-dir}/build</code> that will be added to the
- classpath on the next run.
- (When FOP is built from scratch, and there are pattern source file(s)
- present in the directory pointed to by the
- <code>user.hyph.dir</code> variable, this JAR will automatically
- be created from the supplied pattern(s)).</li>
- <li>Put the pattern source file(s) into a directory of your choice and
- configure FOP to look for custom patterns in this directory, by setting the
- <a href="configuration.html">&lt;hyphenation-base&gt;</a>
- configuration option.</li>
- </ul>
- </li>
- </ol>
- <warning>
- Either of these three options will ensure hyphenation is working when using
- FOP from the command-line. If FOP is being embedded, remember to add the location(s)
- of the hyphenation JAR(s) to the CLASSPATH (option 1 and 2) or to set the
- <a href="configuration.html#hyphenation-dir">&lt;hyphenation-dir&gt;</a>
- configuration option programmatically (option 3).
- </warning>
- </section>
- </section>
- <section id="patterns">
- <title>Hyphenation Patterns</title>
- <p>If you would like to build your own hyphenation pattern files, or modify
- existing ones, this section will help you understand how to do so. Even
- when creating a pattern file from scratch, it may be beneficial to start
- with an existing file and modify it. See <a class="fork" href="http://offo.sourceforge.net/hyphenation/index.html">
- OFFO's Hyphenation page</a> for examples.
- Here is a brief explanation of the contents of FOP's hyphenation patterns:</p>
- <warning>The remaining content of this section should be considered "draft"
- quality. It was drafted from theoretical literature, and has not been
- tested against actual FOP behavior. It may contain errors or omissions.
- Do not rely on these instructions without testing everything stated here.
- If you use these instructions, please provide feedback on the
- <a href="../maillist.html#fop-user">FOP User mailing list</a>, either
- confirming their accuracy, or raising specific problems that we can
- address.</warning>
- <ul>
- <li>The root of the pattern file is the &lt;hyphenation-info&gt; element.</li>
- <li>&lt;hyphen-char&gt;: its attribute "value" contains the character signalling
- a hyphen in the &lt;exceptions&gt; section. It has nothing to do with the
- hyphenation character used in FOP, use the XSLFO hyphenation-character
- property for defining the hyphenation character there. At some points
- a dash U+002D is hardwired in the code, so you'd better use this too
- (patches to rectify the situation are welcome). There is no default,
- if you declare exceptions with hyphenations, you must declare the
- hyphen-char too.</li>
- <li>&lt;hyphen-min&gt; contains two attributes:
- <ul>
- <li>before: the minimum number of characters in a word allowed to exist
- on a line immediately preceding a hyphenated word-break.</li>
- <li>after: the minimum number of characters in a word allowed to exist
- on a line immediately after a hyphenated word-break.</li>
- </ul>
- This element is unused and not even read. It should be considered a
- documentation for parameters used during pattern generation.
- </li>
- <li>&lt;classes&gt; contains whitespace-separated character sets. The members
- of each set should be treated as equivalent for purposes of hyphenation,
- usually upper and lower case of the same character. The first character
- of the set is the canonical character, the patterns and exceptions
- should only contain these canonical representation characters (except
- digits for weight, the period (.) as word delimiter in the patterns and
- the hyphen char in exceptions, of course).</li>
- <li>&lt;exceptions&gt; contains whitespace-separated words, each of which
- has either explicit hyphen characters to denote acceptable breakage
- points, or no hyphen characters, to indicate that this word should
- never be hyphenated, or contain explicit &lt;hyp&gt; elements for specifying
- changes of spelling due to hyphenation (like backen -&gt; bak-ken or
- Stoffarbe -&gt; Stoff-farbe in the old german spelling). Exceptions override
- the patterns described below. Explicit &lt;hyp&gt; declarations don't work
- yet (patches welcome). Exceptions are generally a bit brittle, test
- carefully.</li>
- <li>&lt;patterns&gt; includes whitespace-separated patterns, which are what
- drive most hyphenation decisions. The characters in these patterns are
- explained as follows:
- <ul>
- <li>non-numeric characters represent characters in a sub-word to be
- evaluated</li>
- <li>the period character (.) represents a word boundary, i.e. either
- the beginning or ending of a word</li>
- <li>numeric characters represent a scoring system for indicating the
- acceptability of a hyphen in this location. Odd numbers represent an
- acceptable location for a hyphen, with higher values overriding lower
- inhibiting values. Even numbers indicate an unacceptable location, with
- higher values overriding lower values indicating an acceptable position.
- A value of zero (inhibiting) is implied when there is no number present.
- Generally patterns are constructed so that valuse greater than 4 are rare.
- Due to a bug currently patterns with values of 8 and greater don't
- have an effect, so don't wonder.</li>
- </ul>
- Here are some examples from the English patterns file:
- <ul>
- <li>Knuth (<em>The TeXBook</em>, Appendix H) uses the example <strong>hach4</strong>, which indicates that it is extremely undesirable to place a hyphen after the substring "hach", for example in the word "toothach-es".</li>
- <li><strong>.leg5e</strong> indicates that "leg-e", when it occurs at the beginning of a word, is a very good place to place a hyphen, if one is needed. Words like "leg-end" and "leg-er-de-main" fit this pattern.</li>
- </ul>
- Note that the algorithm that uses this data searches for each of the word's substrings in the patterns, and chooses the <em>highest</em> value found for letter combination.
- </li>
- </ul>
- <p>If you want to convert a TeX hyphenation pattern file, you have to undo
- the TeX encoding for non-ASCII text. FOP uses Unicode, and the patterns
- must be proper Unicode too. You should be aware of the XML encoding issues,
- preferably use a good Unicode editor.</p>
- <p>Note that FOP does not do Unicode character normalization. If you use
- combining chars for accents and other character decorations, you must
- declare character classes for them, and use the same sequence of base character
- and combining marks in the XSLFO source, otherwise the pattern wouldn't match.
- Fortunately, Unicode provides precomposed characters for all important cases
- in common languages, until now nobody run seriously into this issue. Some dead
- languages and dialects, especially ancient ones, may pose a real problem
- though.</p>
- <p>If you want to generate your own patterns, an open-source utility called
- patgen can be used to assist in creating pattern files from dictionaries.
- It is available in many Unix/Linux distributions and every TeX distribution.
- Pattern creation for languages like english or german is an art. Read
- Frank Liang's original paper <a class="fork" href="http://www.tug.org/docs/liang/">"Word
- Hy-phen-a-tion by Com-pu-ter"</a> (yes, with hyphens) for details.
- The original patgen.web source, included in the TeX source distributions,
- contains valuable comments, unfortunately technical details often obscure the
- high level issues. Another important source of information is
- <a class="fork" href="http://mirrors.ctan.org/systems/knuth/dist/tex/texbook.tex">The
- TeX Book</a>, appendix H (either read the TeX source, or run it through
- TeX to typeset it). Secondary articles, for example the works by Petr Sojka,
- may also give some much needed insight into problems arising in automated
- hyphenation.</p>
- </section>
- </body>
-</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1rc1/index.xml b/src/documentation/content/xdocs/1.1rc1/index.xml
deleted file mode 100644
index 0b5f58215..000000000
--- a/src/documentation/content/xdocs/1.1rc1/index.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP Version 1.1rc1</title>
- <version>$Revision$</version>
- </header>
- <body>
- <section id="intro">
- <title>Introduction</title>
- <p>
- This is Release Candidate 1 (rc1) of an upcoming minor (dot) release of FOP. FOP 1.1rc1 contains many bux
- fixes and a number of improvements, including
- important features such as support for <a href="complexscripts.html">Complex Scripts</a>
- (e.g., Arabic, Hebrew, Indic, and Southeast Asian scripts). To see what has changed since the last release,
- please visit <a href="releaseNotes_1.1rc1.html">Release Notes</a>.
- </p>
- <p>
- This release implements a substantial subset of the W3C XSL-FO 1.1
- Recommendation. For a detailed overview of FOP's
- compliance with this recommendation, see <a href="../compliance.html">Compliance</a>.
- </p>
- </section>
- <section id="upgrading">
- <title>Upgrading from an earlier version</title>
- <p>
- If you're upgrading to this version from an earlier version of FOP, please read the
- information on <a href="upgrading.html">Upgrading</a>!
- </p>
- </section>
- <section id="download">
- <title>Download</title>
- <p>
- To download this version, please visit <a href="../download.html">Downloading</a>.
- </p>
- </section>
- </body>
-</document>
diff --git a/src/documentation/content/xdocs/1.1rc1/intermediate.xml b/src/documentation/content/xdocs/1.1rc1/intermediate.xml
deleted file mode 100644
index 171ae4e6a..000000000
--- a/src/documentation/content/xdocs/1.1rc1/intermediate.xml
+++ /dev/null
@@ -1,331 +0,0 @@
-<?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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP: Intermediate Format</title>
- <version>$Revision$</version>
- </header>
- <body>
- <note>
- Please note that the intermediate formats described here are
- <strong>advanced features</strong> and can be ignored by most users of Apache FOP.
- </note>
- <section id="introduction">
- <title>Introduction</title>
- <p>
- Apacheâ„¢ FOP now provides two different so-called intermediate formats. The first one
- (let's call it the area tree XML format) is basically a 1:1 XML representation of FOP's
- area tree as generated by the layout engine. The area tree is conceptually defined in the
- <a href="http://www.w3.org/TR/2001/REC-xsl-20011015/slice1.html#section-N742-Formatting">XSL-FO specification in chapter 1.1.2</a>.
- Even though the area tree is mentioned in the XSL-FO specification, this part is not
- standardized. Therefore, the area tree XML format is a FOP-proprietary XML file format.
- The area tree XML can be generated through the area tree XML Renderer (the XMLRenderer).
- </p>
- <p>
- The second intermediate format (which we shall name exactly like this: the intermediate
- format)
- is a recent addition which tries to meet a slightly different set of goals. It is highly
- optimized for speed.
- </p>
- <p>
- The intermediate format can be used to generate intermediate documents that are modified
- before they are finally rendered to their ultimate output format. Modifications include
- adjusting and changing trait values, adding or modifying area objects, inserting prefabricated
- pages, overlays, imposition (n-up, rotation, scaling etc.). Multiple IF files can be combined
- to a single output file.
- </p>
- </section>
- <section id="which-if">
- <title>Which Intermediate Format to choose?</title>
- <p>
- Both formats have their use cases, so the choice you will make will depend on your
- particular situation. Here is a list of strengths and use cases for both formats:
- </p>
- <section id="strengths-at">
- <title>Area Tree XML (AT XML)</title>
- <ul>
- <li>1:1 representation of FOP's area tree in XML.</li>
- <li>Contains more structure information than the new intermediate format.</li>
- <li>Used in FOP's layout engine test suite for regression testing.</li>
- </ul>
- </section>
- <section id="strengths-if">
- <title>Intermediate Format (IF)</title>
- <ul>
- <li>Highly optimized for speed.</li>
- <li>Smaller XML files.</li>
- <li>Easier to post-process.</li>
- <li>XML Schema is available.</li>
- <li>
- Recommended for use cases where documents are formatted concurrently and later
- concatenated to a single print job.
- </li>
- </ul>
- </section>
- <p>
- More technical information about the two formats can be found on the
- <a href="http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml/NewDesign">FOP Wiki</a>.
- </p>
- </section>
- <section id="architecture">
- <title>Architectural Overview</title>
- <figure src="images/if-architecture-overview.png"
- alt="Diagram with an architectural overview over the intermediate formats"/>
- </section>
- <section id="usage">
- <title>Usage of the Area Tree XML format (AT XML)</title>
- <p>
- As already mentioned, the area tree XML format is generated by using the
- <strong>XMLRenderer</strong> (MIME type: <strong>application/X-fop-areatree</strong>).
- So, you basically set the right MIME type for the output format and process your FO files
- as if you would create a PDF file.
- </p>
- <p>
- However, there is an important detail to consider: The
- various Renderers don't all use the same font sources. To be able to create the right
- area tree for the ultimate output format, you need to create the area tree XML file using
- the right font setup. This is achieved by telling the XMLRenderer to mimic another
- renderer. This is done by calling the XMLRenderer's mimicRenderer() method with an
- instance of the ultimate target renderer as the single parameter. This has a consequence:
- An area tree XML file rendered with the Java2DRenderer may not look as expected when it
- was actually generated for the PDF renderer. For renderers that use the same font setup,
- this restriction does not apply (PDF and PS, for example). Generating the area tree XML
- format file is the first step.
- </p>
- <p>
- The second step is to reparse the file using the <strong>AreaTreeParser</strong> which is
- found in the org.apache.fop.area package. The pages retrieved from the area tree XML file
- are added to an AreaTreeModel instance from where they are normally rendered using one of
- the available Renderer implementations. You can find examples for the area tree XML
- processing in the
- <a href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/"><code>examples/embedding</code></a>
- directory in the FOP distribution.
- </p>
- <p>
- The basic pattern to parse the area tree XML format looks like this:
- </p>
- <source><![CDATA[
-FopFactory fopFactory = FopFactory.newInstance();
-
-// Setup output
-OutputStream out = new java.io.FileOutputStream(pdffile);
-out = new java.io.BufferedOutputStream(out);
-try {
- //Setup fonts and user agent
- FontInfo fontInfo = new FontInfo();
- FOUserAgent userAgent = fopFactory.newFOUserAgent();
-
- //Construct the AreaTreeModel that will received the individual pages
- AreaTreeModel treeModel = new RenderPagesModel(userAgent,
- MimeConstants.MIME_PDF, fontInfo, out);
-
- //Parse the area tree file into the area tree
- AreaTreeParser parser = new AreaTreeParser();
- Source src = new StreamSource(myIFFile);
- parser.parse(src, treeModel, userAgent);
-
- //Signal the end of the processing. The renderer can finalize the target document.
- treeModel.endDocument();
-} finally {
- out.close();
-}]]></source>
- <p>
- This example simply reads an area tree file and renders it to a PDF file. Please note, that in normal
- FOP operation you're shielded from having to instantiate the FontInfo object yourself. This
- is normally a task of the AreaTreeHandler which is not present in this scenario. The same
- applies to the AreaTreeModel instance, in this case an instance of a subclass called
- RenderPagesModel. RenderPagesModel is ideal in this case as it has very little overhead
- processing the individual pages. An important line in the example is the call to
- <code>endDocument()</code> on the AreaTreeModel. This lets the Renderer know that the processing
- is now finished.
- </p>
- <p>
- The area tree XML format can also be used from the <a href="running.html#standalone-start">command-line</a>
- by using the "-atin" parameter for specifying the area tree XML as input file. You can also
- specify a "mimic renderer" by inserting a MIME type between "-at" and the output file.
- </p>
- <section id="concat">
- <title>Concatenating Documents</title>
- <p>
- This initial example is obviously not very useful. It would be faster to create the PDF file
- directly. As the <a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/examples/embedding/java/embedding/atxml/ExampleConcat.java">ExampleConcat.java</a>
- example shows you can easily parse multiple area tree files in a row and add the parsed pages to the
- same AreaTreeModel instance which essentially concatenates all the input document to one single
- output document.
- </p>
- </section>
- <section id="modifying">
- <title>Modifying Documents</title>
- <p>
- One of the most important use cases for this format is obviously modifying the area
- tree XML before finally rendering it to the target format. You can easily use XSLT to process
- the AT XML file according to your needs. Please note, that we will currently not formally describe
- the area tree XML format. You need to have a good understanding its structure so you don't
- create any non-parseable files. We may add an XML Schema and more detailed documentation at a
- later time. You're invited to help us with that.
- </p>
- <note>
- The area tree XML format is sensitive to changes in whitespace. If you're not careful,
- the modified file may not render correctly.
- </note>
- </section>
- <section id="advanced">
- <title>Advanced Use</title>
- <p>
- The generation of the area tree format as well as it parsing process has been designed to allow
- for maximum flexibility and optimization. Please note that you can call <code>setTransformerHandler()</code> on
- XMLRenderer to give the XMLRenderer your own TransformerHandler instance in case you would like to
- do custom serialization (to a W3C DOM, for example) and/or to directly modify the area tree using
- XSLT. The AreaTreeParser on the other side allows you to retrieve a ContentHandler instance where
- you can manually send SAX events to to start the parsing process (see <code>getContentHandler()</code>).
- </p>
- </section>
- </section>
- <section id="usage-if">
- <title>Usage of the Intermediate Format (IF)</title>
- <p>
- The Intermediate Format (IF) is generated by the <strong>IFSerializer</strong>
- (MIME type: <strong>application/X-fop-intermediate-format</strong>).
- So, you basically set the right MIME type for the output format and process your FO files
- as if you would create a PDF file.
- </p>
- <p>
- The IFSerializer is an implementation of the <strong>IFDocumentHandler</strong> and
- <strong>IFPainter</strong> interfaces. The <strong>IFRenderer</strong> class is responsible
- for converting FOP's area tree into calls against these two interfaces.
- </p>
- <ul>
- <li>
- IFDocumentHandler: This interface is used on the document-level and defines the
- overall structure of the Intermediate Format.
- </li>
- <li>
- IFPainter: This interface is used to generate graphical page content like text, images
- and borders.
- </li>
- </ul>
- <p>
- As with the AT XML, there is an important detail to consider: The various output
- implementations don't all use the same font sources. To be able
- to create the right IF for the ultimate output file, you need to create the IF file using
- the right font setup. This is achieved by telling the IFRenderer (responsible for
- converting the area tree into calls to the IFDocumentHandler and IFPainter interfaces)
- to mimic another renderer. This is done by calling the IFSerializer's
- mimicDocumentHandler() method with an instance of the ultimate target document handler
- as the single parameter. This has a consequence: An IF file rendered with the
- Java2DDocumentHandler may not look as expected when it was actually generated for the PDF
- implementation. For implementations that use the same font setup,
- this restriction does not apply (PDF and PS, for example). Generating the Intermediate
- Format file is the first step.
- </p>
- <p>
- The second step is to reparse the file using the <strong>IFParser</strong> which is
- found in the org.apache.fop.render.intermediate package. The IFParser simply takes an
- IFDocumentHandler instance against which it generates the appropriate calls. The IFParser
- is implemented as a SAX ContentHandler so you're free to choose the method for
- post-processing the IF file(s). You can use XSLT or write SAX- or DOM-based code to
- manipulate the contents. You can find examples for the Intermediate Format
- processing in the
- <a href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/"><code>examples/embedding</code></a>
- directory in the FOP distribution.
- </p>
- <p>
- The basic pattern to parse the intermediate format looks like this:
- </p>
- <source><![CDATA[
-FopFactory fopFactory = FopFactory.newInstance();
-
-// Setup output
-OutputStream out = new java.io.FileOutputStream(pdffile);
-out = new java.io.BufferedOutputStream(out);
-try {
- //Setup user agent
- FOUserAgent userAgent = fopFactory.newFOUserAgent();
-
- //Create IFDocumentHandler instance
- IFDocumentHandler targetHandler;
- String mime = MimeConstants.MIME_PDF;
- targetHandler = fopFactory.getRendererFactory().createDocumentHandler(
- userAgent, mime);
-
- //Setup fonts
- IFUtil.setupFonts(targetHandler);
-
- //Tell the target handler where to write the PDF to
- targetHandler.setResult(new StreamResult(pdffile));
-
- //Parse the IF file
- IFParser parser = new IFParser();
- Source src = new StreamSource(myIFFile);
- parser.parse(src, targetHandler, userAgent);
-
-} finally {
- out.close();
-}]]></source>
- <p>
- This example simply reads an intermediate file and renders it to a PDF file. Here
- IFParser.parse() is used, but you can also just get a SAX ContentHandler by using the
- IFParser.getContentHandler() method.
- </p>
- <section id="concat-if">
- <title>Concatenating Documents</title>
- <p>
- This initial example is obviously not very useful. It would be faster to create the PDF file
- directly (without the intermediate step). As the
- <a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/ExampleConcat.java">ExampleConcat.java</a>
- example shows you can easily parse multiple intermediate files in a row and use the
- IFConcatenator class to concatenate page sequences from multiple source files to a single
- output file. This particular example does the concatenation on the level of the
- IFDocumentHandler interface. You could also do this in XSLT or using SAX on the XML level.
- Whatever suits your process best.
- </p>
- </section>
- <section id="modifying-if">
- <title>Modifying Documents</title>
- <p>
- One of the most important use cases for this format is obviously modifying the
- intermediate format before finally rendering it to the target format. You can easily use
- XSLT to process the IF file according to your needs.
- </p>
- <p>
- There is an XML Schema (located under
- <a href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/">src/documentation/intermediate-format-ng</a>)
- that helps you verify that your modified content is correct.
- </p>
- <p>
- For certain output formats there's a caveat: Formats like AFP and PCL do not support
- arbitrary transformations on the IF's "viewport" and "g" elements. Possible are
- only rotations in 90 degree steps and translations.
- </p>
- </section>
- <section id="advanced-if">
- <title>Advanced Use</title>
- <p>
- The generation of the intermediate format as well as it parsing process has been
- designed to allow for maximum flexibility and optimization. So rather than just passing
- in a StreamResult to IFSerializer's setResult() method, you can also use a SAXResult
- or a DOMResult. And as you've already seen , the IFParser on the other side allows you
- to retrieve a ContentHandler instance where you can manually send SAX events to
- start the parsing process (see <code>getContentHandler()</code>).
- </p>
- </section>
- </section>
- </body>
-</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1rc1/known-issues.xml b/src/documentation/content/xdocs/1.1rc1/known-issues.xml
deleted file mode 100644
index c0107317d..000000000
--- a/src/documentation/content/xdocs/1.1rc1/known-issues.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?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$ -->
-<known-issues>
- <known-issue>
- Support for Unicode characters outside of the Base Multilingual Plane (BMP), i.e., characters
- whose code points are greater than 65535, is not yet implemented.
- See <link href="http://issues.apache.org/bugzilla/show_bug.cgi?id=51843">bug 51843</link>.
- </known-issue>
- <known-issue>
- The writing-mode property does not produce the expected behavior when specified on
- <code>fo:simple-page-master</code> or <code>fo:region-*</code> elements.
- See <link href="http://issues.apache.org/bugzilla/show_bug.cgi?id=53276">bug 53276</link>.
- </known-issue>
- <known-issue>
- Support for Devanagari and other Indic scripts is not yet complete.
- </known-issue>
- <known-issue>
- Use of Unicode U+200C ZERO WIDTH NON-JOINER (ZWNJ) or U+200D ZERO WIDTH JOINER (ZWJ)
- does not prevent or force contextual substitution, respectively, when used with Arabic script.
- </known-issue>
- <known-issue>
- Use of Unicode U+200C ZERO WIDTH NON-JOINER (ZWNJ) or U+200D ZERO WIDTH JOINER (ZWJ)
- does not affect conjunct formation or other special behavior prescribed when used with Indic scripts.
- </known-issue>
- <known-issue>
- Support for automatic line breaking at orthographic syllable segment boundaries in Indic
- or Southeast Asian scripts is not yet available. In the mean time, use U+200B ZERO WIDTH SPACE (ZWSP).
- </known-issue>
- <known-issue>
- Complex script content is presently supported only with AT, IF, and PDF output formats.
- </known-issue>
- <known-issue>
- When complex script text encounters an <code>fo:inline</code> or <code>fo:character</code> boundary,
- contextual substitution and ligature formation will not occur across the boundary. This prevents,
- for example, applying a different color to an Arabic Letter within an Arabic word, unless that letter
- is a non-joining letter (on both sides).
- </known-issue>
-</known-issues>
diff --git a/src/documentation/content/xdocs/1.1rc1/knownissues_overview.xml b/src/documentation/content/xdocs/1.1rc1/knownissues_overview.xml
deleted file mode 100644
index f27f98f32..000000000
--- a/src/documentation/content/xdocs/1.1rc1/knownissues_overview.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<document xmlns:xi="http://www.w3.org/2001/XInclude">
- <header>
- <title>Apacheâ„¢ FOP: Known Issues</title>
- <version>$Revision$</version>
- </header>
-<body>
-<section>
- <title>Known issues</title>
- <p>
- This page lists currently known issues in the current release.
- </p>
- <note>
- <p>
- For additional information on known issues in Apacheâ„¢ FOP, please have a look at the following pages, too:
- </p>
- <ul>
- <li><a href="../bugs.html">the bug list in Bugzilla</a></li>
- <li><a href="http://wiki.apache.org/xmlgraphics-fop/FOPProjectTasks">the task list in the Wiki</a></li>
- </ul>
- </note>
- <p>
- Apacheâ„¢ FOP has an extensive automated testing infrastructure. Parts of this infrastructure are several
- sets of test cases. When a test case is listed in disabled-testcases.xml it is disabled in the JUnit
- tests during the normal build process. This indicates a problem in the current codebase. When a bug is
- fixed or a missing feature is added the entry for the relevant test case(s) are removed.
- </p>
- <section>
- <title>FO Tree</title>
- <p>
- This section lists disabled test cases in the test suite for the FO tree tests, at the time
- of the release.
- </p>
- <xi:include href="cocoon://knownissues-raw-fotree_1.1rc1.xml#xpointer(/document/body/*)"/>
- </section>
- <section>
- <title>Layout Engine</title>
- <p>
- This section lists disabled test cases in the test suite for the layout engine tests, at the
- time of the release.
- </p>
- <xi:include href="cocoon://knownissues-raw-layoutengine_1.1rc1.xml#xpointer(/document/body/*)"/>
- </section>
- <section>
- <title>Other known issues</title>
- <p>This section lists some other issues that post-date the release of FOP 1.0. For known issues that pre-date FOP 1.0, see
- <link href="http://issues.apache.org/bugzilla/buglist.cgi?chfieldto=2010-07-20&amp;chfield=%5BBug%20creation%5D&amp;query_format=advanced&amp;chfieldfrom=2001-01-01&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_status=NEEDINFO&amp;product=Fop">older bugs that remain open</link>.
- For all open issues that post-date FOP 1.0, see
- <link href="http://issues.apache.org/bugzilla/buglist.cgi?chfieldto=Now&amp;chfield=%5BBug%20creation%5D&amp;query_format=advanced&amp;chfieldfrom=2010-07-20&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_status=NEEDINFO&amp;product=Fop">newer bugs that remain open</link>.
- </p>
- <!-- See <root>/known-issues.xml for the source document of this section! -->
- <xi:include href="cocoon://knownissues-raw-static_1.1rc1.xml#xpointer(/document/body/*)"/>
- </section>
-</section>
-</body>
-</document>
diff --git a/src/documentation/content/xdocs/1.1rc1/layoutengine/disabled-testcases.xml b/src/documentation/content/xdocs/1.1rc1/layoutengine/disabled-testcases.xml
deleted file mode 100644
index 5208fa91d..000000000
--- a/src/documentation/content/xdocs/1.1rc1/layoutengine/disabled-testcases.xml
+++ /dev/null
@@ -1,223 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?xml-stylesheet type="text/xsl" href="disabled-testcases.xsl"?>
-<!--
- 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$ -->
-<!--DOCTYPE disabled-testcases SYSTEM "disabled-testcases.dtd"-->
-<disabled-testcases>
- <testcase>
- <name>Auto-height block-containers produce fences</name>
- <file>block-container_space-before_space-after_3.xml</file>
- <description>Block-containers with no height currently don't
- create a fence for spaces as they should (they behave like a
- normal block).</description>
- </testcase>
- <testcase>
- <name>font-stretch NYI</name>
- <file>block_font-stretch.xml</file>
- <description>Font-stretch is not implemented, yet.</description>
- </testcase>
- <testcase>
- <name>linefeed-treatment</name>
- <file>block_linefeed-treatment.xml</file>
- <description>Preserved linefeeds in a fo:character are not handled
- correctly.</description>
- </testcase>
- <testcase>
- <name>white-space-treatment</name>
- <file>block_white-space-treatment_3.xml</file>
- <description>White space handling incorrectly stops at fo:inline
- boundaries when it comes to formatter generated line breaks.</description>
- </testcase>
- <testcase>
- <name>Empty blocks produce fences</name>
- <file>block_space-before_space-after_8.xml</file>
- <description>An empty block currently produces a fence for
- stacking constraints which it shouldn't.</description>
- </testcase>
- <testcase>
- <name>block white-space nbsp 2</name>
- <file>block_white-space_nbsp_2.xml</file>
- <description>The nbsp given as an fo:character is not adjustable and therefore
- the justification does not work in this case.</description>
- </testcase>
- <testcase>
- <name>block word-spacing</name>
- <file>block_word-spacing.xml</file>
- <description>Word-spacing may not work as expected.</description>
- </testcase>
- <testcase>
- <name>block word-spacing text-align justify</name>
- <file>block_word-spacing_text-align_justify.xml</file>
- <description>Word-spacing may not work as expected.</description>
- </testcase>
- <testcase>
- <name>external-graphic don't shrink</name>
- <file>external-graphic_oversized.xml</file>
- <description>Images currently don't shrink so they fit on a page
- when they are too big and shrinking is allowed to
- happen (min/opt/max).</description>
- </testcase>
- <testcase>
- <name>Test case with HTTP URL</name>
- <file>external-graphic_src_uri.xml</file>
- <description>Doesn't work behind a proxy which requires
- authorization.</description>
- </testcase>
- <testcase>
- <name>Space Resolution in foot note area</name>
- <file>footnote_space-resolution.xml</file>
- <description>Space resolution does not work between footnote
- regions.</description>
- </testcase>
- <testcase>
- <name>NPE for table inside an inline</name>
- <file>inline_block_nested_3.xml</file>
- <description>Placing a table as a child of an fo:inline produces a
- NullPointerException.</description>
- </testcase>
- <testcase>
- <name>inline-container is not implemented, yet.</name>
- <file>inline-container_block_nested.xml</file>
- <description>inline-container is not implemented, yet. Content of an
- inline-container will get swallowed. The test case contains no checks.</description>
- </testcase>
- <testcase>
- <name>inline-container is not implemented, yet.</name>
- <file>inline-container_border_padding.xml</file>
- <description>inline-container is not implemented, yet. Content of an
- inline-container will get swallowed.</description>
- </testcase>
- <testcase>
- <name>inline letter-spacing</name>
- <file>inline_letter-spacing.xml</file>
- <description>Letter-spacing may not work as
- expected within fo:inline.</description>
- </testcase>
- <testcase>
- <name>inline word-spacing</name>
- <file>inline_word-spacing.xml</file>
- <description>Word-spacing may not work as expected within
- fo:inline.</description>
- </testcase>
- <testcase>
- <name>inline word-spacing text-align justify</name>
- <file>inline_word-spacing_text-align_justify.xml</file>
- <description></description>
- </testcase>
- <testcase>
- <name>leader-alignment NYI</name>
- <file>leader-alignment.xml</file>
- <description>Leader-alignment is not yet
- implemented.</description>
- </testcase>
- <testcase>
- <name>leader-pattern="use-content": Problem with line height</name>
- <file>leader_leader-pattern_use-content_bug.xml</file>
- <description>Line height is not correctly calculated for
- use-content leaders whose height is larger than the rest of the
- line.</description>
- <reference>http://www.nabble.com/leaders-with-leader-pattern%3D%22use-content%22-t546244.html</reference>
- </testcase>
- <testcase>
- <name>Page breaking doesn't deal with IPD changes</name>
- <file>page-breaking_4.xml</file>
- <description>Page breaking currently doesn't support changing available IPD
- between pages of a single page-sequence. Element list generation has to be reset to
- redetermine line breaks in this case.</description>
- </testcase>
- <testcase>
- <name>Overflow handing is incomplete</name>
- <file>page-breaking_6.xml</file>
- <description>Line breaking is not 100% correct when there's too little space.
- Overflows are not detected and warned.</description>
- </testcase>
- <testcase>
- <name>Indefinite page height handling is imcomplete</name>
- <file>page-height_indefinite_simple.xml</file>
- <description>A RuntimeException is thrown for a page of indefinite height. Lots of warnings.</description>
- </testcase>
- <testcase>
- <name>page-number-citation: Problem with background-image</name>
- <file>page-number-citation_background-image.xml</file>
- <description>Background-images on page-number-citations are not
- placed correctly.</description>
- </testcase>
- <testcase>
- <name>IDs are not working on all FO elements</name>
- <file>page-number-citation_complex_1.xml</file>
- <description>The "id" attributes are not properly handled for all block-level FO elements.</description>
- </testcase>
- <testcase>
- <name>IDs are not working on all FO elements</name>
- <file>page-number-citation_complex_2.xml</file>
- <description>The "id" attributes are not properly handled for all inline-level FO elements.</description>
- </testcase>
- <testcase>
- <name>Footnotes in multi-column documents</name>
- <file>region-body_column-count_footnote.xml</file>
- <description>Footnotes may overlap with text of the region-body in
- multi-column documents.</description>
- </testcase>
- <testcase>
- <name>Column Balancing problems</name>
- <file>region-body_column-count_balance_4col.xml</file>
- <description>Situation in a 4-column document where the column balancing doesn't work and even causes some
- content to disappear.</description>
- </testcase>
- <testcase>
- <name>Column Balancing problems</name>
- <file>region-body_column-count_bug36356.xml</file>
- <description>Column balancing doesn't work as expected.</description>
- </testcase>
- <testcase>
- <name>table-cell empty area with marker.xml</name>
- <file>table-cell_empty_area_with_marker.xml</file>
- <description>A table-cell producing an empty area does currently not add any markers to a page.
- See TODO entry in AreaAdditionUtil.</description>
- </testcase>
- <testcase>
- <name>Border conditionality on table</name>
- <file>table_border-width_conditionality.xml</file>
- <description>The code should be ok, but the test case uses shorthands and therefore
- is probably not expressing the indended outcome according to the spec. The test
- case should be revisited.</description>
- </testcase>
- <testcase>
- <name>Soft hyphen with normal hyphenation enabled</name>
- <file>block_shy_linebreaking_hyph.xml</file>
- <description>A soft hyphen should be a preferred as break compared to a
- normal hyphenation point but is not.</description>
- </testcase>
- <testcase>
- <name>Page-keep not respected in multi-column layout</name>
- <file>keep_within-page_multi-column_overflow.xml</file>
- <description>The block should cause overflow in the
- last column on the page, rather than be broken.</description>
- </testcase>
- <testcase>
- <name>Block Container Reference Orientation Bug</name>
- <file>block-container_reference-orientation_bug36391.xml</file>
- <description>An assert is failing</description>
- </testcase>
- <testcase>
- <name>Writing mode problems</name>
- <file>simple-page-master_writing-mode_rl_region-body_writing-mode-lr.xml</file>
- <description>Test erroneously depends upon incorrect implementation of writing-mode trait
- derivation on fo:region-*.</description>
- </testcase>
-</disabled-testcases>
diff --git a/src/documentation/content/xdocs/1.1rc1/metadata.xml b/src/documentation/content/xdocs/1.1rc1/metadata.xml
deleted file mode 100644
index 5d4185533..000000000
--- a/src/documentation/content/xdocs/1.1rc1/metadata.xml
+++ /dev/null
@@ -1,243 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP: Metadata</title>
- </header>
- <body>
- <section id="overview">
- <title>Overview</title>
- <p>
- Document metadata is an important tool for categorizing and finding documents.
- Various formats support different kinds of metadata representation and to
- different levels. One of the more popular and flexible means of representing
- document or object metadata is
- <a href="http://www.adobe.com/products/xmp/">XMP (eXtensible Metadata Platform, specified by Adobe)</a>.
- PDF 1.4 introduced the use of XMP. The XMP specification lists recommendation for
- embedding XMP metdata in other document and image formats. Given its flexibility it makes
- sense to make use this approach in the XSL-FO context. Unfortunately, unlike SVG which
- also refers to XMP, XSL-FO doesn't recommend a preferred way of specifying document and
- object metadata. Therefore, there's no portable way to represent metadata in XSL-FO
- documents. Each implementation does it differently.
- </p>
- </section>
- <section id="xmp-in-fo">
- <title>Embedding XMP in an XSL-FO document</title>
- <p>
- As noted above, there's no officially recommended way to embed metadata in XSL-FO.
- Apacheâ„¢ FOP supports embedding XMP in XSL-FO. Currently, only support for document-level
- metadata is implemented. Object-level metadata will be implemented when there's
- interest.
- </p>
- <p>
- Document-level metadata can be specified in the <code>fo:declarations</code> element.
- XMP specification recommends to use <code>x:xmpmeta</code>, <code>rdf:RDF</code>, and
- <code>rdf:Description</code> elements as shown in example below. Both
- <code>x:xmpmeta</code> and <code>rdf:RDF</code> elements are recognized as the top-level
- element introducing an XMP fragment (as per the XMP specification).
- </p>
- <section id="xmp-example">
- <title>Example</title>
- <source><![CDATA[[..]
-</fo:layout-master-set>
-<fo:declarations>
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <rdf:Description rdf:about=""
- xmlns:dc="http://purl.org/dc/elements/1.1/">
- <!-- Dublin Core properties go here -->
- <dc:title>Document title</dc:title>
- <dc:creator>Document author</dc:creator>
- <dc:description>Document subject</dc:description>
- </rdf:Description>
- <rdf:Description rdf:about=""
- xmlns:xmp="http://ns.adobe.com/xap/1.0/">
- <!-- XMP properties go here -->
- <xmp:CreatorTool>Tool used to make the PDF</xmp:CreatorTool>
- </rdf:Description>
- </rdf:RDF>
- </x:xmpmeta>
-</fo:declarations>
-<fo:page-sequence ...
-[..]]]></source>
- <note>
- <code>fo:declarations</code> <strong>must</strong> be declared after
- <code>fo:layout-master-set</code> and before the first <code>page-sequence</code>.
- </note>
- </section>
- </section>
- <section id="xmp-impl-in-fop">
- <title>Implementation in Apache FOP</title>
- <p>
- Currently, XMP support is only available for PDF output.
- </p>
- <p>
- Originally, you could set some metadata information through FOP's FOUserAgent by
- using its set*() methods (like setTitle(String) or setAuthor(String). These values are
- directly used to set value in the PDF Info object. Since PDF 1.4, adding metadata as an
- XMP document to a PDF is possible. That means that there are now two mechanisms in PDF
- that hold metadata.
- </p>
- <p>
- Apache FOP now synchronizes the Info and the Metadata object in PDF, i.e. when you
- set the title and the author through the FOUserAgent, the two values will end up in
- the (old) Info object and in the new Metadata object as XMP content. If instead of
- FOUserAgent, you embed XMP metadata in the XSL-FO document (as shown above), the
- XMP metadata will be used as-is in the PDF Metadata object and some values from the
- XMP metadata will be copied to the Info object to maintain backwards-compatibility
- for PDF readers that don't support XMP metadata.
- </p>
- <p>
- The mapping between the Info and the Metadata object used by Apache FOP comes from
- the <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=38920">PDF/A-1 specification</a>.
- For convenience, here's the mapping table:
- </p>
- <table>
- <tr>
- <th colspan="2">Document information dictionary</th>
- <th colspan="3">XMP</th>
- </tr>
- <tr>
- <th>Entry</th>
- <th>PDF type</th>
- <th>Property</th>
- <th>XMP type</th>
- <th>Category</th>
- </tr>
- <tr>
- <td>Title</td>
- <td>text string</td>
- <td>dc:title</td>
- <td>Text</td>
- <td>External</td>
- </tr>
- <tr>
- <td>Author</td>
- <td>text string</td>
- <td>dc:creator</td>
- <td>seq Text</td>
- <td>External</td>
- </tr>
- <tr>
- <td>Subject</td>
- <td>text string</td>
- <td>dc:description["x-default"]</td>
- <td>Text</td>
- <td>External</td>
- </tr>
- <tr>
- <td>Keywords</td>
- <td>text string</td>
- <td>pdf:Keywords</td>
- <td>Text</td>
- <td>External</td>
- </tr>
- <tr>
- <td>Creator</td>
- <td>text string</td>
- <td>xmp:CreatorTool</td>
- <td>Text</td>
- <td>External</td>
- </tr>
- <tr>
- <td>Producer</td>
- <td>text string</td>
- <td>pdf:Producer</td>
- <td>Text</td>
- <td>Internal</td>
- </tr>
- <tr>
- <td>CreationDate</td>
- <td>date</td>
- <td>xmp:CreationDate</td>
- <td>Date</td>
- <td>Internal</td>
- </tr>
- <tr>
- <td>ModDate</td>
- <td>date</td>
- <td>xmp:ModifyDate</td>
- <td>Date</td>
- <td>Internal</td>
- </tr>
- </table>
- <note>
- "Internal" in the Category column means that the user should not set this value.
- It is set by the application.
- </note>
- <note>
- The "Subject" used to be mapped to <code>dc:subject</code> in the initial publication of
- PDF/A-1 (ISO 19005-1). In the
- <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=45613">Technical Corrigendum 1</a>
- this was changed to map to <code>dc:description["x-default"]</code>.
- </note>
- <section id="namespaces">
- <title>Namespaces</title>
- <p>
- Metadata is made of property sets where each property set uses a different namespace URI.
- </p>
- <p>
- The following is a listing of namespaces that Apache FOP recognizes and acts upon,
- mostly to synchronize the XMP metadata with the PDF Info dictionary:
- </p>
- <table>
- <tr>
- <th>Set/Schema</th>
- <th>Namespace Prefix</th>
- <th>Namespace URI</th>
- </tr>
- <tr>
- <td>Dublin Core</td>
- <td>dc</td>
- <td>http://purl.org/dc/elements/1.1/</td>
- </tr>
- <tr>
- <td>XMP Basic</td>
- <td>xmp</td>
- <td>http://ns.adobe.com/xap/1.0/</td>
- </tr>
- <tr>
- <td>Adobe PDF Schema</td>
- <td>pdf</td>
- <td>http://ns.adobe.com/pdf/1.3/</td>
- </tr>
- </table>
- <p>
- Please refer to the <a href="http://partners.adobe.com/public/developer/en/xmp/sdk/XMPspecification.pdf">XMP Specification</a>
- for information on other metadata namespaces.
- </p>
- <p>
- Property sets (Namespaces) not listed here are simply passed through to the final
- document (if supported). That is useful if you want to specify a custom metadata
- schema.
- </p>
- </section>
- </section>
- <section id="links">
- <title>Links</title>
- <ul>
- <li><a href="http://www.adobe.com/products/xmp/">Adobe's Extensible Metadata Platform (XMP) website</a></li>
- <li><a href="http://partners.adobe.com/public/developer/en/xmp/sdk/XMPspecification.pdf">Adobe XMP Specification</a></li>
- <li><a href="http://partners.adobe.com/public/developer/en/xmp/sdk/XMPspecification.pdf">Adobe XMP Specification</a></li>
- <li><a href="http://dublincore.org/">http://dublincore.org/</a></li>
- </ul>
- </section>
- </body>
-</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1rc1/output.xml b/src/documentation/content/xdocs/1.1rc1/output.xml
deleted file mode 100644
index cabbbb0fa..000000000
--- a/src/documentation/content/xdocs/1.1rc1/output.xml
+++ /dev/null
@@ -1,1401 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<!-- Output Formats: Renderers -->
-<document>
- <header>
- <title>Apacheâ„¢ FOP Output Formats</title>
- <version>$Revision$</version>
- <authors>
- <person name="Keiron Liddle" email="keiron@aftexsw.com"/>
- <person name="Art Welch" email=""/>
- </authors>
- </header>
-
- <body>
- <p>
- Apacheâ„¢ FOP supports multiple output formats by using a different renderer for each format.
- The renderers do not all have the same set of capabilities, sometimes because of
- the output format itself, sometimes because some renderers get more development
- attention than others.
- </p>
- <section id="general">
- <title>General Information</title>
- <section id="general-fonts">
- <title>Fonts</title>
- <p>
- Most FOP renderers use a FOP-specific system for font registration.
- However, the Java2D/AWT and print renderers use the Java AWT package, which gets its
- font information from the operating system registration.
- This can result in several differences, including actually using different fonts,
- and having different font metrics for the same font.
- The net effect is that the layout of a given FO document can be quite different between
- renderers that do not use the same font information.
- </p>
- <p>
- Theoretically, there's some potential to make the output of the PDF/PS renderers match
- the output of the Java2D-based renderers. If FOP used the font metrics from its own
- font subsystem but still used Java2D for text painting in the Java2D-based renderers,
- this could probably be achieved. However, this approach hasn't been implemented, yet.
- </p>
- <p>
- With a work-around, it is possible to match the PDF/PS output in a Java2D-based
- renderer pretty closely. The clue is to use the
- <a href="intermediate.html">intermediate format</a>. The trick is to layout the
- document using FOP's own font subsystem but then render the document using Java2D.
- Here are the necessary steps (using the command-line):
- </p>
- <ol>
- <li>
- Produce an IF file: <code>fop -fo myfile.fo -at application/pdf myfile.at.xml</code><br/>
- Specifying "application/pdf" for the "-at" parameter causes FOP to use FOP's own
- font subsystem (which is used by the PDF renderer). Note that no PDF file is created
- in this step.
- </li>
- <li>Render to a PDF file: <code>fop -atin myfile.at.xml -pdf myfile.pdf</code></li>
- <li>Render to a Java2D-based renderer:
- <ul>
- <li><code>fop -atin myfile.at.xml -print</code></li>
- <li><code>fop -atin myfile.at.xml -awt</code></li>
- <li><code>fop -atin myfile.at.xml -tiff myfile.tiff</code></li>
- </ul>
- </li>
- </ol>
- </section>
- <section id="general-direct-output">
- <title>Output to a Printer or Other Device</title>
- <p>
- The most obvious way to print your document is to use the FOP
- <a href="#print">print renderer</a>, which uses the Java2D API (AWT).
- However, you can also send output from the Postscript renderer directly to a Postscript
- device, or output from the PCL renderer directly to a PCL device.
- </p>
- <p>
- Here are Windows command-line examples for Postscript and PCL:
- </p>
- <source><![CDATA[fop ... -ps \\computername\printer]]></source>
- <source><![CDATA[fop ... -pcl \\computername\printer]]></source>
- <p>
- Here is some Java code to accomplish the task in UNIX:
- </p>
- <source><![CDATA[proc = Runtime.getRuntime().exec("lp -d" + print_queue + " -o -dp -");
-out = proc.getOutputStream();]]></source>
- <p>
- Set the output MIME type to "application/x-pcl" (MimeConstants.MIME_PCL) and
- it happily sends the PCL to the UNIX printer queue.
- </p>
- </section>
- </section>
- <section id="pdf">
- <title>PDF</title>
- <p>
- PDF is the best supported output format. It is also the most accurate
- with text and layout. This creates a PDF document that is streamed out
- as each page is rendered. This means that the internal page index
- information is stored near the end of the document.
- The PDF version supported is 1.4. PDF versions are forwards/backwards
- compatible.
- </p>
- <p>
- Note that FOP does not currently support PDF/A-1a.
- Support for <a href="accessibility.html">Tagged PDF</a>, <a href="pdfa.html">PDF/A-1b</a>
- and <a href="pdfx.html">PDF/X</a> has recently been added, however.
- </p>
- <section id="pdf-fonts">
- <title>Fonts</title>
- <p>
- PDF has a set of fonts that are always available to all PDF viewers;
- to quote from the PDF Specification:
-
- <em>"PDF prescribes a set of 14 standard fonts that can be used without prior
- definition.
- These include four faces each of three Latin text typefaces (Courier,
- Helvetica, and Times), as well as two symbolic fonts (Symbol and ITC Zapf
- Dingbats). These fonts, or suitable substitute fonts with the same metrics, are
- guaranteed to be available in all PDF viewer applications."</em>
- </p>
- </section>
- <section id="pdf-postprocess">
- <title>Post-processing</title>
- <p>
- FOP does not currently support several desirable PDF features: watermarks and signatures.
- One workaround is to use Adobe Acrobat (the full version, not the Reader) to process
- the file manually or with scripting that it supports.
- </p>
- <p>
- Another popular post-processing tool is <a href="http://www.lowagie.com/iText">iText</a>,
- which has tools for adding security features, document properties, watermarks, and many
- other features to PDF files.
- </p>
- <warning>
- Caveat: iText may swallow PDF bookmarks. But
- <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=37589">Jens Stavnstrup tells us</a>
- that this doesn't happen if you use iText's PDFStamper.
- </warning>
- <p>
- Here is some sample code that uses iText to encrypt a FOP-generated PDF. (Note that FOP now
- supports <a href="pdfencryption.html">PDF encryption</a>. However the principles for using
- iText for other PDF features are similar.)
- </p>
- <source><![CDATA[public static void main(String args[]) {
- try {
- ByteArrayOutputStream fopout = new ByteArrayOutputStream();
- FileOutputStream outfile = new FileOutputStream(args[2]);
- FopFactory fopFactory = FopFactory.newInstance();
- Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, fopout);
-
- Transformer transformer = TransformerFactory.newInstance().newTransformer(
- new StreamSource(new File(args[1])));
- transformer.transform(new StreamSource(new File(args[0])),
- new SAXResult(fop.getDefaultHandler()));
- PdfReader reader = new PdfReader(fopout.toByteArray());
- int n = reader.getNumberOfPages();
- Document document = new Document(reader.getPageSizeWithRotation(1));
- PdfWriter writer = PdfWriter.getInstance(document, outfile);
- writer.setEncryption(PdfWriter.STRENGTH40BITS, "pdf", null,
- PdfWriter.AllowCopy);
- document.open();
- PdfContentByte cb = writer.getDirectContent();
- PdfImportedPage page;
- int rotation;
- int i = 0;
- while (i < n) {
- i++;
- document.setPageSize(reader.getPageSizeWithRotation(i));
- document.newPage();
- page = writer.getImportedPage(reader, i);
- rotation = reader.getPageRotation(i);
- if (rotation == 90 || rotation == 270) {
- cb.addTemplate(page, 0, -1f, 1f, 0, 0,
- reader.getPageSizeWithRotation(i).height());
- } else {
- cb.addTemplate(page, 1f, 0, 0, 1f, 0, 0);
- }
- System.out.println("Processed page " + i);
- }
- document.close();
- } catch( Exception e) {
- e.printStackTrace();
- }
-}]]></source>
- <p>
- Check the iText tutorial and documentation for setting access flags, password,
- encryption strength and other parameters.
- </p>
- </section>
- <section id="pdf-watermark">
- <title>Watermarks</title>
- <p>
- In addition to the <a href="#pdf-postprocess">PDF Post-processing</a> options, consider the following workarounds:
- </p>
- <ul>
- <li>
- Use a background image for the body region.
- </li>
- <li>
- (submitted by Trevor Campbell) Place an image in a
- region that overlaps the flowing text. For example, make
- region-before large enough to contain your image. Then include a
- block (if necessary, use an absolutely positioned block-container)
- containing the watermark image in the static-content for the
- region-before. Note that the image will be drawn on top of the
- normal content.
- </li>
- </ul>
- </section>
- <section id="pdf-extensions">
- <title>Extensions</title>
- <p>The PDF Renderer supports some PDF specific extensions which can be embedded
- into the input FO document. To use the extensions the appropriate namespace must
- be declared in the fo:root element like this:</p>
- <source><![CDATA[
-<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
- ]]></source>
- <section id="pdf-embedded-file">
- <title>Embedded Files</title>
- <p>
- It is possible to attach/embed arbitrary files into a PDF file. You can give a name and
- a description of the file. Example:
- </p>
- <source><![CDATA[
- <fo:declarations>
- <pdf:embedded-file filename="image.jpg" src="url(file:///C:/Temp/myimage.jpg)" description="My image"/>
- <pdf:embedded-file src="url(file:///C:/Temp/MyTextDoc.odt)"/>
- </fo:declarations>
- ]]></source>
- <p>
- <code>pdf:embedded-file</code> must be a child of <code>fo:declarations</code>.
- The "src" property is used to reference the file that is to be embedded. This property
- uses the "uri-specification" datatype from the XSL-FO specification.
- The "filename" property is optional. If it is missing the filename is automatically set
- from the URI/IRI of the "src" property. An optional description can also be added to
- further describe the file attachment.
- </p>
- <p>
- It is also possible to reference an embedded file from an <code>fo:basic-link</code>.
- Use the special "embedded-file:" URI scheme with the filename as single argument after
- the URI scheme. Example:
- </p>
- <source><![CDATA[
-<fo:basic-link external-destination="url(embedded-file:image.jpg)">Attached Image</fo:basic-link>
-]]></source>
- <p>
- Note: Not all PDF Viewers (including some Acrobat Versions) will open the embedded file
- when clicking on the link. In that case, the user will have to open he attachment via
- the separate list of file attachments.
- </p>
- </section>
- </section>
- </section>
-<section id="ps">
- <title>PostScript</title>
- <p>
- The PostScript renderer has been brought up to a similar quality as the
- PDF renderer, but may still be missing certain features. It provides good
- support for most text and layout.
- Images and SVG are not fully supported, yet. Currently, the PostScript
- renderer generates PostScript Level 3 with most DSC comments. Actually,
- the only Level 3 features used are the FlateDecode and DCTDecode
- filter (the latter is used for 1:1 embedding of JPEG images), everything
- else is Level 2.
- </p>
- <section id="ps-configuration">
- <title>Configuration</title>
- <p>
- The PostScript renderer configuration currently allows the following settings:
- </p>
-<source><![CDATA[<renderer mime="application/postscript">
- <auto-rotate-landscape>false</auto-rotate-landscape>
- <language-level>3</language-level>
- <optimize-resources>false</optimize-resources>
- <safe-set-page-device>false</safe-set-page-device>
- <dsc-compliant>true</dsc-compliant>
- <rendering>quality</rendering>
-</renderer>]]></source>
- <p>
- The default value for the "auto-rotate-landscape" setting is "false". Setting it
- to "true" will automatically rotate landscape pages and will mark them as landscape.
- </p>
- <p>
- The default value for the "language-level" setting is "3". This setting specifies
- the PostScript language level which should be used by FOP. Set this to "2"
- only if you don't have a Level 3 capable interpreter.
- </p>
- <p>
- The default value for the "optimize-resources" setting is "false". Setting it
- to "true" will produce the PostScript file in two steps. A temporary file will be
- written first which will then be processed to add only the fonts which were really
- used and images are added to the stream only once as PostScript forms. This will
- reduce file size but can potentially increase the memory needed in the interpreter
- to process.
- </p>
- <p>
- The default value for the "safe-set-page-device" setting is "false". Setting it
- to "true" will cause the renderer to invoke a postscript macro which guards against
- the possibility of invalid/unsupported postscript key/values being issued to the
- implementing postscript page device.
- </p>
- <p>
- The default value for the "dsc-compliant" setting is "true". Setting it
- to "false" will break DSC compliance by minimizing the number of setpagedevice
- calls in the postscript document output. This feature may be useful when unwanted
- blank pages are experienced in your postscript output. This problem is caused by
- the particular postscript implementation issuing unwanted postscript subsystem
- initgraphics/erasepage calls on each setpagedevice call.
- </p>
- <p>
- The default value for the "rendering" setting is "quality". Setting it to "size"
- optimizes rendering for smaller file sizes which can involve minor compromises in
- rendering quality. For example, solid borders are then painted as plain rectangles
- instead of the elaborate painting instructions required for mixed-color borders.
- </p>
- </section>
- <section id="ps-limitations">
- <title>Limitations</title>
- <ul>
- <li>Images and SVG may not be displayed correctly. SVG support is far from being complete. No image transparency is available.</li>
- <li>Only Type 1 fonts are supported.</li>
- <li>Multibyte characters are not supported.</li>
- <li>PPD support is still missing.</li>
- </ul>
- </section>
-</section>
- <section id="pcl">
- <title>PCL</title>
- <p>
- This format is for the Hewlett-Packard PCL printers and other printers
- supporting PCL. It should produce output as close to identical as possible
- to the printed output of the PDFRenderer within the limitations of the
- renderer, and output device.
- </p>
- <p>
- The output created by the PCLRenderer is generic PCL 5, HP GL/2 and PJL.
- This should allow any device fully supporting PCL 5 to be able to
- print the output generated by the PCLRenderer. PJL is used to control the
- print job and switch to the PCL language. PCL 5 is used for text, raster
- graphics and rectangular fill graphics. HP GL/2 is used for more complex
- painting operations. Certain painting operations are done off-screen and
- rendered to PCL as bitmaps because of limitations in PCL 5.
- </p>
- <section id="pcl-references">
- <title>References</title>
- <ul>
- <li><a href="http://en.wikipedia.org/wiki/Printer_Control_Language">WikiPedia entry on PCL</a></li>
- <li><a href="http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpl04568">Technical reference documents on PCL from Hewlett-Packard</a></li>
- </ul>
- </section>
- <section id="pcl-limitations">
- <title>Limitations</title>
- <ul>
- <li>
- Text or graphics outside the left or top of the printable area are not
- rendered properly. This is a limitation of PCL, not FOP. In general,
- things that should print to the left of the printable area are shifted
- to the right so that they start at the left edge of the printable area.
- </li>
- <li>
- The Helvetica and Times fonts are not well supported among PCL printers
- so Helvetica is mapped to Arial and Times is mapped to Times New. This
- is done in the PCLRenderer, no changes are required in the FO's. The
- metrics and appearance for Helvetica/Arial and Times/Times New are
- nearly identical, so this has not been a problem so far.
- </li>
- <li>For the non-symbol fonts, the ISO 8859-1 symbol set is used (PCL set "0N").</li>
- <li>
- All fonts available to the Java2D subsystem are usable. The texts are
- painted as bitmap much like the Windows PCL drivers do.
- </li>
- <li>Multibyte characters are not supported.</li>
- <li>
- At the moment, only monochrome output is supported. PCL5c color extensions
- will only be implemented on demand. Color and grayscale images are converted
- to monochrome bitmaps (1-bit). Dithering only occurs if the JAI image library
- is available.
- </li>
- <li>
- Images are scaled up to the next resolution level supported by PCL (75,
- 100, 150, 200, 300, 600 dpi). For color and grayscale images an even
- higher PCL resolution is selected to give the dithering algorithm a chance
- to improve the bitmap quality.
- </li>
- <li>
- Currently, there's no support for clipping and image transparency, largely
- because PCL 5 has certain limitations.
- </li>
- </ul>
- </section>
- <section id="pcl-configuration">
- <title>Configuration</title>
- <p>
- The PCL renderer configuration currently allows the following settings:
- </p>
-<source><![CDATA[<renderer mime="application/x-pcl">
- <rendering>quality</rendering>
- <text-rendering>bitmap</text-rendering>
- <disable-pjl>false</disable-pjl>
-</renderer>]]></source>
- <p>
- The default value for the "rendering" setting is "speed" which causes borders
- to be painted as plain rectangles. In this mode, no special borders (dotted,
- dashed etc.) are available. If you want support for all border modes, set the
- value to "quality" as indicated above. This will cause the borders to be painted
- as bitmaps.
- </p>
- <p>
- The default value for the "text-rendering" setting is "auto" which paints the
- base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D.
- If the mix of painting methods results in unwelcome output, you can set this
- to "bitmap" which causes all text to be rendered as bitmaps.
- </p>
- <p>
- The default value for the "disable-pjl" setting is "false". This means that
- the PCL renderer usually generates PJL commands before and after the document
- in order to switch a printer into PCL language. PJL commands can be disabled
- if you set this value to "true".
- </p>
- <p>
- You can control the output resolution for the PCL using the "target resolution"
- setting on the FOUserAgent. The actual value will be rounded up to the next
- supported PCL resolution. Currently, only 300 and 600 dpi are supported which
- should be enough for most use cases. Note that this setting directly affects
- the size of the output file and the print quality.
- </p>
- </section>
- <section id="pcl-extensions">
- <title>Extensions</title>
- <p>The PCL Renderer supports some PCL specific extensions which can be embedded
- into the input FO document. To use the extensions the appropriate namespace must
- be declared in the fo:root element like this:</p>
- <source><![CDATA[
- <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:pcl="http://xmlgraphics.apache.org/fop/extensions/pcl">
-]]></source>
- <section id="pcl-page-source">
- <title>Page Source (Tray selection)</title>
- <p>
- The page-source extension attribute on fo:simple-page-master allows to
- select the paper tray the sheet for a particular simple-page-master is
- to be taken from. Example:
- </p>
- <source><![CDATA[
- <fo:layout-master-set>
- <fo:simple-page-master master-name="simple" pcl:paper-source="2">
- ...
- </fo:simple-page-master>
- </fo:layout-master-set>
-]]></source>
- <p>
- Note: the tray number is a positive integer and the value depends on
- the target printer. Not all PCL printers support the same paper trays.
- Usually,
- "1" is the default tray,
- "2" is the manual paper feed,
- "3" is the manual envelope feed,
- "4" is the "lower" tray and
- "7" is "auto-select".
- Consult the technical reference for your printer for all available values.
- </p>
- </section>
- <section id="pcl-output-bin">
- <title>Output Bin</title>
- <p>
- The <code>output-bin</code> extension attribute on fo:simple-page-master allows to
- select the output bin into which the printed output should be fed. Example:
- </p>
- <source><![CDATA[
- <fo:layout-master-set>
- <fo:simple-page-master master-name="simple" pcl:output-bin="2">
- ...
- </fo:simple-page-master>
- </fo:layout-master-set>
-]]></source>
- <p>
- Note: the output bin number is a positive integer and the value depends on
- the target printer. Not all PCL printers support the same output bins.
- Usually,
- "1" is the upper output bin,
- "2" is the lower (rear) output bin.
- Consult the technical reference for your printer for all available values.
- </p>
- </section>
- <section id="pcl-duplex-mode">
- <title>Page Duplex Mode</title>
- <p>
- The duplex-mode extension attribute on fo:simple-page-master allows to
- select the duplex mode to be used for a particular simple-page-master.
- Example:
- </p>
- <source><![CDATA[
- <fo:layout-master-set>
- <fo:simple-page-master master-name="simple" pcl:duplex-mode="0">
- ...
- </fo:simple-page-master>
- </fo:layout-master-set>
-]]></source>
- <p>
- Note: the duplex is a positive integer and the value depends on
- the target printer. Not all PCL printers support duplexing.
- Usually,
- "0" is simplex,
- "1" is duplex (long-edge binding),
- "2" is duplex (short-edge binding).
-
- Consult the technical reference for your printer for all available values.
- </p>
- </section>
- </section>
- </section>
- <section id="afp">
- <title>AFP</title>
- <p>
- The FOP AFP Renderer deals with creating documents conforming to the IBM AFP document architecture
- also refered to as MO:DCA (Mixed Object Document Content Architecture).
- </p>
- <p>
- The mapping of XSL-FO elements to the major MO:DCA structures is as follows:
- </p>
- <table>
- <tr>
- <th>XSL-FO element</th>
- <th>MO:DCA-P object</th>
- </tr>
- <tr>
- <td>fo:root</td>
- <td>Document</td>
- </tr>
- <tr>
- <td>fo:page-sequence</td>
- <td>Page Group</td>
- </tr>
- <tr>
- <td>fo:simple-page-master</td>
- <td>Page</td>
- </tr>
- </table>
- <p>
- FOP creates exactly one Document per Printfile with an optional Resource Group at the
- beginning. FOP does not create document indices.
- </p>
- <section id="afp-references">
- <title>References</title>
- <ul>
- <li><a href="http://en.wikipedia.org/wiki/Advanced_Function_Presentation">AFP (Advanced Function Presentation)</a></li>
- <li><a href="http://wiki.apache.org/xmlgraphics-fop/AFPResources">AFP Resources on the FOP WIKI</a></li>
- <li><a href="http://wiki.apache.org/xmlgraphics-fop/AFPOutput">Technical notes on AFP output in FOP</a></li>
- </ul>
- </section>
- <section id="afp-limitations">
- <title>Limitations</title>
- <p>This list is most likely badly incomplete.</p>
- <ul>
- <li>
- Clipping of text and graphics is not supported.
- </li>
- <li>
- Only IBM outline and raster fonts and to a limited extend the original fonts built into FOP are supported.
- Support for TrueType fonts may be added later.
- </li>
- </ul>
- </section>
- <section id="afp-compatibility">
- <title>Deployment in older environments</title>
- <p>
- There are still a big number of older (or limited) MO:DCA/IPDS environments in production
- out there. AFP has grown in functionality over time and not every environment supports the
- latest features. We're trying to make AFP output work in as many environments as possible.
- However, to make AFP output work on older environments it is recommended to set to
- configuration to 1 bit per pixel (see below on how to do this). In this case, all images
- are converted to bi-level images using IOCA function set 10 (FS10) and are enclosed in
- page-segments since some implementation cannot deal with IOCA objects directly.
- If a higher number of bits per pixel is configured, FOP has to switch to at least FS11
- which may not work everywhere.
- </p>
- </section>
- <section id="afp-configuration">
- <title>Configuration</title>
- <section id="afp-font-config">
- <title>Fonts</title>
- <p>The AFP Renderer requires special configuration particularly related to fonts.
- AFP Render configuration is done through the normal FOP configuration file. The MIME type
- for the AFP Renderer is application/x-afp which means the AFP Renderer section in the FOP configuration file
- looks like:</p>
- <source><![CDATA[<renderer mime="application/x-afp">
- <!-- AFP Renderer -->
- ...
-</renderer>]]></source>
- <p>There are 4 font configuration variants supported:</p>
- <ol>
- <li>IBM Raster fonts</li>
- <li>IBM Outline fonts</li>
- <li>IBM CID-keyed (Type 0) fonts</li>
- <li>FOP built-in Base14 fonts</li>
- </ol>
- <p>A typical raster font configuration looks like:</p>
-<source><![CDATA[ <!-- This is an example of mapping actual IBM raster fonts / code pages to a FOP font -->
- <font>
- <!-- The afp-font element defines the IBM code page, the matching Java encoding and the
- base URI for the font -->
- <afp-font type="raster" codepage="T1V10500" encoding="Cp500" base-uri="fonts/ibm/">
- <!-- For a raster font a separate element for each font size is required providing
- the font size and the corresponding IBM Character set name -->
- <afp-raster-font size="7" characterset="C0N20070"/>
- <afp-raster-font size="8" characterset="C0N20080"/>
- <afp-raster-font size="10" characterset="C0N20000"/>
- <afp-raster-font size="11" characterset="C0N200A0"/>
- <afp-raster-font size="12" characterset="C0N200B0"/>
- <afp-raster-font size="14" characterset="C0N200D0"/>
- <afp-raster-font size="16" characterset="C0N200F0"/>
- <afp-raster-font size="18" characterset="C0N200H0"/>
- <afp-raster-font size="20" characterset="C0N200J0"/>
- <afp-raster-font size="24" characterset="C0N200N0"/>
- <afp-raster-font size="30" characterset="C0N200T0"/>
- <afp-raster-font size="36" characterset="C0N200Z0"/>
- </afp-font>
- <!-- These are the usual FOP font triplets as they apply to this font -->
- <font-triplet name="serif" style="normal" weight="normal"/>
- <font-triplet name="Times" style="normal" weight="normal"/>
- <font-triplet name="Times-Roman" style="normal" weight="normal"/>
- <font-triplet name="TimesNewRoman" style="normal" weight="normal"/>
- </font>]]></source>
- <p>An outline font configuration is simpler as the individual font size entries are not required.
- However, the characterset definition is now required within the afp-font element.</p>
-<source><![CDATA[ <font>
- <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH200 "
- base-uri="file:/fonts/ibm" />
- <font-triplet name="sans-serif" style="normal" weight="normal"/>
- <font-triplet name="Helvetica" style="normal" weight="normal"/>
- <font-triplet name="any" style="normal" weight="normal"/>
- </font>
-]]></source>
- <p>
- If "base-uri" is missing or a relative URI, the fonts are resolved relative to
- the font base URI specified in the configuration (or on the FopFactory).
- </p>
- <note>
- Previously, the location of the font files was given by the "path" attribute. This is still
- supported for the time being, but you should move to using the more flexible "base-uri"
- attribute so you can profit from the power of URI resolvers.
- </note>
- <p>A CID-keyed font (Type 0, double-byte outline font) configuration is much the same as an outline font.
- However, the characterset definition is now required within the afp-font element.</p>
-<source><![CDATA[ <font>
- <afp-font type="CIDKeyed" characterset="CZJHMNU"
- codepage="T1120000" encoding="UnicodeBigUnmarked"
- base-uri="file:/fonts/ibm" />
- <font-triplet name="J-Heisei Mincho" style="normal" weight="normal" />
- </font>
-]]></source>
- <p>
-Note that the value of the encoding attribute in the example is the double-byte encoding 'UnicodeBigUnmarked' (UTF-16BE).
- </p>
- <p>Experimentation has shown that the font metrics for the FOP built-in Base14 fonts are actually
- very similar to some of the IBM outline and raster fonts. In cases were the IBM font files are not
- available the base-uri attribute in the afp-font element can be replaced by a base14-font attribute
- giving the name of the matching Base14 font. In this case the AFP Renderer will take the
- font metrics from the built-in font.</p>
-<source><![CDATA[ <!-- The following are examples of defining outline fonts based on FOP built-in
- font metrics for the Adobe Base14 fonts -->
- <!-- sans-serif fonts based on Helvetica -->
- <font>
- <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH200 "
- base14-font="Helvetica" />
- <font-triplet name="sans-serif" style="normal" weight="normal"/>
- <font-triplet name="Helvetica" style="normal" weight="normal"/>
- <font-triplet name="any" style="normal" weight="normal"/>
- </font>
- <font>
- <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH300 "
- base14-font="HelveticaOblique" />
- <font-triplet name="sans-serif" style="italic" weight="normal"/>
- <font-triplet name="Helvetica" style="italic" weight="normal"/>
- <font-triplet name="any" style="italic" weight="normal"/>
- </font>
- <font>
- <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH400 "
- base14-font="HelveticaBold" />
- <font-triplet name="sans-serif" style="normal" weight="bold"/>
- <font-triplet name="Helvetica" style="normal" weight="bold"/>
- <font-triplet name="any" style="normal" weight="bold"/>
- </font>
- <font>
- <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH500 "
- base14-font="HelveticaBoldOblique" />
- <font-triplet name="sans-serif" style="italic" weight="bold"/>
- <font-triplet name="Helvetica" style="italic" weight="bold"/>
- <font-triplet name="any" style="italic" weight="bold"/>
- </font>
-
- <!-- serif fonts based on Times Roman -->
- <font>
- <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZN200 "
- base14-font="TimesRoman" />
- <font-triplet name="serif" style="normal" weight="normal"/>
- <font-triplet name="Times" style="normal" weight="normal"/>
- <font-triplet name="Times-Roman" style="normal" weight="normal"/>
- </font>
-
- <!-- The following are examples of defining raster fonts based on FOP built-in
- font metrics for the Adobe Base14 fonts -->
- <!-- monospaced fonts based on Courier -->
- <font>
- <afp-font type="raster" codepage="T1V10500" encoding="Cp500">
- <afp-raster-font size="7" characterset="C0420070" base14-font="Courier"/>
- <afp-raster-font size="8" characterset="C0420080" base14-font="Courier"/>
- <afp-raster-font size="10" characterset="C0420000" base14-font="Courier"/>
- <afp-raster-font size="12" characterset="C04200B0" base14-font="Courier"/>
- <afp-raster-font size="14" characterset="C04200D0" base14-font="Courier"/>
- <afp-raster-font size="20" characterset="C04200J0" base14-font="Courier"/>
- </afp-font>
- <font-triplet name="monospace" style="normal" weight="normal"/>
- <font-triplet name="Courier" style="normal" weight="normal"/>
- </font>
- <font>
- <afp-font type="raster" codepage="T1V10500" encoding="Cp500">
- <afp-raster-font size="7" characterset="C0440070" base14-font="CourierBold"/>
- <afp-raster-font size="8" characterset="C0440080" base14-font="CourierBold"/>
- <afp-raster-font size="10" characterset="C0440000" base14-font="CourierBold"/>
- <afp-raster-font size="12" characterset="C04400B0" base14-font="CourierBold"/>
- <afp-raster-font size="14" characterset="C04400D0" base14-font="CourierBold"/>
- <afp-raster-font size="20" characterset="C04400J0" base14-font="CourierBold"/>
- </afp-font>
- <font-triplet name="monospace" style="normal" weight="bold"/>
- <font-triplet name="Courier" style="normal" weight="bold"/>
- </font>]]></source>
- <p>
- By default, all manually configured fonts are embedded, unless they are matched in the
- <a href="fonts.html#embedding"><code>referenced-fonts</code> section of the configuration file</a>.
- However, the default fonts shown above will not be embedded.
- </p>
- <p>
- For double byte EBCDIC encoded character sets, there is an optional tag that must be set to prevent
- characters from being miscoded. This defaults to "false" if not specified.</p>
- <source><![CDATA[
- <afp-font type="CIDKeyed" codepage="T10835 " encoding="Cp937" characterset="CZTKAI" ebcdic-dbcs="true"/>]]>
- </source>
- </section>
- <section id="afp-renderer-resolution-config">
- <title>Output Resolution</title>
- <p>By default the AFP Renderer creates output with a resolution of 240 dpi.
- This can be overridden by the &lt;renderer-resolution/&gt; configuration element. Example:</p>
- <source><![CDATA[
- <renderer-resolution>240</renderer-resolution>]]></source>
- </section>
- <section id="afp-line-width-correction-config">
- <title>Line Width Correction</title>
- <p>The default line width in AFP is device dependent. This means that a line width specified in, say,
- a SVG source file may not render the way it was intended. The output AFP line with can be corrected
- by the &lt;line-width-correction/&gt; configuration element. Example:</p>
- <source><![CDATA[
- <line-width-correction>2.5</line-width-correction>]]></source>
- </section>
- <section id="afp-image-config">
- <title>Images</title>
- <p>By default the AFP Renderer converts all images to 8 bit grey level.
- This can be overridden by the &lt;images/&gt; configuration element. Example:</p>
- <source><![CDATA[
- <images mode="color" />
-]]></source>
- <p>This will put images as RGB images into the AFP output stream. The default setting is:</p>
- <source><![CDATA[
- <images mode="b+w" bits-per-pixel="8" native="true"/>
-]]></source>
- <p>Only the values "color" and "b+w" are allowed for the mode attribute.</p>
- <p>The bits-per-pixel attribute is ignored if mode is "color". For "b+w" mode is must be 1, 4, or 8.</p>
- <source><![CDATA[
- <images native="true"/>
-]]></source>
- <p>When the native attribute is specified and set to "true", all image resources will be natively injected
- into the datastream using an object container rather than being converted into an IOCA FS45 image.
- Support for native image formats (e.g. JPEG, TIFF, GIF) is not always available on printer implementations
- so by default this configuration option is set to "false".</p>
- <p>
- Setting <code>cmyk="true"</code> on the <code>images</code> element will enable CMYK
- colors. This will only have an effect if the color mode is set to "color". Example:
- </p>
- <source><![CDATA[
- <images mode="color" cmyk="true"/>]]></source>
- <p>
- When the color mode is set to 1 bit (bi-level), the "dithering-quality" attribute can
- be used to select the level of quality to use when converting images to bi-level images.
- Valid values for this attribute are floating point numbers from 0.0 (fastest) to
- 1.0 (best), or special values: "minimum" (=0.0), "maximum" (1.0),
- "medium" (0.5, the default). For the higher settings to work as expected, JAI needs to
- be present in the classpath. If JAI is present, 0.0 results in a minimal darkness-level
- switching between white and black. 0.5 does bayer-based dithering and 1.0 will use
- error-diffusion dithering. The higher the value, the higher the quality and the slower
- the processing of the images.
- </p>
- <source><![CDATA[
- <images mode="b+w" bits-per-pixel="1" dithering-quality="maximum"/>]]></source>
- <p>
- When the boolean attribute pseg (default false) is set to true, non-inline FS11 and FS45 IOCA images are wrapped in page segment.
- This option is provided to support printers/print servers that require this MO:DCA structure.
- </p>
- <source><![CDATA[
- <images mode="b+w" bits-per-pixel="8" pseg="true"/>]]></source>
- <p>
- Setting the boolean attribute fs45 to true (default false) will force all images to FS45.
- </p>
- <source><![CDATA[
- <images mode="b+w" bits-per-pixel="8" fs45="true"/>]]></source>
- <p>
- By default, JPEG images are rasterized to a bitmap and the bitmap is included in the AFP doc.
- However it is possible to encode in a lossless way to maintain maximum quality. But due
- to lack of support for compression schemes like LZW (patent concerns), bitmap data is currently
- not compressed resulting in large AFP files. Using the "allow-embedding" attribute on jpeg child
- element allows the user to pass the JPEG as is in the document. The default is set to "false" since
- there are compatibility concerns as some AFP printers don't support JPEG decoding. Using the
- "bitmap-encoding-quality" attribute it is possible to enable lossy compression (JPEG baseline
- DCT). The default is "1.0" which means lossless encoding. Setting a value lower than 1.0, JPEG
- compression is enabled and the setting is used as the quality setting when encoding bitmap data.
- Note that this setting does not always have an effect. Bi-level (1 bit) bitmaps are not compressed
- using JPEG. Example:
- </p>
- <source><![CDATA[
- <images mode="color" cmyk="true">
- <jpeg allow-embedding="false" bitmap-encoding-quality="0.8"/>
- </images>]]></source>
- </section>
- <section id="afp-goca-config">
- <title>GOCA (Vector Graphics)</title>
- <p>
- Not all AFP implementations support GOCA. Some also have bugs related to GOCA. Therefore,
- it is desirable to have some control over the generation of GOCA graphics.
- </p>
- <p>
- GOCA is enabled by default. You can disable GOCA entirely in which case the AFP support
- falls back to generating bitmaps for vector graphics. Example:
- </p>
- <source><![CDATA[
- <goca enabled="false"/>]]></source>
- <p>
- Some AFP implementations have trouble rendering text in GOCA. You can instruct the AFP
- support to render text as shapes (i.e. use vector graphics to paint text). Example:
- </p>
- <source><![CDATA[
- <goca enabled="true" text="shapes"/>]]></source>
- <p>
- If you disable GOCA or let text render as shapes, the size of the generated AFP usually
- increases considerably.
- </p>
- </section>
- <section id="afp-shading-config">
- <title>Shading</title>
- <p>
- By default, filled rectangles are painted using their given color using a PTOCA I-axis rule
- (DIR). But not all environments handle these colors correctly. That's why a setting is
- supported that paints the rectangles using an ordered dither pattern (bi-level) with
- an inline IOCA FS10 image that is used together with the "replicate and trim" mapping.
- The optional "shading" element can be used to control the shading mode. Its default value
- is "color". To enable the dithered mode, use "dithered". Example:
- </p>
- <source><![CDATA[
- <shading>dithered</shading>
-]]></source>
- </section>
- <section id="afp-resource-group-file">
- <title>Resource Group File</title>
- <p>By default the AFP Renderer will place all data resource objects such as images within
- the document of the main output datastream. An external resource group file where document resources
- may be specified with the &lt;resource-group-file/&gt; configuration element. Example:</p>
- <source><![CDATA[
- <resource-group-file>external_resources.afp</resource-group-file>
-]]></source>
- <note>Be careful when using this option not to overwrite existing resource files from previous rendering runs.</note>
- </section>
- <section id="afp-resource-level-defaults">
- <title>Resource Level Defaults</title>
- <p>
- By default, bitmap image objects (or page segments derived from them) are put in the
- print-file-level resource group and GOCA graphics are inlined for compatibility with
- the AFP Workbench tool.
- </p>
- <p>
- It is possible to override these defaults, either per image (see the
- <link href="#afp-foreign-attributes-resource">afp:resource-level</link>
- extension attribute below) or by specifying different defaults in the configuration:
- </p>
- <source><![CDATA[
-<default-resource-levels goca="print-file" bitmap="inline"/>]]></source>
- <p>
- "goca" refers to GOCA graphics and "bitmap" refers to IOCA images. The possible values
- for the attributes are "inline" and "print-file". In the future,
- additional possibilities may be added.
- </p>
- </section>
- </section>
- <section id="afp-extensions">
- <title>Extensions</title>
- <p>The AFP Renderer supports some AFP specific extensions which can be embedded into the input
- fo document. To use the extensions the appropriate namespace must be declared in the fo:root element like this:</p>
- <source><![CDATA[
- <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
-]]></source>
- <section id="afp-page-overlay">
- <title>Page Overlay (IPO) Extension</title>
- <p>The include-page-overlay extension element allows to define on a per simple-page-master basis a page overlay resource. Example:</p>
- <source><![CDATA[
- <fo:layout-master-set>
- <fo:simple-page-master master-name="simple">
- <afp:include-page-overlay name="O1SAMP1 " x="20mm" y="30mm" />
- ...
- </fo:simple-page-master>
- </fo:layout-master-set>
-]]></source>
- <p>The mandatory name attribute must refer to an 8 character (space padded) resource name that
- must be known in the AFP processing environment. Optional x and y attributes can be specified
- to place the Overlay at an offset from the top left of the page.</p>
- </section>
- <section id="afp-page-segment">
- <title>Page Segment (IPS) Extension</title>
- <p>The include-page-segment extension element allows to define resource substitution for fo:external-graphics elements.
- Example:</p>
- <source><![CDATA[
- <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
- <fo:layout-master-set>
- <fo:simple-page-master master-name="simple">
- <afp:include-page-segment name="S1ISLOGO" src="../../resources/images/bgimg300dpi.jpg" />
- <fo:region-body/>
- </fo:simple-page-master>
- </fo:layout-master-set>
-]]></source>
- <p>The include-page-segment extension element can only occur within a simple-page-master.
- Multiple include-page-segment extension elements within a simple-page-master are allowed.
- The mandatory name attribute must refer to an 8 character
- (space padded) resource name that must be known in the AFP processing environment.
- The value of the mandatory src attribute is compared against the value of the src attribute in
- fo:external-graphic elements and if it is identical (string matching is used) in the generated
- AFP the external graphic is replaced by a reference to the given resource.
- </p>
- <p>
- The effect here is that whenever FOP encounters the URI specified in the extension,
- it will effectively generate code to include the page segment with the given name
- instead of embedding the image referenced by the URI. The URI is still required as
- the underlying image serves as a provider for the intrinsic size of the image
- (At the moment, FOP is unable to extract the intrinsic size of the page segment from
- an AFP resource file). For the image to appear in an AFP viewer or to be printed, the
- AFP resource must be available on the target device. FOP does not embed the page
- segment in the generated file. Please also note that page segments cannot be scaled.
- They are always rendered in their intrinsic size.
- </p>
- <p>
- The include-page-segment extension element has the optional attribute
- <i>resource-file</i>. The value of this is a URI to a resource containing a page
- segment with the declared name. In this case FOP embeds the page segment into the
- generated document so that the external resource does not have to be supplied in the
- print job.
- </p>
- </section>
- <section id="afp-tag-logical-element">
- <title>Tag Logical Element (TLE) Extension</title>
- <p>The tag-logical-element extension element allows to injects TLEs into the AFP output stream. Example:</p>
- <source><![CDATA[
- <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
- <fo:layout-master-set>
- <fo:simple-page-master master-name="simple">
- <afp:tag-logical-element name="The TLE Name" value="The TLE Value" />
- <fo:region-body/>
- </fo:simple-page-master>
- </fo:layout-master-set>
- [..]
- <fo:page-sequence master-reference="simple">
- <afp:tag-logical-element name="foo" value="bar"/>
- <fo:flow flow-name="xsl-region-body">
- [..]
-]]></source>
- <p>
- The tag-logical-element extension element can appear within a simple-page-master
- (page level) or it can appear as child of page-sequence (page group level).
- Multiple tag-logical-element extension elements within a simple-page-master or
- page-sequence are allowed. The name and value attributes are mandatory.
- </p>
- </section>
- <section id="afp-no-operation">
- <title>No Operation (NOP) Extension</title>
- <p>The no-operation extension provides the ability to carry up to 32K of comments or any other type
- of unarchitected data into the AFP output stream. Example:</p>
- <source><![CDATA[
- <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
- <fo:layout-master-set>
- <fo:simple-page-master master-name="simple">
- <afp:no-operation name="My NOP">insert up to 32k of character data here!</afp:no-operation>
- </fo:simple-page-master>
- </fo:layout-master-set>
-]]></source>
- <p>The no-operation extension element can appear as child of
- <code>simple-page-master</code> (appears after "Begin Page" BPG),
- <code>page-sequence</code> (appears after "Begin Named Page Group" BNG
- and <code>declarations</code> (appears after "Begin Document" BDT).
- Multiple no-operation extension elements inside the same formatting object are allowed.
- Each NOP will appear right after the respective "Begin" field indicated above even if it
- is specified as the last child under its parent. The order inside the parent
- will be maintained.
- The "placement" attribute can be used to have the NOP appear before
- the "End" field of the object rather than after the "Begin" field. Specify
- <code>placement="before-end"</code> to do that. Please note that, at the moment, this only
- has an effect for NOPs that are children of the <code>page-sequence</code> formatting
- object.
- The "name" attribute is mandatory but will not appear inside the AFP stream.
- </p>
- </section>
- <section id="afp-invoke-medium-map">
- <title>Invoke Medium Map (IMM) Extension</title>
- <p>
- The invoke-medium-map extension allows to generate IMM fields (Invoke Medium Map) in the
- generated AFP output. Example:
- </p>
- <source><![CDATA[
- <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
- [..]
- <fo:page-sequence master-reference="normal">
- <afp:invoke-medium-map name="MYMAP"/>
- <fo:flow flow-name="xsl-region-body">
- [..]
-]]></source>
- <p>
- The invoke-medium-map element is allowed as child of fo:page-sequence (page group
- level) or fo:simple-page-master. It is NOT supported on document level (fo:root), yet.
- FOP also doesn't support specifying medium maps inside XML (using BMM/EMM). It can
- only reference an existing medium map by name. The medium map has to be constructed
- through different means and available on the target platform.
- </p>
- </section>
- <section id="afp-form-maps">
- <title>Form Maps/Defs</title>
- <p>
- Apache FOP supports embedding an external form map resource in the
- generated AFP output. This is done using the <code>afp:include-form-map</code>
- extension. An example:
- </p>
- <source><![CDATA[
-<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
- [..]
- <fo:declarations>
- <afp:include-form-map name="F1SAMP1" src="file:f1samp1.fde"/>
- </fo:declarations>
-]]></source>
- <p>
- The <code>afp:include-form-map</code> is to be placed as a direct child of
- <code>fo:declarations</code>. The <code>name</code> is an AFP resource name
- (max. 8 characters) and the <code>src</code> attribute is the URI identifying the
- external form map resource. When such a form map is embedded, you can use the
- <code>afp:invoke-medium-map</code> extension (described above) to invoke any medium
- map included in the form map.
- </p>
- <note>
- Apache FOP doesn't support a way to define a form map or medium map using XML means
- inside an XSL-FO document. You will have to build the form map with some third-party
- tool.
- </note>
- </section>
- </section>
- <section id="afp-foreign-attributes">
- <title>Foreign Attributes</title>
- <section id="afp-foreign-attributes-resource">
- <title>Resource</title>
- <p>The resource foreign attributes provides the ability to name and control where data object resources
- (e.g. images/scalable vector graphics) will reside in the AFP output.
- The afp foreign attributes are only used in conjuntion with &lt;fo:external-graphic/&gt; and &lt;instream-foreign-object/&gt;.
- Example:</p>
- <source><![CDATA[
- <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
- ...
- <fo:block>
- <fo:external-graphic width="2.0cm" content-width="2.0cm" height="1.8cm" content-height="1.8cm"
- src="examples/fo/graphics/xml_feather.gif"
- afp:resource-name="feather" afp:resource-level="external" afp:resource-group-file="resources.afp"/>
- </fo:block>
- <fo:block>
- <fo:instream-foreign-object height="758.047pt" content-height="758.047pt" width="576.96pt" content-width="576.96pt"
- afp:resource-name"circles" afp:resource-level="inline">
- <svg xmlns="http://www.w3.org/2000/svg" width="12cm" height="12cm">
- <g style="fill-opacity:0.7; stroke:black; stroke-width:0.1cm;">
- <circle cx="6cm" cy="2cm" r="100" style="fill:red;" transform="translate(0,50)" />
- <circle cx="6cm" cy="2cm" r="100" style="fill:blue;" transform="translate(70,150)" />
- <circle cx="6cm" cy="2cm" r="100" style="fill:green;" transform="translate(-70,150)"/>
- </g>
- </svg>
- </fo:instream-foreign-object>
- </fo:block>
-]]></source>
- <p>The resource-level attribute where the resource object will reside in the AFP output datastream.
- The possible values for this are "inline", "print-file" and "external".
- When "external" is used a resource-group-file attribute must also be specified.
- Please refer to the <link href="#afp-resource-level-defaults">Resource Level Defaults</link>
- above to see what is used if the resource-level attribute is not specified.
- </p>
- <p/>
- </section>
- </section>
- </section>
-<section id="rtf">
- <title>RTF</title>
- <p>
- JFOR, an open source XSL-FO to RTF converter has been integrated into Apache FOP.
- This will create an RTF (rich text format) document that will
- attempt to contain as much information from the XSL-FO document as
- possible. It should be noted that is not possible (due to RTF's limitations) to map all
- XSL-FO features to RTF. For complex documents, the RTF output will never reach the feature
- level from PDF, for example. Thus, using RTF output is only recommended for simple documents
- such as letters.
- </p>
- <p>
- The RTF output follows Microsoft's RTF specifications
- and produces best results on Microsoft Word.
- </p>
- <note>RTF output is currently unmaintained and lacks many features compared to other output
- formats. Using other editable formats like Open Document Format, instead of producing XSL-FO
- then RTF through FOP, might give better results.</note>
- <p>
- These are some known restrictions compared to other supported output formats (not a complete list):
- </p>
- <ul>
- <li>
- Not supported/implemented:
- <ul>
- <li>break-before/after (supported by the RTF library but not tied into the RTFHandler)</li>
- <li>fo:page-number-citation-last</li>
- <li>keeps (supported by the RTF library but not tied into the RTFHandler)</li>
- <li>region-start/end (RTF limitation)</li>
- <li>multiple columns</li>
- </ul>
- </li>
- <li>Only a single page-master is supported</li>
- <li>Not all variations of fo:leader are supported (RTF limitation)</li>
- <li>percentages are not supported everywhere</li>
- </ul>
-</section>
-<section id="xml">
- <title>XML (Area Tree XML)</title>
- <p>
- This is primarily for testing and verification. The XML created is simply
- a representation of the internal area tree put into XML. We use that to verify
- the functionality of FOP's layout engine.
- </p>
- <p>
- The other use case of the Area Tree XML is as FOP's "intermediate format". More information
- on that can be found on the page dedicated to the <a href="intermediate.html">Intermediate Format</a>.
- </p>
-</section>
-<section id="awt">
- <title>Java2D/AWT</title>
- <p>
- The Java2DRenderer provides the basic functionality for all
- Java2D-based output formats (AWT viewer, direct print, PNG, TIFF).
- </p>
- <p>
- The AWT viewer shows a window with the pages displayed inside a
- Java graphic. It displays one page at a time.
- The fonts used for the formatting and viewing depend on the fonts
- available to your JRE.
- </p>
-</section>
-<section id="print">
- <title>Print</title>
- <p>
- It is possible to directly print the document from the command line.
- This is done with the same code that renders to the Java2D/AWT renderer.
- </p>
- <section id="print-issues">
- <title>Known issues</title>
- <p>
- If you run into the problem that the printed output is incomplete on Windows:
- this often happens to users printing to a PCL printer.
- There seems to be an incompatibility between Java and certain PCL printer drivers
- on Windows. Since most network-enabled laser printers support PostScript, try
- switching to the PostScript printer driver for that printer model.
- </p>
- </section>
-</section>
-<section id="bitmap">
- <title>Bitmap (TIFF/PNG)</title>
- <p>
- It is possible to directly create bitmap images from the individual
- pages generated by the layout engine.
- This is done with the same code that renders to the Java2D/AWT renderer.
- </p>
- <p>
- Currently, two output formats are supported: PNG and TIFF. TIFF produces
- one file with multiple pages, while PNG output produces one file per
- page. Note: FOP can only produce multiple files (with PNG output) if
- you can set a <code>java.io.File</code> indicating the primary PNG file
- using the <code>FOUserAgent.setOutputFile(File)</code> method.
- </p>
- <p>
- The quality of the bitmap depends on the target resolution setting
- on the FOUserAgent and on further settings described below.
- </p>
- <section id="bitmap-configuration">
- <title>Configuration</title>
- <p>
- The TIFF and PNG renderer configuration currently allows the following settings:
- </p>
-<source><![CDATA[<renderer mime="image/png">
- <color-mode>rgba</color-mode>
- <transparent-page-background>true</transparent-page-background>
- <background-color>white</background-color>
- <anti-aliasing>true</anti-aliasing>
- <rendering>quality</rendering>
- <fonts><!-- described elsewhere --></fonts>
-</renderer>]]></source>
- <p>
- The default value for the <code>"color-mode"</code> setting is <code>"rgba"</code> which
- is equivalent to a 24bit RGB image with an 8bit alpha channel for transparency.
- Valid values are:
- </p>
- <ul>
- <li><code>rgba</code>: RGB with alpha channel (24bit + 8bit = 32bit)</li>
- <li><code>rgb</code>: RGB (24bit)</li>
- <li><code>gray</code>: gray (8bit)</li>
- <li><code>bi-level</code> (or <code>binary</code>): bi-level (1bit)</li>
- </ul>
- <p>
- Please note that there is currently no dithering or error diffusion available for bi-level
- bitmap output.
- </p>
- <p>
- The default value for the <code>"transparent-page-background"</code> setting is
- <code>"false"</code> which paints an opaque, white background for the whole image.
- If you set this to <code>"true"</code>,
- no such background will be painted and you will get a transparent image if
- an alpha channel is available in the output format.
- </p>
- <p>
- The default value for the <code>"background-color"</code> setting is <code>"white"</code>.
- The color specifies in which color the page background is painted. It will only be
- painted if <code>"transparent-page-background"</code> is not set to <code>"true"</code>.
- All XSL-FO colors (including color functions) can be used.
- </p>
- <p>
- The default value for the <code>"anti-aliasing"</code> setting is <code>"true"</code>.
- You can set this value to <code>"false"</code> to disable anti-aliasing and
- thus improve rendering speeds a bit at the loss of some image quality.
- </p>
- <p>
- The default value for the <code>"rendering"</code> setting is <code>"true"</code>.
- You can set this value to <code>"false"</code> to improve rendering speeds a bit
- at the loss of some image quality. If this setting has an actual effect depends
- on the JVM's Java2D backend.
- </p>
- </section>
- <section id="tiff-configuration">
- <title>TIFF-specific Configuration</title>
- <p>
- In addition to the above values the TIFF renderer configuration allows some additional
- settings:
- </p>
-<source><![CDATA[<renderer mime="image/tiff">
- <transparent-page-background>true</transparent-page-background>
- <compression>CCITT T.6</compression>
- <fonts><!-- described elsewhere --></fonts>
-</renderer>]]></source>
- <p>
- The default value for the "compression" setting is "PackBits" which
- which is a widely supported RLE compression scheme for TIFF. The set of compression
- names to be used here matches the set that the Image I/O API uses. Note that
- not all compression schemes may be available during runtime. This depends on the
- actual codecs being available. Here is a list of possible values:
- </p>
- <ul>
- <li><code>NONE</code> (no compression)</li>
- <li><code>PackBits</code> (RLE, run-length encoding)</li>
- <li><code>JPEG</code></li>
- <li><code>Deflate</code></li>
- <li><code>LZW</code></li>
- <li><code>ZLib</code></li>
- <li><code>CCITT T.4</code> (Fax Group 3)</li>
- <li><code>CCITT T.6</code> (Fax Group 4)</li>
- </ul>
- <p>
- This setting may override any setting made using the <code>"color-mode"</code>. For example, if
- <code>"CCITT T.6"</code> is selected, the color mode is automatically forced to <code>"bi-level"</code> because
- this compression format only supports bi-level images.
- </p>
- <note>
- If you want to use CCITT compression, please make sure you've got
- <a href="http://java.sun.com/products/java-media/jai/current.html">
- Java Advanced Imaging Image I/O Tools
- </a>
- in your classpath. The Sun JRE doesn't come with a TIFF codec built in, so it has to be
- added separately. The internal TIFF codec from XML Graphics Commons only supports PackBits,
- Deflate and JPEG compression for writing.
- </note>
- </section>
- <section id="bitmap-rendering-options">
- <title>Runtime Rendering Options</title>
- <p>
- The IF-based bitmap output implementations support a rendering option with the key
- "target-bitmap-size" (value: java.awt.Dimension) that allows to force the pages to
- be proportionally fit into a bitmap of a given size. This can be used to produce
- thumbnails or little preview images of the individual pages. An example:
- </p>
- <source><![CDATA[userAgent.getRenderingOptions().put(
- "target-bitmap-size", new Dimension(320, 200));]]></source>
- </section>
-</section>
-<section id="txt">
- <title>TXT</title>
- <p>
- The text renderer produces plain ASCII text output
- that attempts to match the output of the PDFRenderer as closely as
- possible. This was originally developed to accommodate an archive system
- that could only accept plain text files, and is primarily useful for getting
- a quick-and-dirty view of the document text. The renderer is very limited,
- so do not be surprised if it gives unsatisfactory results.
- </p>
- <!-- OBSOLETE OBSOLETE OBSOLETE
- <p>
- The Text renderer works with a fixed size page buffer. The size of this
- buffer is controlled with the textCPI and textLPI public variables.
- The textCPI is the effective horizontal characters per inch to use.
- The textLPI is the vertical lines per inch to use. From these values
- and the page width and height the size of the buffer is calculated.
- The formatting objects to be rendered are then mapped to this grid.
- Graphic elements (lines, borders, etc) are assigned a lower priority
- than text, so text will overwrite any graphic element representations.
- </p>
- -->
- <p>
- Because FOP lays the text onto a grid during layout, there are frequently
- extra or missing spaces between characters and lines, which is generally
- unsatisfactory.
- Users have reported that the optimal settings to avoid such spacing problems are:
- </p>
- <ul>
- <li>font-family="Courier"</li>
- <li>font-size="10pt"</li>
- <li>line-height="10pt"</li>
- </ul>
-</section>
-<section id="sandbox">
- <title>Output Formats in the Sandbox</title>
- <p>
- Due to the state of certain renderers we moved some of them to a "sandbox" area until
- they are ready for more serious use. The renderers and FOEventHandlers in the sandbox
- can be found under src/sandbox and are compiled into build/fop-sandbox.jar during the
- main build. The output formats in the sandbox are marked as such below.
- </p>
- <section id="mif">
- <title>MIF</title>
- <warning>The MIF handler is in the sandbox and not yet functional in FOP Trunk!!! Please help us ressurrect this feature.</warning>
- <p>
- This format is the Maker Interchange Format which is used by
- Adobe Framemaker.
- </p>
- </section>
- <section id="svg">
- <title>SVG</title>
- <warning>The SVG renderer is in the sandbox and may not work as expected in FOP Trunk!!! Please help us improve this feature.</warning>
- <p>
- This format creates an SVG document that has links between the pages.
- This is primarily for slides and creating svg images of pages.
- Large documents will create SVG files that are far too large for
- an SVG viewer to handle. Since FO documents usually have text the
- SVG document will have a large number of text elements.
- The font information for the text is obtained from the JVM in the
- same way as for the AWT viewer. If the SVG is viewed on a
- system where the fonts are different, such as another platform,
- then the page may look wrong.
- </p>
- </section>
-</section>
-<section id="wishlist">
- <title>Wish list</title>
- <p>
- Apache FOP is easily extensible and allows you to add new output formats to enhance FOP's functionality. There's a number of output formats
- which are on our wish list. We're looking for volunteers to help us implement them.
- </p>
- <ul>
- <li>
- <a href="http://en.wikipedia.org/wiki/OpenDocument">ODF (Open Document Format)</a>:
- The standardized successor to OpenOffice's file format.
- </li>
- </ul>
-</section>
-
- </body>
-</document>
diff --git a/src/documentation/content/xdocs/1.1rc1/pdfa.xml b/src/documentation/content/xdocs/1.1rc1/pdfa.xml
deleted file mode 100644
index 0b8399121..000000000
--- a/src/documentation/content/xdocs/1.1rc1/pdfa.xml
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP: PDF/A (ISO 19005)</title>
- <version>$Revision$</version>
- <authors>
- <person name="Jeremias Märki" email="jeremias@apache.org"/>
- </authors>
- </header>
- <body>
- <section id="overview">
- <title>Overview</title>
- <p>
- PDF/A is a standard which turns PDF into an "electronic document file
- format for long-term preservation". PDF/A-1 is the first part of the
- standard and is documented in
- <a href="http://www.iso.org/iso/en/CatalogueDetailPage.CatalogueDetail?CSNUMBER=38920&amp;ICS1=37&amp;ICS2=100&amp;ICS3=99">ISO 19005-1:2005(E)</a>.
- Work on PDF/A-2 is in progress at
- <a href="http://www.aiim.org/standards.asp?ID=25013">AIIM</a>.
- </p>
- <p>
- Design documentation on PDF/A can be found on FOP's Wiki on the
- <a href="http://wiki.apache.org/xmlgraphics-fop/PDFA1ConformanceNotes">PDFA1ConformanceNotes</a> page.
- </p>
- </section>
- <section id="status">
- <title>Implementation Status</title>
- <p>
- <strong>PDF/A-1b</strong> is implemented to the degree that FOP supports
- the creation of the elements described in ISO 19005-1.
- </p>
- <p>
- Tests have been performed against jHove and Adobe Acrobat 7.0.7 (Preflight function).
- FOP does not validate completely against Apago's PDF Appraiser. Reasons unknown due to
- lack of a full license to get a detailed error protocol.
- </p>
- <p>
- <strong>PDF/A-1a</strong> is based on PDF-A-1b and adds accessibility features
- (such as Tagged PDF). This format is available within the limitation described on
- the <a href="accessibility.html">Accessibility page</a>.
- </p>
- </section>
- <section id="command-line">
- <title>Usage (command line)</title>
- <p>
- To activate PDF/A-1b from the command-line, specify "-pdfprofile PDF/A-1b"
- as a parameter. If there is a violation of one of the validation rules for
- PDF/A, an error message is presented and the processing stops.
- </p>
- <p>
- PDF/A-1a is enabled by specifying "-pdfprofile PDF/A-1a".
- </p>
- </section>
- <section id="embedded">
- <title>Usage (embedded)</title>
- <p>
- When FOP is embedded in another Java application you can set a special option
- on the renderer options in the user agent to activate the PDF/A-1b profile.
- Here's an example:
- </p>
- <source><![CDATA[
-userAgent.getRendererOptions().put("pdf-a-mode", "PDF/A-1b");
-Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent);
-[..]]]></source>
- <p>
- If one of the validation rules of PDF/A is violated, an PDFConformanceException
- (descendant of RuntimeException) is thrown.
- </p>
- <p>
- For PDF/A-1a, just use the string "PDF/A-1a" instead of "PDF/A-1b".
- </p>
- </section>
- <section id="rules">
- <title>PDF/A in Action</title>
- <p>
- There are a number of things that must be looked after if you activate a PDF/A
- profile. If you receive a PDFConformanceException, have a look at the following
- list (not necessarily comprehensive):
- </p>
- <ul>
- <li>
- Make sure all (!) fonts are embedded. If you use base 14 fonts (like Helvetica)
- you need to obtain a license for them and embed them like any other font.
- </li>
- <li>
- Don't use PDF encryption. PDF/A doesn't allow it.
- </li>
- <li>
- Don't use CMYK images without an ICC color profile. PDF/A doesn't allow mixing
- color spaces and FOP currently only properly supports the sRGB color space. Please
- note that FOP embeds a standard sRGB ICC profile (sRGB IEC61966-2.1) as the
- primary output intent for the PDF if no other output intent has been specified
- in the configuration.
- </li>
- <li>
- Don't use non-RGB colors in SVG images. Same issue as with CMYK images.
- </li>
- <li>
- Don't use EPS graphics with fo:external-graphic. Embedding EPS graphics in PDF
- is deprecated since PDF 1.4 and prohibited by PDF/A.
- </li>
- <li>
- PDF is forced to version 1.4 if PDF/A-1 is activated.
- </li>
- <li>
- No filter must be specified explicitely for metadata objects. Metadata must be
- embedded in clear text so non-PDF-aware applications can extract the XMP metadata.
- </li>
- </ul>
- <note>
- There are additional requirements if you want to enabled PDF/A-1a (Tagged PDF). This is
- particularly the specification of the natural language and alternative descriptions for
- images. Please refer to the <a href="accessibility.html">Accessibility page</a> for details.
- </note>
- </section>
- <section id="profile-compatibility">
- <title>PDF profile compatibility</title>
- <p>
- The PDF profiles "PDF/X-3:2003" and "PDF/A-1b" (or "PDF/A-1a") are compatible and can
- both be activated at the same time.
- </p>
- </section>
- <section id="interoperability">
- <title>Interoperability</title>
- <p>
- There has been some confusion about the namespace for the PDF/A indicator in the XMP
- metadata. At least three variants have been seen in the wild:
- </p>
- <table>
- <tr>
- <td>http://www.aiim.org/pdfa/ns/id.html</td>
- <td><strong>obsolete</strong>, from an early draft of ISO-19005-1, used by Adobe Acrobat 7.x</td>
- </tr>
- <tr>
- <td>http://www.aiim.org/pdfa/ns/id</td>
- <td><strong>obsolete</strong>, found in the original ISO 19005-1:2005 document</td>
- </tr>
- <tr>
- <td>http://www.aiim.org/pdfa/ns/id/</td>
- <td><strong>correct</strong>, found in the technical corrigendum 1 of ISO 19005-1:2005</td>
- </tr>
- </table>
- <p>
- If you get an error validating a PDF/A file in Adobe Acrobat 7.x it doesn't mean that
- FOP did something wrong. It's Acrobat that is at fault. This is fixed in Adobe Acrobat 8.x
- which uses the correct namespace as described in the technical corrigendum 1.
- </p>
- </section>
- </body>
-</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1rc1/pdfencryption.xml b/src/documentation/content/xdocs/1.1rc1/pdfencryption.xml
deleted file mode 100644
index 2d8fdfb10..000000000
--- a/src/documentation/content/xdocs/1.1rc1/pdfencryption.xml
+++ /dev/null
@@ -1,301 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP: PDF encryption.</title>
- <version>$Revision$</version>
- <authors>
- <person name="J.Pietschmann" email="pietsch@apache.org"/>
- <person name="Jeremias Märki" email="jeremias@apache.org"/>
- </authors>
- </header>
- <body>
- <section>
- <title>Overview</title>
- <p>
- Apacheâ„¢ FOP supports encryption of PDF output, thanks to Patrick
- C. Lankswert. This feature is commonly used to prevent
- unauthorized viewing, printing, editing, copying text from the
- document and doing annotations. It is also possible to ask the
- user for a password in order to view the contents. Note that
- there already exist third party applications which can decrypt
- an encrypted PDF without effort and allow the aforementioned
- operations, therefore the degree of protection is limited.
- </p>
- <p>
- For further information about features and restrictions regarding PDF
- encryption, look at the documentation coming with Adobe Acrobat or the
- technical documentation on the Adobe web site.
- </p>
- </section>
- <section>
- <title>Usage (command line)</title>
- <p>
- Encryption is enabled by supplying any of the encryption related
- options.
- </p>
- <p>
- An owner password is set with the <code>-o</code> option. This
- password is actually used as encryption key. Many tools for
- PDF processing ask for this password to disregard any
- restriction imposed on the PDF document.
- </p>
- <p>
- If no owner password has been supplied but FOP was asked to apply some
- restrictions, a random password is used. In this case it is obviously
- impossiible to disregard restrictions in PDF processing tools.
- </p>
- <p>
- A user password, supplied with the <code>-u</code> option, will
- cause the PDF display software to ask the reader for this password in
- order to view the contents of the document. If no user password was
- supplied, viewing the content is not restricted.
- </p>
- <p>
- Further restrictions can be imposed by using the following command-line options:
- <table>
- <tr>
- <th>Option</th>
- <th>Description</th>
- </tr>
- <tr>
- <td><code>-noprint</code></td>
- <td>disable printing</td>
- </tr>
- <tr>
- <td><code>-nocopy</code></td>
- <td>disable copy/paste of content</td>
- </tr>
- <tr>
- <td><code>-noedit</code></td>
- <td>disable editing in Adobe Acrobat</td>
- </tr>
- <tr>
- <td><code>-noannotations</code></td>
- <td>disable editing of annotations</td>
- </tr>
- <tr>
- <td><code>-nofillinforms</code></td>
- <td>disable filling in forms</td>
- </tr>
- <tr>
- <td><code>-noaccesscontent</code></td>
- <td>disable text and graphics extraction for accessibility purposes</td>
- </tr>
- <tr>
- <td><code>-noassembledoc</code></td>
- <td>disable assembling documents</td>
- </tr>
- <tr>
- <td><code>-noprinthq</code></td>
- <td>disable high quality printing</td>
- </tr>
- </table>
- </p>
- </section>
- <section>
- <title>Usage (embedded)</title>
- <p>
- When FOP is embedded in another Java application you need to set an
- options map on the renderer. These are the supported options:
- </p>
- <table>
- <tr>
- <th>Option</th>
- <th>Description</th>
- <th>Values</th>
- <th>Default</th>
- </tr>
- <tr>
- <td>encryption-length</td>
- <td>The encryption length in bit</td>
- <td>Any multiple of 8 between 40 and 128</td>
- <td>40</td>
- </tr>
- <tr>
- <td>ownerPassword</td>
- <td>The owner password</td>
- <td>String</td>
- <td/>
- </tr>
- <tr>
- <td>userPassword</td>
- <td>The user password</td>
- <td>String</td>
- <td/>
- </tr>
- <tr>
- <td>allowPrint</td>
- <td>Allows/disallows printing of the PDF</td>
- <td>"TRUE" or "FALSE"</td>
- <td>"TRUE"</td>
- </tr>
- <tr>
- <td>allowCopyContent</td>
- <td>Allows/disallows copy/paste of content</td>
- <td>"TRUE" or "FALSE"</td>
- <td>"TRUE"</td>
- </tr>
- <tr>
- <td>allowEditContent</td>
- <td>Allows/disallows editing in Adobe Acrobat</td>
- <td>"TRUE" or "FALSE"</td>
- <td>"TRUE"</td>
- </tr>
- <tr>
- <td>allowEditAnnotations</td>
- <td>Allows/disallows editing of annotations</td>
- <td>"TRUE" or "FALSE"</td>
- <td>"TRUE"</td>
- </tr>
- <tr>
- <td>allowFillInForms</td>
- <td>Allows/disallows filling in forms</td>
- <td>"TRUE" or "FALSE"</td>
- <td>"TRUE"</td>
- </tr>
- <tr>
- <td>allowAccessContent</td>
- <td>Allows/disallows text and graphics extraction for accessibility purposes</td>
- <td>"TRUE" or "FALSE"</td>
- <td>"TRUE"</td>
- </tr>
- <tr>
- <td>allowAssembleDocument</td>
- <td>Allows/disallows assembling document</td>
- <td>"TRUE" or "FALSE"</td>
- <td>"TRUE"</td>
- </tr>
- <tr>
- <td>allowPrintHq</td>
- <td>Allows/disallows high quality printing</td>
- <td>"TRUE" or "FALSE"</td>
- <td>"TRUE"</td>
- </tr>
- </table>
- <note>
- Encryption is enabled as soon as one of these options is set.
- </note>
- <p>
- An example to enable PDF encryption in Java code:
- </p>
- <source><![CDATA[
-import org.apache.fop.pdf.PDFEncryptionParams;
-
-[..]
-
-FOUserAgent userAgent = fopFactory.newFOUserAgent();
-useragent.getRendererOptions().put("encryption-params", new PDFEncryptionParams(
- null, "password", false, false, true, true));
-Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent);
-[..]]]></source>
- <p>
- The parameters for the constructor of PDFEncryptionParams are:
- </p>
- <ol>
- <li>userPassword: String, may be null</li>
- <li>ownerPassword: String, may be null</li>
- <li>allowPrint: true if printing is allowed</li>
- <li>allowCopyContent: true if copying content is allowed</li>
- <li>allowEditContent: true if editing content is allowed</li>
- <li>allowEditAnnotations: true if editing annotations is allowed</li>
- <li>allowFillInForms: true if filling in forms is allowed.</li>
- <li>allowAccessContent: true if extracting text and graphics is allowed</li>
- <li>allowAssembleDocument: true if assembling document is allowed</li>
- <li>allowPrintHq: true if printing to high quality is allowed</li>
- </ol>
- <p>
- Alternatively, you can set each value separately in the Map provided by
- FOUserAgent.getRendererOptions() by using the following keys:
- </p>
- <ol>
- <li>user-password: String</li>
- <li>owner-password: String</li>
- <li>noprint: Boolean or "true"/"false"</li>
- <li>nocopy: Boolean or "true"/"false"</li>
- <li>noedit: Boolean or "true"/"false"</li>
- <li>noannotations: Boolean or "true"/"false"</li>
- <li>nofillinforms: Boolean or "true"/"false"</li>
- <li>noaccesscontent: Boolean or "true"/"false"</li>
- <li>noassembledoc: Boolean or "true"/"false"</li>
- <li>noprinthq: Boolean or "true"/"false"</li>
- </ol>
- </section>
- <section>
- <title>Environment</title>
- <p>
- In order to use PDF encryption, FOP has to be compiled with
- cryptography support. Currently, only <a
- href="http://java.sun.com/j2se/1.4/docs/guide/security/jce/JCERefGuide.html">JCE</a>
- is supported. JCE is part of JDK 1.4. For earlier JDKs, it can
- be installed separately. The build process automatically
- detects JCE presence and installs PDF encryption support if
- possible, otherwise a stub is compiled in.
- </p>
- <p>
- Cryptography support must also be present at run time. In particular, a
- provider for the RC4 cipher is needed. Unfortunately, the sample JCE
- provider in Sun's JDK 1.4 does <strong>not</strong> provide RC4. If you
- get a message saying
- </p>
- <source>"Cannot find any provider supporting RC4"</source>
- <p>
- then you don't have the needed infrastructure.
- </p>
- <p>
- There are several commercial and a few Open Source packages which
- provide RC4. A pure Java implementation is produced by <a
- href="http://www.bouncycastle.org/">The Legion of the Bouncy
- Castle</a>. <a
- href="http://www.mozilla.org/projects/security/pki/jss/">Mozilla
- JSS</a> is an interface to a native implementation.
- </p>
- </section>
- <section id="install_crypto">
- <title>Installing a crypto provider</title>
- <p>
- The pure Java implementation from <a
- href="http://www.bouncycastle.org/">Bouncy Castle</a> is easy to
- install.
- </p>
- <ol>
- <li>
- Download the binary distribution for your JDK version.
- </li>
- <li>
- Unpack the distribution. Add the jar file to your classpath. A
- convenient way to use the jar on Linux is to simply drop it into the
- FOP lib directory, it will be automatically picked up by
- <code>fop.sh</code>.
- </li>
- <li>
- Open the <code>java.security</code> file and add<br/>
- <code>security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider</code>,<br/>
- preferably at the end of the block defining the other crypto
- providers. For JDK 1.4 this is detailed on <a href="http://java.sun.com/j2se/1.4/docs/guide/security/jce/JCERefGuide.html#InstallProvider">Sun's web site</a>.
- </li>
- </ol>
- <p>
- If you have any experience with Mozilla JSS or any other
- cryptography provider, please post it to the fop-user list.
- </p>
- </section>
- </body>
-</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1rc1/pdfx.xml b/src/documentation/content/xdocs/1.1rc1/pdfx.xml
deleted file mode 100644
index bef2fce2a..000000000
--- a/src/documentation/content/xdocs/1.1rc1/pdfx.xml
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- Copyright 2006 The Apache Software Foundation
-
- 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.
--->
-<!-- $Id$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP: PDF/X (ISO 15930)</title>
- <version>$Revision$</version>
- <authors>
- <person name="Jeremias Märki" email="jeremias@apache.org"/>
- </authors>
- </header>
- <body>
- <section id="overview">
- <title>Overview</title>
- <warning>
- Support for PDF/X is available beginning with version 0.93. This feature is new and
- may not be 100% complete, yet. Feedback is welcome.
- </warning>
- <p>
- PDF/X is a standard which faciliates prepress digital data exchange using PDF.
- Currently, only PDF/X-3:2003 is implemented out of the many different flavours of PDF/X
- profiles. PDF/X-3:2003 is documented in
- <a href="http://www.iso.org/iso/en/CatalogueDetailPage.CatalogueDetail?CSNUMBER=39940&amp;ICS1=37&amp;ICS2=100&amp;ICS3=99">ISO 15930-6:2003(E)</a>.
- More info on PDF/X can be found on the
- <a href="http://www.pdfx.info/">PDF/X info site</a>.
- </p>
- </section>
- <section id="status">
- <title>Implementation Status</title>
- <p>
- <strong>PDF/X-3:2003</strong> is implemented to the degree that FOP supports
- the creation of the elements described in ISO 15930-6.
- </p>
- <p>
- An important restriction of the current implementation is that all normal
- RGB colors specified in XSL-FO and SVG are left unchanged in the sRGB color
- space (XSL-FO and SVG both use sRGB as their default color space).
- There's no conversion to a CMYK color space. Although sRGB is a
- calibrated color space, its color space has a different size than a CMYK
- color space which makes the conversion a lossy conversion and can lead to
- unwanted results. Although the use of the calibrated sRGB has been promoted
- for years, print shops usually prefer to convert an sRGB PDF to CMYK prior
- to production. Until there's full CMYK support in FOP you will have to
- work closely with your print service provider to make sure you get the
- intended result.
- </p>
- <p>
- Tests have been performed against Adobe Acrobat 7.0.7 (Preflight function).
- Note that there are bugs in Adobe Acrobat which cause false alarms if both
- PDF/A-1b and PDF/X-3:2003 are activated at the same time.
- </p>
- </section>
- <section id="command-line">
- <title>Usage (command line)</title>
- <p>
- To activate PDF/X-3:2003 from the command-line, specify "-pdfprofile PDF/X-3:2003"
- as a parameter. If there is a violation of one of the validation rules for
- PDF/X, an error message is presented and the processing stops.
- </p>
- </section>
- <section id="embedded">
- <title>Usage (embedded)</title>
- <p>
- When FOP is embedded in another Java application you can set a special option
- on the renderer options in the user agent to activate the PDF/A-1b profile.
- Here's an example:
- </p>
- <source><![CDATA[
-FOUserAgent userAgent = fopFactory.newFOUserAgent();
-userAgent.getRendererOptions().put("pdf-x-mode", "PDF/X-3:2003");
-Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent);
-[..]]]></source>
- <p>
- If one of the validation rules of PDF/X is violated, an PDFConformanceException
- (descendant of RuntimeException) is thrown.
- </p>
- </section>
- <section id="rules">
- <title>PDF/X in Action</title>
- <p>
- There are a number of things that must be looked after if you activate a PDF/X
- profile. If you receive a PDFConformanceException, have a look at the following
- list (not necessarily comprehensive):
- </p>
- <ul>
- <li>
- Make sure all (!) fonts are embedded. If you use base 14 fonts (like Helvetica)
- you need to obtain a license for them and embed them like any other font.
- </li>
- <li>
- Don't use PDF encryption. PDF/X doesn't allow it.
- </li>
- <li>
- Don't use CMYK images without an ICC color profile. PDF/X doesn't allow mixing
- color spaces and FOP currently only properly supports the sRGB color space. However,
- you will need to specify an
- <a href="configuration.html#pdf-renderer">output device profile</a>
- (usually a CMYK profile) in the configuration. sRGB won't work here since it's a
- display device profile, not an output device profile.
- </li>
- <li>
- Don't use non-RGB colors in SVG images. Same issue as with CMYK images.
- </li>
- <li>
- Don't use EPS graphics with fo:external-graphic. Embedding EPS graphics in PDF
- is deprecated since PDF 1.4 and prohibited by PDF/X-3:2003.
- </li>
- <li>
- PDF is forced to version 1.4 if PDF/X-3:2003 is activated.
- </li>
- </ul>
- </section>
- <section id="profile-compatibility">
- <title>PDF profile compatibility</title>
- <p>
- The PDF profiles "PDF/X-3:2003" and "PDF/A-1b" are compatible and can both be
- activated at the same time.
- </p>
- </section>
- </body>
-</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1rc1/running.xml b/src/documentation/content/xdocs/1.1rc1/running.xml
deleted file mode 100644
index 5e30bb25e..000000000
--- a/src/documentation/content/xdocs/1.1rc1/running.xml
+++ /dev/null
@@ -1,370 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<document>
- <header>
- <title>Running Apacheâ„¢ FOP</title>
- <version>$Revision$</version>
- </header>
-
- <body>
- <section id="require">
- <title>System Requirements</title>
- <p>The following software must be installed:</p>
- <ul>
- <li>
- Java 1.4.x or later Runtime Environment.
- <ul>
- <li>
- Many JREs &gt;=1.4 contain older JAXP implementations (which often contain bugs). It's
- usually a good idea to replace them with a current implementation.
- </li>
- </ul>
- </li>
- <li>
- Apacheâ„¢ FOP. The <a href="../download.html">FOP distribution</a> includes all libraries that you will
- need to run a basic FOP installation. These can be found in the [fop-root]/lib directory. These
- libraries include the following:
- <ul>
- <li><a class="fork" href="ext:xmlgraphics.apache.org/commons">Apache XML Graphics Commons</a>, an shared library for Batik and FOP.</li>
- <li><a class="fork" href="ext:batik">Apache Batik</a>, an SVG library.</li>
- <li><a class="fork" href="ext:commons-logging">Apache Commons Logging</a>, a logger abstraction kit.</li>
- <li><a class="fork" href="ext:commons-io">Apache Commons IO</a>, a library with I/O utilities.</li>
- <li><a class="fork" href="ext:excalibur/framework">Apache Excalibur/Avalon Framework</a>, for XML configuration handling.</li>
- </ul>
- </li>
- </ul>
- <p>The following software is optional, depending on your needs:</p>
- <ul>
- <li>
- Graphics libraries. Generally, FOP contains direct support for the most important
- bitmap image formats (including PNG, JPEG and GIF). See
- <a href="graphics.html">FOP: Graphics Formats</a> for details.
- </li>
- <li>
- PDF encryption. See <a href="pdfencryption.html">FOP: PDF Encryption</a> for details.
- </li>
- </ul>
- <p>In addition, the following system requirements apply:</p>
- <ul>
- <li>
- If you will be using FOP to process SVG, you must do so in a graphical environment.
- See <a href="graphics.html#batik">FOP: Graphics (Batik)</a> for details.
- </li>
- </ul>
- </section>
- <section id="install">
- <title>Installation</title>
- <section id="install-instruct">
- <title>Instructions</title>
- <p>
- Basic FOP installation consists of first unzipping the <code>.gz</code> file that is the
- distribution medium, then unarchiving the resulting <code>.tar</code> file in a
- directory/folder that is convenient on your system. Please consult your operating system
- documentation or Zip application software documentation for instructions specific to your
- site.
- </p>
- </section>
- <section id="install-problems">
- <title>Problems</title>
- <p>
- Some Mac OSX users have experienced filename truncation problems using Stuffit to unzip
- and unarchive their distribution media. This is a legacy of older Mac operating systems,
- which had a 31-character pathname limit. Several Mac OSX users have recommended that
- Mac OSX users use the shell command <code>tar -xzf</code> instead.
- </p>
- </section>
- </section>
- <section id="standalone-start">
- <title>Starting FOP as a Standalone Application</title>
- <section id="fop-script">
- <title>Using the fop script or batch file</title>
- <p>
- The usual and recommended practice for starting FOP from the command line is to run the
- batch file fop.bat (Windows) or the shell script fop (Unix/Linux).
- These scripts require that the environment variable JAVA_HOME be
- set to a path pointing to the appropriate Java installation on your system. Macintosh OSX
- includes a Java environment as part of its distribution. We are told by Mac OSX users that
- the path to use in this case is <code>/Library/Java/Home</code>. <strong>Caveat:</strong>
- We suspect that, as Apple releases new Java environments and as FOP upgrades the minimum
- Java requirements, the two will inevitably not match on some systems. Please see
- <a href="http://developer.apple.com/java/faq">Java on Mac OSX FAQ</a> for information as
- it becomes available.
- </p>
- <source><![CDATA[
-USAGE
-Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl|-ps|-txt|-at [mime]|-print] <outfile>
- [OPTIONS]
- -version print FOP version and exit
- -d debug mode
- -x dump configuration settings
- -q quiet mode
- -c cfg.xml use additional configuration file cfg.xml
- -l lang the language to use for user information
- -nocs disable complex script features
- -r relaxed/less strict validation (where available)
- -dpi xxx target resolution in dots per inch (dpi) where xxx is a number
- -s for area tree XML, down to block areas only
- -v run in verbose mode (currently simply print FOP version and continue)
-
- -o [password] PDF file will be encrypted with option owner password
- -u [password] PDF file will be encrypted with option user password
- -noprint PDF file will be encrypted without printing permission
- -nocopy PDF file will be encrypted without copy content permission
- -noedit PDF file will be encrypted without edit content permission
- -noannotations PDF file will be encrypted without edit annotation permission
- -nofillinforms PDF file will be encrypted without fill in forms permission
- -noaccesscontent PDF file will be encrypted without extract text and graphics permission
- -noassembledoc PDF file will be encrypted without assemble the document permission
- -noprinthq PDF file will be encrypted without print high quality permission
- -a enables accessibility features (Tagged PDF etc., default off)
- -pdfprofile prof PDF file will be generated with the specified profile
- (Examples for prof: PDF/A-1b or PDF/X-3:2003)
-
- -conserve enable memory-conservation policy (trades memory-consumption for disk I/O)
- (Note: currently only influences whether the area tree is serialized.)
-
- -cache specifies a file/directory path location
- -flush flushes the current font cache file
-
- [INPUT]
- infile xsl:fo input file (the same as the next)
- (use '-' for infile to pipe input from stdin)
- -fo infile xsl:fo input file
- -xml infile xml input file, must be used together with -xsl
- -atin infile area tree input file
- -ifin infile intermediate format input file
- -imagein infile image input file (piping through stdin not supported)
- -xsl stylesheet xslt stylesheet
-
- -param name value <value> to use for parameter <name> in xslt stylesheet
- (repeat '-param name value' for each parameter)
-
- -catalog use catalog resolver for input XML and XSLT files
- [OUTPUT]
- outfile input will be rendered as PDF into outfile
- (use '-' for outfile to pipe output to stdout)
- -pdf outfile input will be rendered as PDF (outfile req'd)
- -pdfa1b outfile input will be rendered as PDF/A-1b compliant PDF
- (outfile req'd, same as "-pdf outfile -pdfprofile PDF/A-1b")
- -awt input will be displayed on screen
- -rtf outfile input will be rendered as RTF (outfile req'd)
- -pcl outfile input will be rendered as PCL (outfile req'd)
- -ps outfile input will be rendered as PostScript (outfile req'd)
- -afp outfile input will be rendered as AFP (outfile req'd)
- -tiff outfile input will be rendered as TIFF (outfile req'd)
- -png outfile input will be rendered as PNG (outfile req'd)
- -txt outfile input will be rendered as plain text (outfile req'd)
- -at [mime] out representation of area tree as XML (outfile req'd)
- specify optional mime output to allow the AT to be converted
- to final format later
- -if [mime] out representation of document in intermediate format XML (outfile req'd)
- specify optional mime output to allow the IF to be converted
- to final format later
- -print input file will be rendered and sent to the printer
- see options with "-print help"
- -out mime outfile input will be rendered using the given MIME type
- (outfile req'd) Example: "-out application/pdf D:\out.pdf"
- (Tip: "-out list" prints the list of supported MIME types)
- -svg outfile input will be rendered as an SVG slides file (outfile req'd)
- Experimental feature - requires additional fop-sandbox.jar.
-
- -foout outfile input will only be XSL transformed. The intermediate
- XSL-FO file is saved and no rendering is performed.
- (Only available if you use -xml and -xsl parameters)
-
-
- [Examples]
- fop foo.fo foo.pdf
- fop -fo foo.fo -pdf foo.pdf (does the same as the previous line)
- fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf
- fop -xml foo.xml -xsl foo.xsl -foout foo.fo
- fop -xml - -xsl foo.xsl -pdf -
- fop foo.fo -mif foo.mif
- fop foo.fo -rtf foo.rtf
- fop foo.fo -print
- fop foo.fo -awt]]></source>
- <p>
- PDF encryption is only available if FOP was compiled with encryption support
- <strong>and</strong> if compatible encryption support is available at run time.
- Currently, only the JCE is supported. Check the <a href="pdfencryption.html">Details</a>.
- </p>
- </section>
- <section id="your-own-script">
- <title>Writing your own script</title>
- <p>FOP's entry point for your own scripts is the class
-<code>org.apache.fop.cli.Main</code>. The general pattern for the
- command line is: <code>java -classpath &lt;CLASSPATH&gt;
- org.apache.fop.cli.Main &lt;arguments&gt;</code>. The arguments
- consist of the options and infile and outfile specifications
- as shown above for the standard scripts. You may wish to review
- the standard scripts to make sure that
- you get your environment properly configured.
- </p>
- </section>
- <section id="jar-option">
- <title>Running with java's <code>-jar</code> option</title>
- <p>
- As an alternative to the start scripts you can run <code>java
- -jar path/to/build/fop.jar &lt;arguments&gt;</code>, relying on
- FOP to build the classpath for running FOP dynamically, see <a
- href="#dynamical-classpath">below</a>. If you use hyphenation,
- you must put <code>fop-hyph.jar</code> in the <code>lib</code>
- directory.
- </p>
-
- <p>You can also run <code>java -jar path/to/fop.jar
- &lt;arguments&gt;</code>, relying on the <code>Class-Path</code>
- entry in the manifest file. This works if you put
- <code>fop.jar</code> and all jar files from the <code>lib</code>
- directory in a single directory. If you use hyphenation, you
- must also put <code>fop-hyph.jar</code> in that directory.</p>
-
- <p>In both cases the arguments consist of the options and
- infile and outfile specifications as shown above for the
- standard scripts.</p>
- </section>
- <section id="dynamical-classpath">
- <title>FOP's dynamical classpath construction</title>
-
- <p>If FOP is started without a proper classpath, it tries to
- add its dependencies dynamically. If the system property
- <code>fop.home</code> contains the name of a directory, then
- FOP uses that directory as the base directory for its
- search. Otherwise the current working directory is the base
- directory. If the base directory is called <code>build</code>,
- then its parent directory becomes the base directory.</p>
-
- <p>FOP expects to find <code>fop.jar</code> in the
- <code>build</code> subdirectory of the base directory, and
- adds it to the classpath. Subsequently FOP adds all
- <code>jar</code> files in the lib directory to the
- classpath. The lib directory is either the <code>lib</code>
- subdirectory of the base directory, or, if that does not
- exist, the base directory itself.</p>
-
- <p>If the system property <code>fop.optional.lib</code>
- contains the name of a directory, then all <code>jar</code>
- files in that directory are also added to the classpath. See
- the methods <code>getJARList</code> and
- <code>checkDependencies</code> in
- <code>org.apache.fop.cli.Main</code>.</p>
-
- </section>
- </section>
- <section id="check-input">
- <title>Using Xalan to Check XSL-FO Input</title>
- <p>
- FOP sessions that use -xml and -xsl input instead of -fo input are actually
- controlling two distinct conversions: Tranforming XML to XSL-FO, then formatting
- the XSL-FO to PDF (or another FOP output format).
- Although FOP controls both of these processes, the first is included merely as
- a convenience and for performance reasons.
- Only the second is part of FOP's core processing.
- If a user has a problem running FOP, it is important to determine which of these
- two processes is causing the problem.
- If the problem is in the first process, the user's stylesheet is likely the cause.
- The FOP development team does not have resources to help with stylesheet issues,
- although we have included links to some useful
- <a href="../resources.html#specs">Specifications</a> and
- <a href="../resources.html#articles">Books/Articles</a>.
- If the problem is in the second process, FOP may have a bug or an unimplemented
- feature that does require attention from the FOP development team.
- </p>
- <note>The user is always responsible to provide correct XSL-FO code to FOP.</note>
- <p>
- In the case of using -xml and -xsl input, although the user is responsible for
- the XSL-FO code that is FOP's input, it is not visible to the user. To make the
- intermediate FO file visible, the FOP distribution includes the "-foout" option
- which causes FOP to run only the first (transformation) step, and write the
- results to a file. (See also the Xalan command-line below)
- </p>
- <note>
- When asking for help on the FOP mailing lists, <em>never</em> attach XML and
- XSL to illustrate the issue. Always run the XSLT step (-foout) and send the
- resulting XSL-FO file instead. Of course, be sure that the XSL-FO file is
- correct before sending it.
- </note>
- <p>
- The -foout option works the same way as if you would call the
- <a href="http://xml.apache.org/xalan-j/commandline.html">Xalan command-line</a>:
- </p>
- <p>
- <code>java org.apache.xalan.xslt.Process -IN xmlfile -XSL file -OUT outfile</code>
- </p>
- <p>
- Note that there are some subtle differences between the FOP and Xalan command-lines.
- </p>
- </section>
- <section id="memory">
- <title>Memory Usage</title>
- <p>
- FOP can consume quite a bit of memory, even though this has been continually improved.
- This is partly inherent to the formatting process and partly caused by implementation choices.
- All FO processors currently on the market have memory problems with certain layouts.
- </p>
- <p>
- If you are running out of memory when using FOP, here are some ideas that may help:
- </p>
- <ul>
- <li>
- Increase memory available to the JVM. See
- <a href="http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/java.html">the -Xmx option</a>
- for more information.
- <warning>
- It is usually unwise to increase the memory allocated to the JVM beyond the amount of
- physical RAM, as this will generally cause significantly slower performance.
- </warning>
- </li>
- <li>
- Avoid forward references.
- Forward references are references to some later part of a document.
- Examples include page number citations which refer to pages which follow the citation,
- tables of contents at the beginning of a document, and page numbering schemes that
- include the total number of pages in the document
- (<a href="../faq.html#pagenum">"page N of TOTAL"</a>).
- Forward references cause all subsequent pages to be held in memory until the reference
- can be resolved, i.e. until the page with the referenced element is encountered.
- Forward references may be required by the task, but if you are getting a memory
- overflow, at least consider the possibility of eliminating them.
- A table of contents could be replaced by PDF bookmarks instead or moved to the end of
- the document (reshuffle the paper could after printing).
- </li>
- <li>
- Avoid large images, especially if they are scaled down.
- If they need to be scaled, scale them in another application upstream from FOP.
- For many image formats, memory consumption is driven mainly by the size of the image
- file itself, not its dimensions (width*height), so increasing the compression rate
- may help.
- </li>
- <li>
- Use multiple page sequences.
- FOP starts rendering after the end of a page sequence is encountered.
- While the actual rendering is done page-by-page, some additional memory is
- freed after the page sequence has been rendered.
- This can be substantial if the page sequence contains lots of FO elements.
- </li>
- </ul>
- </section>
- <section id="problems">
- <title>Problems</title>
- <p>If you have problems running FOP, please see the <a href="../gethelp.html">"How to get Help" page</a>.</p>
- </section>
- </body>
-</document>
diff --git a/src/documentation/content/xdocs/1.1rc1/servlets.xml b/src/documentation/content/xdocs/1.1rc1/servlets.xml
deleted file mode 100644
index dd2df4351..000000000
--- a/src/documentation/content/xdocs/1.1rc1/servlets.xml
+++ /dev/null
@@ -1,325 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- 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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<document>
- <header>
- <title>Apacheâ„¢ FOP: Servlets</title>
- <subtitle>How to use Apacheâ„¢ FOP in a Servlet</subtitle>
- <version>$Revision$</version>
- </header>
- <body>
- <section id="overview">
- <title>Overview</title>
- <p>
- This page discusses topic all around using Apacheâ„¢ FOP in a servlet environment.
- </p>
- </section>
- <section id="example-servlets">
- <title>Example Servlets in the FOP distribution</title>
- <p>
- In the directory {fop-dir}/src/java/org/apache/fop/servlet, you'll find a working example
- of a FOP-enabled servlet.
- </p>
- <p>
- The servlet is automatically built when you build Apache FOP using the supplied Ant script. After building
- the servlet, drop fop.war into the webapps directory of Apache Tomcat (or any other web container). Then, you can use
- URLs like the following to generate PDF files:
- </p>
- <ul>
- <li>http://localhost:8080/fop/fop?fo=/home/path/to/fofile.fo</li>
- <li>http://localhost:8080/fop/fop?xml=/home/path/to/xmlfile.xml&amp;xsl=/home/path/to/xslfile.xsl</li>
- </ul>
- <p/>
- <p>The source code for the servlet can be found under {fop-dir}/src/java/org/apache/fop/servlet/FopServlet.java.</p>
- <note>
- This example servlet should not be used on a public web server connected to the Internet as it does not contain
- any measures to prevent Denial-of-Service-Attacks. It is provided as an example and as a starting point for
- your own servlet.
- </note>
- </section>
- <section id="servlet">
- <title>Create your own Servlet</title>
- <note>
- This section assumes you are familiar with <a href="embedding.html">embedding FOP</a>.
- </note>
- <section id="minimal-servlet">
- <title>A minimal Servlet</title>
- <p>
- Here is a minimal code snippet to demonstrate the basics:
- </p>
- <source>private FopFactory fopFactory = FopFactory.newInstance();
-private TransformerFactory tFactory = TransformerFactory.newInstance();
-
-public void doGet(HttpServletRequest request,
- HttpServletResponse response) throws ServletException {
- try {
- response.setContentType("application/pdf");
- Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, response.getOutputStream());
- Transformer transformer = tFactory.newTransformer();
- Source src = new StreamSource("foo.fo");
- Result res = new SAXResult(fop.getDefaultHandler());
- transformer.transform(src, res);
- } catch (Exception ex) {
- throw new ServletException(ex);
- }
-}</source>
- <note>
- There are numerous problems with the code snippet above.
- Its purpose is only to demonstrate the basic concepts.
- See below for details.
- </note>
- </section>
- <section id="xslt">
- <title>Adding XSL tranformation (XSLT)</title>
- <p>
- A common requirement is to transform an XML source to
- XSL-FO using an XSL transformation. It is recommended to use
- JAXP for this task. The following snippet shows the basic
- code:
- </p>
- <source>private FopFactory fopFactory = FopFactory.newInstance();
-private TransformerFactory tFactory = TransformerFactory.newInstance();
-
-public void init() throws ServletException {
- //Optionally customize the FopFactory and TransformerFactory here
-}
-
-[..]
-
- //Setup a buffer to obtain the content length
- ByteArrayOutputStream out = new ByteArrayOutputStream();
-
- //Setup FOP
- Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);
-
- //Setup Transformer
- Source xsltSrc = new StreamSource(new File("foo-xml2fo.xsl"));
- Transformer transformer = tFactory.newTransformer(xsltSrc);
-
- //Make sure the XSL transformation's result is piped through to FOP
- Result res = new SAXResult(fop.getDefaultHandler());
-
- //Setup input
- Source src = new StreamSource(new File("foo.xml"));
-
- //Start the transformation and rendering process
- transformer.transform(src, res);
-
- //Prepare response
- response.setContentType("application/pdf");
- response.setContentLength(out.size());
-
- //Send content to Browser
- response.getOutputStream().write(out.toByteArray());
- response.getOutputStream().flush();</source>
- <note>
- Buffering the generated PDF in a ByteArrayOutputStream is done to avoid potential
- problems with the Acrobat Reader Plug-in in Microsoft Internet Explorer.
- </note>
- <p>
- The <code>Source</code> instance used above is simply an
- example. If you have to read the XML from a string, supply
- a <code>new StreamSource(new
- StringReader(xmlstring))</code>. Constructing and reparsing
- an XML string is generally less desirable than using a
- SAXSource if you generate your XML. You can alternatively
- supply a DOMSource as well. You may also use dynamically
- generated XSL if you like.
- </p>
- <p>
- Because you have an explicit <code>Transformer</code> object, you can also use it to
- explicitely set parameters for the transformation run.
- </p>
- </section>
- <section id="cfg">
- <title>Custom configuration</title>
- <p>
- You can easily set up your own FOUserAgent as demonstrated on the <a href="embedding.html">Embedding page</a>.
- </p>
- </section>
- <section id="performance">
- <title>Improving performance</title>
- <p>
- There are several options to consider:
- </p>
- <ul>
- <li>
- Instead of java.io.ByteArrayOutputStream consider using the ByteArrayOutputStream
- implementation from the <a href="ext:commons-io">Jakarta Commons IO project</a> which allocates less memory.
- The full class name is: <code>org.apache.commons.io.output.ByteArrayOutputStream</code>
- </li>
- <li>
- In certain cases it can help to write the generated PDF to a temporary file so
- you can quickly reuse the file. This is especially useful, if Internet Explorer
- calls the servlet multiple times with the same request or if you often generate
- equal PDFs.
- </li>
- </ul>
- <p>
- Of course, the
- <a href="embedding.html#performance">performance hints from the Embedding page</a>
- apply here, too.
- </p>
- </section>
- <section id="uriresolver">
- <title>Accessing resources in your web application</title>
- <p>
- Often, you will want to use resources (stylesheets, images etc.) which are bundled with
- your web application. FOP provides a URIResolver implementation that lets you access
- files via the Servlet's ServletContext. The class is called
- <code>org.apache.fop.servlet.ServletContextURIResolver</code>.
- </p>
- <p>
- Here's how to set it up in your servlet. Instantiate a new instance in the servlet's
- init() method:
- </p>
- <source><![CDATA[
- /** URIResolver for use by this servlet */
- protected URIResolver uriResolver;
-
- public void init() throws ServletException {
- this.uriResolver = new ServletContextURIResolver(getServletContext());
- [..]
- }]]></source>
- <p>
- The ServletContextURIResolver reacts on URIs beginning with "servlet-context:". If you
- want to access an image in a subdirectory of your web application, you could, for
- example, use: "servlet-context:/images/myimage.png". Don't forget the leading slash
- after the colon!
- </p>
- <p>
- Further down, you can use the URIResolver for various things:
- </p>
- <ul>
- <li>
- With the Transformer (JAXP/XSLT) so things like document() functions can resolver
- "servlet-context:" URIs.
- </li>
- <li>
- With the FopFactory so every resource FOP loads can be loaded using a "servlet-context:"
- URI.
- </li>
- <li>
- You can the ServletContextURIResolver yourself in your servlet code to access
- stylesheets or XML files bundled with your web application.
- </li>
- </ul>
- <p>
- Here are some example snippets:
- </p>
- <source><![CDATA[
-//Setting up the JAXP TransformerFactory
-this.transFactory = TransformerFactory.newInstance();
-this.transFactory.setURIResolver(this.uriResolver);
-
-[..]
-
-//Setting up the FOP factory
-this.fopFactory = FopFactory.newInstance();
-this.fopFactory.setURIResolver(this.uriResolver);
-
-[..]
-
-//The stylesheet for the JAXP Transfomer
-Source xsltSrc = this.uriResolver.resolve(
- "servlet-context:/xslt/mystylesheet.xsl", null);
-Transformer transformer = this.transFactory.newTransformer(xsltSrc);
-transformer.setURIResolver(this.uriResolver);]]></source>
- </section>
- </section>
- <section id="ie">
- <title>Notes on Microsoft Internet Explorer</title>
- <p>
- Some versions of Internet Explorer will not automatically show the PDF or call the servlet multiple times.
- These are well-known limitations of Internet Explorer and are not a problem of the servlet.
- However, Internet Explorer can still be used to download the PDF so that it can be viewed later.
- Here are some suggestions in this context:
- </p>
- <ul>
- <li>
- Use an URL ending in <code>.pdf</code>, like
- <code>http://myserver/servlet/stuff.pdf</code>. Yes, the servlet can
- be configured to handle this. If the URL has to contain parameters,
- try to have <strong>both</strong> the base URL as well as the last parameter end in
- <code>.pdf</code>, if necessary append a dummy parameter, like
- <code>http://myserver/servlet/stuff.pdf?par1=a&amp;par2=b&amp;d=.pdf</code>. The
- effect may depend on IEx version.
- </li>
- <li>
- Give IEx the opportunity to cache. In particular, ensure the
- server does not set any headers causing IEx not to cache the
- content. This may be a real problem if the document is sent
- over HTTPS, because most IEx installations will by default
- <em>not</em> cache any content retrieved over HTTPS.
- Setting the <code>Expires</code> header entry may help in
- this case:<br/> <code>response.setDateHeader("Expires",
- System.currentTimeMillis() + cacheExpiringDuration *
- 1000);</code><br/> Consult your server manual and the
- relevant RFCs for further details on HTTP headers and
- caching.
- </li>
- <li>
- Cache in the server. It may help to include a parameter in
- the URL which has a timestamp as the value min order to
- decide whether a request is repeated. IEx is reported to
- retrieve a document up to three times, but never more often.
- </li>
- </ul>
- </section>
- <section id="servlet-engine">
- <title>Servlet Engines</title>
- <p>
- When using a servlet engine, there are potential CLASSPATH issues, and potential conflicts
- with existing XML/XSLT libraries. Servlet containers also often use their own classloaders
- for loading webapps, which can cause bugs and security problems.
- </p>
- <section id="tomcat">
- <title>Tomcat</title>
- <p>
- Check Tomcat's documentation for detailed instructions about installing FOP and Cocoon.
- There are known bugs that must be addressed, particularly for Tomcat 4.0.3.
- </p>
- </section>
- <section id="websphere">
- <title>WebSphere 3.5</title>
- <p>
- Put a copy of a working parser in some directory where WebSphere can access it.
- For example, if /usr/webapps/yourapp/servlets is the CLASSPATH for your servlets,
- copy the Xerces jar into it (any other directory would also be fine).
- Do not add the jar to the servlet CLASSPATH, but add it to the CLASSPATH of the
- application server which contains your web application.
- In the WebSphere administration console, click on the "environment" button in the
- "general" tab. In the "variable name" box, enter "CLASSPATH".
- In the "value" box, enter the correct path to the parser jar file
- (/usr/webapps/yourapp/servlets/Xerces.jar in our example here).
- Press "OK", then apply the change and restart the application server.
- </p>
- </section>
- </section>
- <section id="complex-usecases">
- <title>Handling complex use cases</title>
- <p>
- Sometimes the requirements for a servlet get quite sophisticated: SQL data sources,
- multiple XSL transformations, merging of several datasources etc. In such a case
- consider using <a class="fork" href="ext:cocoon">Apache Cocoon</a> instead
- of a custom servlet to accomplish your goal.
- </p>
- </section>
- </body>
-</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1rc1/upgrading.xml b/src/documentation/content/xdocs/1.1rc1/upgrading.xml
deleted file mode 100644
index 1e2136a06..000000000
--- a/src/documentation/content/xdocs/1.1rc1/upgrading.xml
+++ /dev/null
@@ -1,181 +0,0 @@
-<?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$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
-<document>
- <header>
- <title>Upgrading from an Earlier Version of Apacheâ„¢ FOP</title>
- <version>$Revision$</version>
- </header>
- <body>
- <section id="fop-1.0">
- <title>Upgrading from Version 1.0</title>
- <p>
- You should encounter very few issues in upgrading from FOP 1.0, except as noted in the following:
- </p>
- <ul>
- <li>
- The intermediate format (IF) output format has underwent minor modification as follows:
- <ul>
- <li>
- In order to track changes to the IF format, a <code>version</code> attribute has been added to the root
- <code>document</code> element. Since no version information was provided previously, the initial
- value of this attribute is <code>2.0</code>. Future backward compatible changes will update the minor
- version number, while future non-backward compatible changes will update the major version number.
- </li>
- <li>
- On the <code>text</code> element, a new alternate representation is used for adjustments to glyph positions as expressed by a <code>dp</code>
- attribute instead of the <code>dx</code> attribute. For further information, see
- <a href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-dev/201202.mbox/%3cCACQ=j+evStXx=7hW=CHVNKCrZHUso9FHZCSk_5EoENOHcGpGOg@mail.gmail.com%3e">complex
- script patch - intermediate format changes</a>.
- </li>
- <li>
- On the <code>border-rect</code> element, the attributes {<code>before</code>, <code>after</code>, <code>start</code>, <code>end</code>}
- have been renamed to {<code>top</code>, <code>bottom</code>, <code>left</code>, <code>right</code>}, respectively.
- For further information, see
- <a href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-dev/201202.mbox/%3cCACQ=j+evStXx=7hW=CHVNKCrZHUso9FHZCSk_5EoENOHcGpGOg@mail.gmail.com%3e">complex
- script patch - intermediate format changes</a>.
- </li>
- </ul>
- </li>
- <li>
- The <code>IFPainter</code> interface (of package <code>org.apache.fop.render.intermediate</code>), specifically the
- <code>drawText</code> and <code>drawBorderRect</code> method signatures, have been modified to express the semantics of the above changes to the IF output format.
- </li>
- <li>
- The area tree (AT) output format has underwent minor modification as follows:
- <ul>
- <li>
- In order to track changes to the AT format, a <code>version</code> attribute has been added to the root
- <code>areaTree</code> element. Since no version information was provided previously, the initial
- value of this attribute is <code>2.0</code>. Future backward compatible changes will update the minor
- version number, while future non-backward compatible changes will update the major version number.
- </li>
- <li>
- An optional <code>level</code> attribute has been added to a number of element types to express resolved bidirectional level.
- </li>
- <li>
- An optional <code>reversed</code> attribute has been added to the <code>word</code> element type to express that the glyphs that
- correspond to the character content of the element should be reversed (in order) in the inline progression dimension when rendering.
- </li>
- </ul>
- </li>
- <li>
- Because complex script features are now enabled by default, it is possible that different font specific data will be used for
- kerning than was previously used. This may be the case if a font supports a traditional TrueType <code>kern</code> table and
- also supports the advanced typographic <code>kern</code> feature with a <code>GPOS</code> table. In FOP 1.0, the former is used for kerning,
- while in FOP 1.1 with complex script features enabled, the latter is used. If it is desired to explicitly use the <code>kern</code> table (rather
- than the <code>GPOS</code> table) in such a case, then the <code>-nocs</code> command line option may be used when invoking FOP
- in order to disable complex script features.
- </li>
- </ul>
- </section>
- <section id="pre-1.0">
- <title>Upgrading from Pre-1.0 Versions</title>
- <p>
- If you're planning to upgrade to the latest Apacheâ„¢ FOP version from a pre-1.0 version,
- there are a few very important things to consider:
- </p>
- <ul>
- <li>
- The API of FOP has changed considerably and is not
- backwards-compatible with versions 0.20.5 and
- 0.91beta. Version 0.92 introduced the <strong>new stable
- API</strong>.
- </li>
- <li>
- Since version 0.92 some deprecated methods which were part
- of the old API have been removed. If you upgrade from 0.91
- beta, you will need to adjust your Java code. Similarly if
- you upgrade from 0.92 and use deprecated methods.
- </li>
- <li>
- If you are using a configuration file for version 0.20.5, you have to rebuild it in the new format. The format
- of the configuration files has changed since version 0.20.5. See conf/fop.xconf for
- an example configuration file. A XML Schema file can be found under
- src/foschema/fop-configuration.xsd.
- </li>
- <li>
- Beginning with version 0.94 you can skip the generation of
- font metric files and remove the "font-metrics" attribute
- in the font configuration. In the unlikely case that due to
- a bug you still need to use font metrics files you will need
- to regenerate the font metrics file if yours are from a FOP
- version before 0.93.
- </li>
- <li>
- <p>
- The new code is much more strict about the interpretation of the XSL-FO specification.
- Things that worked fine in version 0.20.5 might start to produce warnings or even errors
- now. FOP 0.20.5 contains many bugs which have been corrected in the new code.
- </p>
- <note label="An example">
- While FOP 0.20.5 allowed you to have empty <code>fo:table-cell</code> elements, the new code
- will complain about that (unless relaxed validation is enabled) because the specification
- demands at least one block-level element (<code>(%block;)+</code>, see
- <a href="http://www.w3.org/TR/xsl/#fo_table-cell">XSL-FO 1.1, 6.7.10</a>)
- inside an <code>fo:table-cell</code> element.
- </note>
- </li>
- <li>
- Extensions and Renderers written for version 0.20.5 will not work with the new code! The new FOP
- extension for <a href="http://barcode4j.sourceforge.net">Barcode4J</a> is available since
- January 2007.
- </li>
- <li>
- The SVG Renderer and the MIF Handler have not yet been resurrected! They are currently non-functional
- and hope for someone to step up and reimplement them.
- </li>
- </ul>
- <p>
- When you use your existing FO files or XML/XSL files which work fine with FOP version
- 0.20.5 against this FOP version some things may not work as expected. The following
- list will hopefully help you to identify and correct those problems.
- </p>
- <ul>
- <li>
- Check the <a href="../compliance.html">Compliance page</a> for the feature causing
- trouble. It may contain the necessary information to understand and resolve the problem.
- </li>
- <li>
- Not all 0.20.5 output formats are supported. PDF and Postscript should be fully supported.
- See <a href="output.html">Output Targets</a> for a more complete description.
- </li>
- <li>
- As stated above, empty table cells <code>&lt;fo:table-cell&gt;&lt;/fo:table-cell&gt;</code>
- are not allowed by the specification. The same applies to empty <code>fo:static-content</code>
- and <code>fo:block-container</code> elements, for example.
- </li>
- <li>
- Version 0.20.5 is not XSL-FO compliant with respect to sizing images (<code>external-graphic</code>)
- or <code>instream-foreign-object</code>
- objects. If images or SVGs are sized differently in your outputs with the new FOP version
- check <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=37136">Bug 37136</a>
- as it contains some hints on what to do. The file
- <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/fo/basic/images.fo?view=markup">
- <code>"examples/fo/basic/images.fo"</code></a> has
- a number of good examples that show the correct behaviour.
- </li>
- <li>
- The <code>fox:outline</code> extension is not implemented in the current version:
- it has been superseded by the new bookmark elements from XSL-FO 1.1.
- </li>
- </ul>
- </section>
- </body>
-</document>
diff --git a/src/documentation/content/xdocs/bugs.xml b/src/documentation/content/xdocs/bugs.xml
index 100789c54..caeb728b2 100644
--- a/src/documentation/content/xdocs/bugs.xml
+++ b/src/documentation/content/xdocs/bugs.xml
@@ -17,6 +17,7 @@
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "http://forrest.apache.org/dtd/document-v13.dtd">
+
<document>
<header>
<title>Apacheâ„¢ FOP: Bugs and Other Trackable Issues</title>
diff --git a/src/documentation/content/xdocs/compliance.ihtml b/src/documentation/content/xdocs/compliance.ihtml
index 11e3332b3..a8e7a39ca 100644
--- a/src/documentation/content/xdocs/compliance.ihtml
+++ b/src/documentation/content/xdocs/compliance.ihtml
@@ -560,9 +560,9 @@
<th rowspan="2">Comments</th>
</tr>
<tr>
+ <th align="center">0.95 (stable)</th>
<th align="center">1.0 (stable)</th>
- <th align="center">1.1 (rc1)</th>
- <th align="center">development</th>
+ <th align="center">develop- ment</th>
</tr>
<tr>
@@ -883,8 +883,8 @@
<td><a name="fo-object-bidi-override" id="fo-object-bidi-override">bidi-override</a></td>
<td class="extended">Extended</td>
<td class="no">no</td>
- <td class="yes">yes</td>
- <td class="yes">yes</td>
+ <td class="no">no</td>
+ <td class="no">no</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1439,7 +1439,7 @@
"http://www.w3.org/TR/xsl/#fo_wrapper">&sect;6.13.4</a></td>
<td><a name="fo-object-wrapper" id="fo-object-wrapper">wrapper</a></td>
<td class="basic">Basic</td>
- <td class="yes">yes</td>
+ <td class="partial">partial</td>
<td class="yes">yes</td>
<td class="yes">yes</td>
<td>Only works as expected with inline-level content.</td>
@@ -1491,8 +1491,8 @@
<th rowspan="2">Comments</th>
</tr>
<tr>
+ <th align="center">0.95 (stable)</th>
<th align="center">1.0 (stable)</th>
- <th align="center">1.1 (rc1)</th>
<th align="center">develop- ment</th>
</tr>
@@ -1596,6 +1596,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1606,6 +1607,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1616,6 +1618,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1626,6 +1629,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1636,6 +1640,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1646,6 +1651,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1656,6 +1662,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1666,6 +1673,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1676,6 +1684,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1686,6 +1695,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1696,6 +1706,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1706,6 +1717,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1716,6 +1728,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1727,6 +1740,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1737,6 +1751,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1747,6 +1762,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1757,6 +1773,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -1767,6 +1784,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
@@ -2303,7 +2321,7 @@
<td class="yes">yes</td>
<td class="yes">yes</td>
<td>For PDF output: Only 2-letter codes from ISO 639 are supported properly to
- identify the natural language! Also used with complex scripts features.</td>
+ identify the natural language!</td>
</tr>
<tr>
<td align="center"><a href=
@@ -2311,9 +2329,9 @@
<td><a name="fo-property-script" id="fo-property-script">script</a></td>
<td class="extended">Extended</td>
<td class="no">no</td>
- <td class="no">yes</td>
- <td class="no">yes</td>
- <td>Used with complex scripts features to override default script heuristics.</td>
+ <td class="no">no</td>
+ <td class="no">no</td>
+ <td>&nbsp;</td>
</tr>
<tr>
<td align="center"><a href=
@@ -2727,7 +2745,7 @@
"http://www.w3.org/TR/xsl/#max-height">&sect;7.15.8</a></td>
<td><a name="fo-property-max-height" id="fo-property-max-height">max-height</a></td>
<td class="complete">Complete</td>
- <td class="yes">yes</td>
+ <td class="no">no</td>
<td class="yes">yes</td>
<td class="yes">yes</td>
<td>&nbsp;</td>
@@ -2737,7 +2755,7 @@
"http://www.w3.org/TR/xsl/#max-width">&sect;7.15.9</a></td>
<td><a name="fo-property-max-width" id="fo-property-max-width">max-width</a></td>
<td class="complete">Complete</td>
- <td class="yes">yes</td>
+ <td class="no">no</td>
<td class="yes">yes</td>
<td class="yes">yes</td>
<td>&nbsp;</td>
@@ -2747,7 +2765,7 @@
"http://www.w3.org/TR/xsl/#min-height">&sect;7.15.10</a></td>
<td><a name="fo-property-min-height" id="fo-property-min-height">min-height</a></td>
<td class="complete">Complete</td>
- <td class="yes">yes</td>
+ <td class="no">no</td>
<td class="yes">yes</td>
<td class="yes">yes</td>
<td>&nbsp;</td>
@@ -2757,7 +2775,7 @@
"http://www.w3.org/TR/xsl/#min-width">&sect;7.15.11</a></td>
<td><a name="fo-property-min-width" id="fo-property-min-width">min-width</a></td>
<td class="complete">Complete</td>
- <td class="yes">yes</td>
+ <td class="no">no</td>
<td class="yes">yes</td>
<td class="yes">yes</td>
<td>&nbsp;</td>
@@ -3146,6 +3164,7 @@
<td class="partial">partial</td>
<td>
<ul>
+ <li>[0.95] &lt;integer&gt; values are not supported.</li>
<li>[1.0 and later] minimal support for &lt;integer&gt; value.</li>
</ul>
</td>
@@ -3163,6 +3182,7 @@
<ul>
<li>works on all implemented block-level FOs, but not on inline-level
FOs.</li>
+ <li>[0.95] &lt;integer&gt; values are not supported.</li>
<li>[1.0 and later] minimal support for &lt;integer&gt; value.</li>
</ul>
</td>
@@ -3178,8 +3198,11 @@
<td class="partial">partial</td>
<td>
<ul>
+ <li>[0.95] works on all implemented FOs, except list- and inline-level
+ FOs.</li>
<li>[1.0 and later] works on all implemented block-level
FOs, but not on inline-level FOs.</li>
+ <li>[0.95] &lt;integer&gt; values are not supported.</li>
<li>[1.0 and later] minimal support for &lt;integer&gt; value.</li>
</ul>
</td>
@@ -3420,7 +3443,7 @@
<td><a name="fo-property-show-destination" id=
"fo-property-show-destination">show-destination</a></td>
<td class="extended">Extended</td>
- <td class="partial">partial</td>
+ <td class="no">no</td>
<td class="partial">partial</td>
<td class="partial">partial</td>
<td>[1.0 and later] only has effect in PDF output, for external PDF destinations (links pointing to destinations
@@ -3647,9 +3670,9 @@
<td><a name="fo-property-format" id="fo-property-format">format</a></td>
<td class="basic">Basic</td>
<td class="partial">partial</td>
- <td class="yes">yes</td>
- <td class="yes">yes</td>
- <td>[1.0 and earlier] only values '0*1', 'a', 'A', 'i', 'I' supported</td>
+ <td class="partial">partial</td>
+ <td class="partial">partial</td>
+ <td>only values '0*1', 'a', 'A', 'i', 'I' supported</td>
</tr>
<tr>
<td align="center"><a href=
@@ -3658,8 +3681,8 @@
"fo-property-grouping-separator">grouping-separator</a></td>
<td class="extended">Extended</td>
<td class="no">no</td>
- <td class="yes">yes</td>
- <td class="yes">yes</td>
+ <td class="no">no</td>
+ <td class="no">no</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -3668,8 +3691,8 @@
<td><a name="fo-property-grouping-size" id="fo-property-grouping-size">grouping-size</a></td>
<td class="extended">Extended</td>
<td class="no">no</td>
- <td class="yes">yes</td>
- <td class="yes">yes</td>
+ <td class="no">no</td>
+ <td class="no">no</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -3678,8 +3701,8 @@
<td><a name="fo-property-letter-value" id="fo-property-letter-value">letter-value</a></td>
<td class="basic">Basic</td>
<td class="no">no</td>
- <td class="yes">yes</td>
- <td class="yes">yes</td>
+ <td class="no">no</td>
+ <td class="no">no</td>
<td>&nbsp;</td>
</tr>
@@ -3829,7 +3852,7 @@
"http://www.w3.org/TR/xsl/#page-position">&sect;7.27.14</a></td>
<td><a name="fo-property-page-position" id="fo-property-page-position">page-position</a></td>
<td class="extended">Extended</td>
- <td class="yes">yes</td>
+ <td class="partial">partial</td>
<td class="yes">yes</td>
<td class="yes">yes</td>
<td>value "only" not supported</td>
@@ -4177,9 +4200,9 @@
<td><a name="fo-property-writing-mode" id="fo-property-writing-mode">writing-mode</a></td>
<td class="basic">Basic</td>
<td class="no">no</td>
- <td class="yes">yes</td>
- <td class="yes">yes</td>
- <td>[1.1 and later] only horizontal left-to-right and right-to-left modes</td>
+ <td class="no">no</td>
+ <td class="no">no</td>
+ <td>&nbsp;</td>
</tr>
<tr>
@@ -4499,6 +4522,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -4572,6 +4596,7 @@
<td class="na">na</td>
<td class="na">na</td>
<td class="na">na</td>
+ <td class="na">na</td>
<td>&nbsp;</td>
</tr>
<tr>
@@ -4642,10 +4667,11 @@
<th rowspan="2">Comments</th>
</tr>
<tr>
+ <th align="center">0.95 (stable)</th>
<th align="center">1.0 (stable)</th>
- <th align="center">1.1 (rc1)</th>
- <th align="center">development</th>
+ <th align="center">develop- ment</th>
</tr>
+
<tr>
<td class="category" align="center"><a href=
"http://www.w3.org/TR/xsl/#d0e5860">&sect;5.10.1</a></td>
diff --git a/src/documentation/content/xdocs/download.xml b/src/documentation/content/xdocs/download.xml
index 905e4a131..ab379fe44 100644
--- a/src/documentation/content/xdocs/download.xml
+++ b/src/documentation/content/xdocs/download.xml
@@ -85,25 +85,6 @@
<p/>
<table>
<tr>
- <th colspan="2">This Candidate Release</th>
- </tr>
- <tr>
- <td>Repository URL</td>
- <td>
- <link href="http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-1_1rc1/">
- <code>http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-1_1rc1/</code>
- </link>
- </td>
- </tr>
- <tr>
- <td>Web view</td>
- <td>
- <link href="http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-1_1rc1/">
- <code>http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-1_1rc1/</code>
- </link>
- </td>
- </tr>
- <tr>
<th colspan="2">Latest Stable Release</th>
</tr>
<tr>
@@ -128,7 +109,7 @@
<tr>
<td>Repository URL</td>
<td>
- <link href="http://svn.apache.org/repos/asf/xmlgraphics/fop/tages/fop-0_95/">
+ <link href="http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-0_95/">
<code>http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-0_95/</code>
</link>
</td>
@@ -187,11 +168,11 @@
<title>Archive Download</title>
<p>
FOP Archive distributions are linked from the upper portion of the Apache FOP
- Download Mirror Page and can be downloaded from the FOP
- <link href="http://archive.apache.org/dist/xmlgraphics/fop/binaries/">binaries</link> and
- <link href="http://archive.apache.org/dist/xmlgraphics/fop/source/">source</link> archives.
+ Download Mirror Page and can be downloaded from the FOP Archives
+ <link href="http://archive.apache.org/dist/xmlgraphics/fop/binaries/">binaries</link> &amp;
+ <link href="http://archive.apache.org/dist/xmlgraphics/fop/source/">source</link> links.
</p>
</section>
</body>
</document>
-<!-- Last Line of $RCSfile$ -->
+<!-- Last Line of $RCSfile$ --> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/examples.xml b/src/documentation/content/xdocs/examples.xml
index 6565c1b4e..f64a0d702 100644
--- a/src/documentation/content/xdocs/examples.xml
+++ b/src/documentation/content/xdocs/examples.xml
@@ -39,7 +39,7 @@
<tr>
<td>default font characters</td>
<td><link href="fo/fonts.fo">fonts.fo</link></td>
- <td><link href="fo/fonts.pdf">fonts.pdf</link></td>
+ <td><link href="fo/fonts.fo.pdf">fonts.fo.pdf</link></td>
</tr>
</table>
<p>Other basic examples on the use of XSL-FO can be found in the FOP distribution in
@@ -100,17 +100,17 @@ Embedding images in FO:
<tr>
<td>align in larger viewport</td>
<td><link href="fo/align.fo">align.fo</link></td>
- <td><link href="fo/align.pdf">align.pdf</link></td>
+ <td><link href="fo/align.fo.pdf">align.fo.pdf</link></td>
</tr>
<tr>
<td>align in smaller viewport</td>
<td><link href="fo/align2.fo">align2.fo</link></td>
- <td><link href="fo/align2.pdf">align2.pdf</link></td>
+ <td><link href="fo/align2.fo.pdf">align2.fo.pdf</link></td>
</tr>
<tr>
<td>scaling image</td>
<td><link href="fo/size.fo">size.fo</link></td>
- <td><link href="fo/size.pdf">size.pdf</link></td>
+ <td><link href="fo/size.fo.pdf">size.fo.pdf</link></td>
</tr>
</table>
<p>Look also into the directory examples/fo/svg. There you find some very extensive SVG examples.
@@ -132,7 +132,7 @@ Instream Foreign Object images in FO, there are more on the
<tr>
<td>embedding svg in viewport</td>
<td><link href="fo/embed.fo">embed.fo</link></td>
- <td><link href="fo/embed.pdf">embed.pdf</link></td>
+ <td><link href="fo/embed.fo.pdf">embed.fo.pdf</link></td>
</tr>
</table>
</section>
diff --git a/src/documentation/content/xdocs/faq.xml b/src/documentation/content/xdocs/faq.xml
index 47fa65e6e..845c24045 100644
--- a/src/documentation/content/xdocs/faq.xml
+++ b/src/documentation/content/xdocs/faq.xml
@@ -16,7 +16,8 @@
limitations under the License.
-->
<!-- $Id$ -->
-<!DOCTYPE faqs PUBLIC "-//APACHE//DTD FAQ V1.3//EN" "http://forrest.apache.org/dtd/faq-v12.dtd">
+<!DOCTYPE faqs PUBLIC "-//APACHE//DTD FAQ V1.3//EN" "http://forrest.apache.org/dtd/faq-v13.dtd">
+
<faqs title="FOP FAQ">
<part id="part-general">
<title>Apacheâ„¢ FOP: General questions</title>
@@ -145,16 +146,16 @@
<answer>
<p>
When it's ready and the committers have enough time to go
- through the time-consuming process of creating a release. Version
- 1.1rc1 was released on 02 July 2012. A subsequent final
- Version 1.1 is expected to be released within 1 to 3 months following
- this release candidate. If you want to speed up the process, consider <link
- href="dev/index.html#involved">contributing</link> to FOP.
- </p>
+ through the time-consuming process of creating a release. We
+ released version 1.0 on 21 July 2010, and will release version
+ 1.1 when we accumulated enough additions and bug fixes. If
+ you want to speed up the process, consider <link
+ href="dev/index.html#involved">contributing</link> to
+ FOP.</p>
</answer>
</faq>
<faq id="redesign">
- <question>Why did you redesign FOP between Versions 0.2X and 0.9X?</question>
+ <question>Why did you redesign FOP?</question>
<answer>
<p>The code redesign of FOP was necessary in order to be able to adress following issues:</p>
<ul>
diff --git a/src/documentation/content/xdocs/fo.xml b/src/documentation/content/xdocs/fo.xml
index c668eecfd..ba2402cfe 100644
--- a/src/documentation/content/xdocs/fo.xml
+++ b/src/documentation/content/xdocs/fo.xml
@@ -17,6 +17,7 @@
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "http://forrest.apache.org/dtd/document-v13.dtd">
+
<document>
<header>
<title>Apacheâ„¢ FOP: XSL-FO Input</title>
@@ -66,7 +67,7 @@ The following hexadecimal example will result in a Euro sign:
Getting your XML correctly encoded is only part of the job.
If you want the character to display or print correctly (and you probably do), then the selected font must contain the necessary glyph.
Because of differences between font encoding methods, and limitations in some font technologies, this can be a troublesome issue, especially for symbol characters.
-The FOP example file <link href="fo/fonts.pdf">Base-14 Font Character Mapping</link> is a very useful resource in sorting these issues out for the Base-14 fonts.
+The FOP example file <link href="fo/fonts.fo.pdf">Base-14 Font Character Mapping</link> is a very useful resource in sorting these issues out for the Base-14 fonts.
For other fonts, use font editing sofware or operating system utilities (such as the Character Map in most Windows platforms) to determine what characters the font supports.
</p>
<p>
@@ -518,10 +519,10 @@ This applies similarly to the extent of the after region and the bottom margin o
<section id="external-resources">
<title>External Resources</title>
<p>Resources needed by an XSL-FO file that are external to it (graphics, for example), are defined in the XSL-FO standard as being of type "uri-specification". This is defined in the standard at <jump href="http://www.w3.org/TR/xsl11/#datatype">Section 5.11 Property Datatypes</jump>, which includes a link to the URI standard itself. Refer to the XSL-FO and URI standards themselves for more detailed instructions.</p>
- <p>URIs may be either absolute or relative to a base URI. (See <link href="1.1rc1/configuration.html">FOP: Configuration</link> for information on setting the base URI for a FOP session). Here is an example referencing an external-graphic that is relative to the base URI:</p>
+ <p>URIs may be either absolute or relative to a base URI. (See <link href="1.0/configuration.html">FOP: Configuration</link> for information on setting the base URI for a FOP session). Here is an example referencing an external-graphic that is relative to the base URI:</p>
<source><![CDATA[<fo:external-graphic src="url('images/logo.jpg')"/>]]></source>
<p>Here is an example referencing an external-graphic that is an absolute URI on a local filesystem:</p>
- <source><![CDATA[fo:external-graphic src="url('file:///d:/images/logo.jpg')"/>]]></source>
+ <source><![CDATA[fo:external-graphic src="url('file:d:///images/logo.jpg')"/>]]></source>
</section>
</section>
</body>
diff --git a/src/documentation/content/xdocs/fo/align.fo b/src/documentation/content/xdocs/fo/align.fo
index 06e6a2929..ee0cc8827 100644
--- a/src/documentation/content/xdocs/fo/align.fo
+++ b/src/documentation/content/xdocs/fo/align.fo
@@ -19,18 +19,19 @@
<fo:root font-family="Times Roman" font-size="12pt" text-align="center" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
- <fo:simple-page-master
- margin-right="1.5cm"
- margin-left="1.5cm"
- margin-bottom="2cm"
- margin-top="1cm"
- page-width="21cm"
- page-height="29.7cm"
- master-name="left">
- <fo:region-body margin-top="1cm"/>
- <fo:region-before extent="1cm"/>
- <fo:region-after extent="1.5cm"/>
- </fo:simple-page-master>
+ <fo:simple-page-master
+ margin-right="1.5cm"
+ margin-left="1.5cm"
+ margin-bottom="2cm"
+ margin-top="1cm"
+ page-width="21cm"
+ page-height="29.7cm"
+ master-name="left">
+ <fo:region-before extent="1cm"/>
+ <fo:region-body margin-top="1cm"/>
+ <fo:region-after extent="1.5cm"/>
+ </fo:simple-page-master>
+
</fo:layout-master-set>
<fo:page-sequence id="N2528" master-reference="left">
diff --git a/src/documentation/content/xdocs/fo/align.fo.pdf b/src/documentation/content/xdocs/fo/align.fo.pdf
new file mode 100644
index 000000000..9e5393e1e
--- /dev/null
+++ b/src/documentation/content/xdocs/fo/align.fo.pdf
Binary files differ
diff --git a/src/documentation/content/xdocs/fo/align.pdf b/src/documentation/content/xdocs/fo/align.pdf
deleted file mode 100644
index 4b9413b1c..000000000
--- a/src/documentation/content/xdocs/fo/align.pdf
+++ /dev/null
Binary files differ
diff --git a/src/documentation/content/xdocs/fo/align2.fo b/src/documentation/content/xdocs/fo/align2.fo
index 64449dbb3..d16553139 100644
--- a/src/documentation/content/xdocs/fo/align2.fo
+++ b/src/documentation/content/xdocs/fo/align2.fo
@@ -19,18 +19,19 @@
<fo:root font-family="Times Roman" font-size="12pt" text-align="center" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
- <fo:simple-page-master
- margin-right="1.5cm"
- margin-left="1.5cm"
- margin-bottom="2cm"
- margin-top="1cm"
- page-width="21cm"
- page-height="29.7cm"
- master-name="left">
- <fo:region-body margin-top="1cm"/>
- <fo:region-before extent="1cm"/>
- <fo:region-after extent="1.5cm"/>
- </fo:simple-page-master>
+ <fo:simple-page-master
+ margin-right="1.5cm"
+ margin-left="1.5cm"
+ margin-bottom="2cm"
+ margin-top="1cm"
+ page-width="21cm"
+ page-height="29.7cm"
+ master-name="left">
+ <fo:region-before extent="1cm"/>
+ <fo:region-body margin-top="1cm"/>
+ <fo:region-after extent="1.5cm"/>
+ </fo:simple-page-master>
+
</fo:layout-master-set>
<fo:page-sequence id="N2528" master-reference="left">
@@ -58,7 +59,7 @@ Default align:
<fo:block>
Default align:
(<fo:external-graphic width="50pt" height="50pt" overflow="hidden" src="images/fop.jpg"/>), start-before
-(<fo:external-graphic width="50pt" height="50pt" overflow="hidden" text-align="start" display-align="before" src="images/fop.jpg"/>), start-center
+(<fo:external-graphic width="50pt" height="50pt" overflow="hidden" text-align="start" display-align="start" src="images/fop.jpg"/>), start-center
(<fo:external-graphic width="50pt" height="50pt" overflow="hidden" text-align="start" display-align="center" src="images/fop.jpg"/>), start-after
(<fo:external-graphic width="50pt" height="50pt" overflow="hidden" text-align="start" display-align="after" src="images/fop.jpg"/>), center-before
(<fo:external-graphic width="50pt" height="50pt" overflow="hidden" text-align="center" display-align="before" src="images/fop.jpg"/>), center-after
diff --git a/src/documentation/content/xdocs/fo/align2.fo.pdf b/src/documentation/content/xdocs/fo/align2.fo.pdf
new file mode 100644
index 000000000..f5a02666b
--- /dev/null
+++ b/src/documentation/content/xdocs/fo/align2.fo.pdf
Binary files differ
diff --git a/src/documentation/content/xdocs/fo/align2.pdf b/src/documentation/content/xdocs/fo/align2.pdf
deleted file mode 100644
index 01b8d1bfb..000000000
--- a/src/documentation/content/xdocs/fo/align2.pdf
+++ /dev/null
Binary files differ
diff --git a/src/documentation/content/xdocs/fo/build.xml b/src/documentation/content/xdocs/fo/build.xml
deleted file mode 100644
index 4b4a099b4..000000000
--- a/src/documentation/content/xdocs/fo/build.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<!-- =========================================================================== -->
-<project default="newPDF" basedir=".">
- <!-- =================================================================== -->
- <!-- Initialization target -->
- <!-- =================================================================== -->
- <target name="init">
- <tstamp/>
- <mkdir dir="tests"/>
- <property name="testDir" value="tests"/>
- <property name="foDir" value="."/>
- <path id="run-classpath">
- <fileset dir="../../../../../lib">
- <include name="*.jar"/>
- </fileset>
- <pathelement location="../../../../../build/fop.jar"/>
- </path>
- <taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop" classpathref="run-classpath"/>
- </target>
- <!-- =================================================================== -->
- <!-- Help on usage -->
- <!-- =================================================================== -->
- <target name="usage">
- <echo message="Use '-projecthelp' instead"/>
- </target>
- <!-- =================================================================== -->
- <!-- Produces new test files (function) -->
- <!-- =================================================================== -->
- <target name="newTestFiles">
- <fop format="${mimetype}" outdir="${outDir}" messagelevel="${msglevel}" relativebase="true" throwexceptions="false">
- <fileset dir=".">
- <include name="**/*.fo"/>
- </fileset>
- </fop>
- </target>
- <!-- =================================================================== -->
- <!-- Produces new test PDF files -->
- <!-- =================================================================== -->
- <target name="newPDF" depends="init" description="Creates a new set of PDF test files">
- <antcall target="newTestFiles">
- <param name="mimetype" value="application/pdf"/>
- <param name="msglevel" value="warn"/>
- <param name="outDir" value="${testDir}"/>
- </antcall>
- </target>
- <!-- =================================================================== -->
- <!-- Clean targets -->
- <!-- =================================================================== -->
- <target name="clean" depends="init">
- <delete dir="${testDir}"/>
- </target>
-
-</project>
-<!-- End of file -->
diff --git a/src/documentation/content/xdocs/fo/embed.fo b/src/documentation/content/xdocs/fo/embed.fo
index 6b052e0bf..558e9d397 100644
--- a/src/documentation/content/xdocs/fo/embed.fo
+++ b/src/documentation/content/xdocs/fo/embed.fo
@@ -23,18 +23,19 @@
<fo:root font-family="Times Roman" font-size="12pt" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
- <fo:simple-page-master
- margin-right="1.5cm"
- margin-left="1.5cm"
- margin-bottom="2cm"
- margin-top="1cm"
- page-width="21cm"
- page-height="29.7cm"
- master-name="left">
- <fo:region-body margin-top="1cm"/>
- <fo:region-before extent="1cm"/>
- <fo:region-after extent="1.5cm"/>
- </fo:simple-page-master>
+ <fo:simple-page-master
+ margin-right="1.5cm"
+ margin-left="1.5cm"
+ margin-bottom="2cm"
+ margin-top="1cm"
+ page-width="21cm"
+ page-height="29.7cm"
+ master-name="left">
+ <fo:region-before extent="1cm"/>
+ <fo:region-body margin-top="1cm"/>
+ <fo:region-after extent="1.5cm"/>
+ </fo:simple-page-master>
+
</fo:layout-master-set>
<fo:page-sequence id="N2528" master-reference="left">
diff --git a/src/documentation/content/xdocs/fo/embed.fo.pdf b/src/documentation/content/xdocs/fo/embed.fo.pdf
new file mode 100644
index 000000000..6da06b559
--- /dev/null
+++ b/src/documentation/content/xdocs/fo/embed.fo.pdf
@@ -0,0 +1,87 @@
+%PDF-1.3
+%ª«¬­
+4 0 obj
+<< /Type /Info
+/Producer (FOP 0.20.5) >>
+endobj
+5 0 obj
+<< /Length 1556 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+Gb"0W9p=9h(^KQB5D>011Kd^2(:&!s-8.0G?92NC6am<+$Zp"a8L^3ZrE?Z%8B:u_OFn)DOGr-/INIQ=q\oZh2p:3YpSJW^j5k;[E4:*BGe#CoakN"mYH!sFZ8>$).@Y@g/-!,+\,3geIX]sgn&ks8h-P:I5CJ>(?M<peVjI(+?b[S@pZ8%/ns@)HU2Lio<0CtCPX[Q)8_(<FftM:sit[&L*Ob:OKat[.EkI%ON)unFn92KJrG.J!cH<PB*A9Y6q24X,`S^&S[!UEIh+u"#V93'eZc#bITL93O^P^p,I3BHrmbEFVPF$aP[Jemg]0^JG[GBF4ZUN[?=KSW(*k#W!J+1'Bh;+g]["$p!rMJIh;uH?[:#+dG<U]5@$Jf'eIGN8iGJ0k>3srEp%+j`GFC2lVAW?-k]'A%*A+X0,Y&n>gXrgJRd8etuLIh.uop[SIXoW1(Me8(mZ+eI84[tkfD8Y2>AOP5_.60qf-b].hK50R#%EJ8&ck"-ed6),XDAZ4I/+.NABKpXVTecSBnJhE/-BIl,-QFP0P>7hC<B]QN&C.,Y8Gd*8%[k^9Hi4&$B)L$>kMsi)STHZs%$'J5nT--!YC%F5o`L74Wr:Be]r#sCZ+lgS/E:AD3,3jV\ej=Ch)Mm&T3L9Qof&akqNaE.ePBeD$+%h=PJ*s!3>n&C]igN#KOB]'j8H"aks*5=iHX3ZW>2HPS[b]*`)73_Q%NVce\!_DKr]/-Y/42K3d4X3_6^:.XnTm.M/Ws*C)U,oQ,$R7M5;IQWWpQNXEeNq$<R<Z?j3W^FmcIHJnJLtn"7q,lIV18P-__e<Fgr_6rPiH7SM(LJ5hU;;F)d'"fZPjPmA)PrUM!Qp%*M$jflJgibHB!cmc"N9.VAd;)(V]?<k_^!EQuC=90p["fud#Pn6%clf97o>-MaM&m21cZ'7XGeK>`6"O7>T<ko&E!@qO]XE0/^&3L?dC3.eQYbEX_<h1cDLEnJS=-O,Fo?4qC$r@,-5S^4!<M2Bs<$Qsaan'ESI[F:IQD.j]$*GaN/1&\A3Cq0H&Y'R;YM^/.JlhFK?K]UL7.;t8P=rd#Au7HmY>plj8g:-IOGkatB8+,OGQk;/'tf.M\ap^O]Zf]N/IY_K;_Cf\L-lRiL(u"ei;CH2-j*X=.qf*gTG=iZSQ6qr)cg<j)q4H%YZ.\Z,10D%M5;J,.L4)Jb&CAe^;<tH$=DaBI%@mQK]&)u;bP"C=,]);Y<#<---<LF5r/0+2(Jf:i@B;0YOE:@cJ;PgE8YMeBD+'tMJH7H>BtH@(6&KA0C:ed<NAL]hd<_.;BdP%K4MpV]JSDt]5SSS_HjZ5GBXA0<7Li@R\gm\NFJc%&ogoS@O[.ub!@ekBUfe=Y.td^!a":e>j%+t+a=UNaVEi.YkDdNJud0091bqd)C/fC``XJC$=&-4E!<D[FmcaPJcf8u<fEkZ?OjPcl:rlH2j2]h[<`2[_>YWO/1#n25qkWC<X.PM>_ic-+YL^(]=:7:C?abAqh?bqD4b-,1\n_j+*T5NVnRDAT6?<U@WcP17PIi#^4hB/rspg7gYM~>
+endstream
+endobj
+6 0 obj
+<< /Type /Page
+/Parent 1 0 R
+/MediaBox [ 0 0 595 842 ]
+/Resources 3 0 R
+/Contents 5 0 R
+>>
+endobj
+7 0 obj
+<< /Length 1817 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+Gb"0W:N+uG(^BKA5)#"'Yd"$U8imem#OF-PR"6:/*k]utN6sEG3%4Xj7nFsp;3J?+4m;Cb/S%)3?CFKB?VSYnqb?ePK?>&Z1uIXURQk@7VtS,NabaJ,Y-fH"AbkJUs)n(bDSLTWQi$]3.r%#RgR?#YrF>m&j5#._.Gt&lrOg7dfGe=DCLO9.JlJ#\Nu:_+'9XObCm7%pIqEiC#]3r(6ZXV,rHP^:2:!="7[p5gQd%aYoh4"?CMW%pVqf;,\4sMKf<>Y[[oqT?]$9s%n,K_VArek#gUbF!FjDL<f/M_nI7j[N(Sm.]Wjj^^X.[)1g9opE<O[0BX3jCRC#>/(H\Zt^D8g"tMc@0c>I<YL)PBJq<Yb-Gl^BiRqaf,5=oU6pl&g!lMKY/W;-W=o:>%?@\t`PT_@NNSUM//U^7dnFB>]k,gsGT'8p>p-/_"t]4N`X)^SA/n>4O8[WK$DZi:"X[8@`0iGF;K/oBJDZ9tRQ^T20MuX/In(9BX/odV^W3rKV8qhu&C&.Ui@aH`nog^">K.8!\<CbO;jA8pD*MA_f>SZl<4uYB;@Nk0tuRbZQ^4Zl`RW%CQc6l9V>:g\X^LPnhTI(tXiC5P1&O>dih=]W7P0+tFD=.[%`'UfWeAOpP4=dVor(_H")Q=5iGu?005^2='PfY.j8J=(&-[];:<l9bJ,&#hDj."`%!AYQ@k@$<R<Z?sPjq69;_j@GTJ+k>`7n,`KdDas8\bkm\B&A4"hR1fT1/:_fus<N*KP<MaYXc)UX7DLX_9k$aN$,J&\><CpXd;FK$3aTS\ZBtt'X!@qO]XFPH\YU\Vu)St.eR@`EV"d+89V$UU:P#AMhgD3`r/kZfjOs20H@)CZo%(HJMi"k+">B%2tDAdYA`K1Sda):WQ;.YHi:?tGNSg5X.4ecbW9V!N#'S<B)'s>DR\-c<hmODkpY$"i\dtAg/Ar1e%#oi@`P/N$La-;XJaci0JKto3`"g?i!]RnbCo.$QBCOt*6.:L?"KM>*j=-Y$X,X&#FPY<*N9aZGQn-WL<.sM6$CZe\5cE7=W(ZpJ.6/"Y,KQRN)PJi,BKk(lkffCYd>!XZP"g+F4['#tNb0soB]CI].`JJ$#/^9_Q\FLn"+mCRiUL`Z"CJkGNJlhFK?GS.:>s#6[Hb1&@?()XK^4M2BZ*,oS9LsJ(`@./D2(]8Ei@B;0YOE:@Y2*0Q]NkoZ/kuj+,'5q+XHLMT,b>rMPKCr*@3P+I?GS.:"g?j,mCZ'Ym@*'X=+=PH)to%WGsV)l\>r8sj/sOC"]p_r\of,GA;.+H's^0W[EIir]<[S6Z`l&V$F><sVH>)o:D+>(*`=mgV@L0aKjZEIKrqQo[_gV'gWGqjlRK%F1W!Bq+pYQ6,V^J,-0:n4_Uc(NCk]!q't1t[fXc61"a>,!D']\<G9=2?le#JE2Yh5Y,q?c(\&BGM>B?a8_H-VhA(.Qi,aB[Mh<MIJrU<u4p8@NPg4a!]HUU%C"C_!=2A_5k-70un,]&]=]dZ\`!H,[^\,ePH#2F!L4!5Am3d=S.rtet1DeYBZ)9"mCOX)8!]qp+@9YE#Q$:.bW$=0>UFG6l5f<tDUW7J+S>o.&e<C*#%OfU<09Lr])D44.H_C$c8=Wo;+Krg@NZE@KaJDf0nF]6C[:nh/r=d&F?+,c5>K),#!I2T6r<l$7f"fl$RmAr(?41i![XCmel?e:;s#lD"fc\IkNRhp:0Qc#fjKD<PeD8,\(cFYa5L\!.0])1S''m`&lNLkFP?K+K&a,A18gZeADJ+r!>R/Z're+oUP&g(8R_^!@;&u7($?83Z%nS$eZO5XGIU386~>
+endstream
+endobj
+8 0 obj
+<< /Type /Page
+/Parent 1 0 R
+/MediaBox [ 0 0 595 842 ]
+/Resources 3 0 R
+/Contents 7 0 R
+>>
+endobj
+9 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F5
+/BaseFont /Times-Roman
+/Encoding /WinAnsiEncoding >>
+endobj
+10 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F7
+/BaseFont /Times-Bold
+/Encoding /WinAnsiEncoding >>
+endobj
+1 0 obj
+<< /Type /Pages
+/Count 2
+/Kids [6 0 R 8 0 R ] >>
+endobj
+2 0 obj
+<< /Type /Catalog
+/Pages 1 0 R
+ >>
+endobj
+3 0 obj
+<<
+/Font << /F5 9 0 R /F7 10 0 R >>
+/ProcSet [ /PDF /ImageC /Text ] >>
+endobj
+xref
+0 11
+0000000000 65535 f
+0000004058 00000 n
+0000004122 00000 n
+0000004172 00000 n
+0000000015 00000 n
+0000000071 00000 n
+0000001719 00000 n
+0000001825 00000 n
+0000003734 00000 n
+0000003840 00000 n
+0000003949 00000 n
+trailer
+<<
+/Size 11
+/Root 2 0 R
+/Info 4 0 R
+>>
+startxref
+4261
+%%EOF
diff --git a/src/documentation/content/xdocs/fo/embed.pdf b/src/documentation/content/xdocs/fo/embed.pdf
deleted file mode 100644
index 59dec7763..000000000
--- a/src/documentation/content/xdocs/fo/embed.pdf
+++ /dev/null
Binary files differ
diff --git a/src/documentation/content/xdocs/fo/fonts.fo b/src/documentation/content/xdocs/fo/fonts.fo
index 0c2646d05..12e176eba 100644
--- a/src/documentation/content/xdocs/fo/fonts.fo
+++ b/src/documentation/content/xdocs/fo/fonts.fo
@@ -18,32 +18,32 @@
<!-- $Id$ -->
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
-<!-- defines the layout master -->
-<fo:layout-master-set>
- <fo:simple-page-master
- master-name="first"
- page-height="29.7cm"
- page-width="21cm"
- margin-top="1cm"
- margin-bottom="2cm"
- margin-left="2.5cm"
- margin-right="2.5cm">
- <fo:region-body margin-top="1cm"/>
- <fo:region-before extent="1cm"/>
- <fo:region-after extent="1.5cm"/>
- </fo:simple-page-master>
-</fo:layout-master-set>
+ <!-- defines the layout master -->
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="first"
+ page-height="29.7cm"
+ page-width="21cm"
+ margin-top="1cm"
+ margin-bottom="2cm"
+ margin-left="2.5cm"
+ margin-right="2.5cm">
+ <fo:region-body margin-top="1cm"/>
+ <fo:region-before extent="1cm"/>
+ <fo:region-after extent="1.5cm"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+
+ <!-- starts actual layout -->
+ <fo:page-sequence master-reference="first">
-<!-- starts actual layout -->
-<fo:page-sequence master-reference="first">
<fo:flow flow-name="xsl-region-body">
-<fo:block font-family="Helvetica" font-size="14pt">
+ <fo:block font-family="Helvetica" font-size="14pt">
Helvetica
</fo:block>
-<fo:block space-after.optimum="10pt" font-family="Helvetica" font-size="10pt">
-<fo:table table-layout="fixed" width="100%">
+ <fo:block space-after.optimum="10pt" font-family="Helvetica" font-size="10pt">
+<fo:table>
<fo:table-column column-width="65pt"/>
<fo:table-column column-width="30pt"/>
<fo:table-column column-width="65pt"/>
@@ -303,7 +303,7 @@ Helvetica
Times Roman
</fo:block>
<fo:block space-after.optimum="10pt" font-family="Times Roman" font-size="10pt">
-<fo:table table-layout="fixed" width="100%">
+<fo:table>
<fo:table-column column-width="65pt"/>
<fo:table-column column-width="30pt"/>
<fo:table-column column-width="65pt"/>
@@ -563,7 +563,7 @@ Times Roman
Courier
</fo:block>
<fo:block space-after.optimum="10pt" font-family="Courier" font-size="10pt">
-<fo:table table-layout="fixed" width="100%">
+<fo:table>
<fo:table-column column-width="65pt"/>
<fo:table-column column-width="30pt"/>
<fo:table-column column-width="65pt"/>
@@ -823,7 +823,7 @@ Courier
ZapfDingbats:
</fo:block>
<fo:block space-after.optimum="10pt" font-family="ZapfDingbats" font-size="10pt">
-<fo:table table-layout="fixed" width="100%">
+<fo:table>
<fo:table-column column-width="65pt"/>
<fo:table-column column-width="30pt"/>
<fo:table-column column-width="65pt"/>
@@ -1071,7 +1071,7 @@ Courier
Symbol:
</fo:block>
<fo:block space-after.optimum="10pt" font-family="Symbol" font-size="10pt">
-<fo:table table-layout="fixed" width="100%">
+<fo:table>
<fo:table-column column-width="65pt"/>
<fo:table-column column-width="30pt"/>
<fo:table-column column-width="65pt"/>
diff --git a/src/documentation/content/xdocs/fo/fonts.fo.pdf b/src/documentation/content/xdocs/fo/fonts.fo.pdf
new file mode 100644
index 000000000..85a37fd0e
--- /dev/null
+++ b/src/documentation/content/xdocs/fo/fonts.fo.pdf
@@ -0,0 +1,160 @@
+%PDF-1.4
+%ª«¬­
+4 0 obj
+<< /Type /Info
+/Producer (FOP 0.20.5) >>
+endobj
+5 0 obj
+<< /Length 2756 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+Gas2O=aO+:'LgpN.p>dQQ0),tXf?8Xl8sh^A"4[?L]L?S.Yp(`G)J$07;CF[q0Xk,m[_:;p.hg?\%DUPMj%;2G1eG?n*DpXrcNRk=kqghM^JC4(9q#F6<M1iQEg+@rM.>kF&rk?5<4+=n+NmTMjoY'X2c"#Z%_Ip=kXFJF_B#_[H@&U`<@2^l+]E+l1pZ!Cop\)PH?hg\+B/,61.dsGk/JYH2/>>gUQl'^O&$qIgP0_PeXi&QbNt"`g=GeR$XG9Q\Vt!J+koUIg+m`>Q4&kH259:cpnuO)YE2Y+(Xr3H2XcdDe8Lq]_jXK4.1I\07P#'<[L&Tb:eD$aQ1Beq%DbJ9R`Fs?_!J[FZFa!bf^reYKF[C8A"tK/EcFDnJ:3"S@aEl4-6r5g`7ZS"h?/HmND$@jL1SjK>\"VRr[p,&g'EraP7s/X*K!&QFTB@f-"GBg`c-Q5TXJ(OS?p@pG-s6q\pYrAaYZS2aQkBmZ@1P5]10$OS?4MDT]N!OS<rahNW)"+n(nG\QbDAD^"QiaC@7)(@p=74Hso*+n#NSI6%$;nihZ</a(tWhC"DsEpbO?rEYLhR60L.$HS4N*V01Na;^O/jSeAVgob2UOSAK8*bFc$pCBM1AF>QR%mfVpmZ@1(5i0Z=+n$M*gm)sTOS;O9DTfS;aSVkX2s&gXjSdfFgoS]0HcZ(s+CCCTpQ5,tON2D0*qK<@aA)011uohL?]\T5a@"t%,e`]/LWFs6H3#3#RK&`J6:;k]J"?4`6lo6U"8'`(*b'V<5R'PD*eJm*oKktfP5c!UKo.u\s'*nZ('VeYGGH$-$5!2@U_b]lOT+]?04Yb>rjPHPBG;Th5Cd(n-pReQP$[&p5QTX`^!KW,!k:mL_4pu6n0@1ONrg$24jj]\"Xnnn82#W1TE'Ef]c^4'!k;$P@AEo!56AMb;Ln[0+MCTLJG_VW]jO`kr;T*0iM6bTs-<3X8eLXo)sN'@,38b9klm=rjSpt!Kp<kCs*)m!/4IY['@86]7EGKNU_d9nOT25S(LDu\s$'(.^_@slJ!"&n.74%6-G:O#K`(j;H=<ZVq>ZfR!_j9tru^KZRPp8B"5E*hD.fR'["/K0$b`fV$_aI-UbGs8SLn%O6#@a#a[0o_fg7*%"'J;5H>gtB6;ebYA$XIN>IG*3g-?jGL#1XkKb2dh:@6Wubr&]2<GgsRDE[B@P19c2R4N#)Pccp+c=B4fTnKhI=6S6$?J$t3QI?$nQ7R-Vfg7Z6"+OpHKaotE#\nMOQhDO.a?jR@_ls@dC:4]3l7hQjLRKfJ\N1.Gd%TkY'Y?C7H_@&^G]aksTOH.^_Hn7;4j[L`IWZM$5^T1-em[2Um=dl/LLH7N(Wp/,L-<sk.#N-ap5"&=1tH*f,OL0d=U0G<P6L?-10KB\&SWm4b<#!J8:.%@el,qOQN1P>E7Rrp\;']Dq5gL.E"22g,$Icji>UDXV6lij_DSh>!bsmkKkk?TPgt*F$eNa3.'E6m(TsIF:h&ai0:\`L:h]0o0@Hn"Z4Lp>W@sd8]hih:W@sd8]hj%@W@sd8]hj7FW@sdX]b#qaW@sd8]hj[RW@sd8]hjk2YV.QpKu2VqI:6hCPii8;$VPi?82jp`=P=.Z\cM]FdU"?S%G2J_p-RGM^qR%_(P6i5p4]?V:qRaO0-'A5in]-5iFjkYmfr+d7sgqS2dfuPg'bm3!W0a]?7=Y>fGBSA6Les/^2UFqMK]0rKql=X]Gn+/>1sA']+Oq73^.'^_7L<VU,kIt5Q;eYLj`,@+0pUYh2$JV*?VS@i8'3;;&paaL#CdCI8M",ZA%5mLj`,@+0pUYh2$JV*?TG?MK^<=7<O"!(4p`Tp-j+Oa;0AO,PFQKI)m(TG9cfMFaV7GJp/I5Kr;U\]Gn+/Wr#5n&A/se0<4n<[Lg*@YV3$R7CEc?S$4QGqo-iInSZ4XW9tJT6L\m0^8UH9fg>1G_S2u:(YM.EDSj,dmMFPCn8?+WW9tJT6L\m0^8UH9fg>1G_S2u:(YM.EDSj,dmMFPCn8?+WW9tH`$cT^aqkCZ/A.-5c$2^I.?XsP\]*\A/\mJtU_7L$NU:O]B$c0F]qkCZ/A.-5c`mBo4#I^A5Ca+Cr9^pb<]k#;5Jp<9KV]=,\K%hH1QV?oF>.oUFR4.3oYOU=J]l;.A!d_rkDd4#rAeRJDA:dmcl;_LU&_LmC)Fn&gG-Zt_?=WM*\ZH,`RgAN:`o*FfYa%ocq2u'@V(:?D-3AV;"@l]oF>a`t9."o3XZ1W>U>VA3n>KP3n$7eC?S]I^<&gID"TFPjDJTL;fgP<_RGc(c=28Y#lCM+ZK'J/Y9q:VXI>B>?d%2Wg-54TuF^`?<7e_R"'9mqY1/STV;<<,"NE$Zd-Fg>23A6jih%P+u5?.`Q"PFI+s'tZ2ioFb/G)!V!4POK$Y.#KpgV7rSpuo9+[>.8]*b5XST6W59[<2(ShO[$rp'3YX&jGo!9J#:K?4NTQ1JK:ZDI*gFH!C/Dh9N([,B'Wk<;UquIH&M:l7fE=&%pRn*TtuLH+3^sZV8W]GGf(pF_i,55<YL:F5&mJ>NtD*>T)>jdG.>hO64UG[SQ$do'7Ebd;9uLXlME+0!j:rQWqS4kAp0"8VX^&cbDBrp\]/_g\:X//F^Y+,M^#r5@]95q9'I6W/ag5ns;XcclT*uj'U*;K*"(#%KCI=*L+Xhqu+(VAY::H&:ETgJWBA$n<HcS3^TI0EoiL9NmK8R*;O-<,P9,m2nj=*,;dSX-baVo,F$B.$fAJ/pHP_$<5J~>
+endstream
+endobj
+6 0 obj
+<< /Type /Page
+/Parent 1 0 R
+/MediaBox [ 0 0 595 842 ]
+/Resources 3 0 R
+/Contents 5 0 R
+>>
+endobj
+7 0 obj
+<< /Length 2935 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+Gas2O=-jma'SPBB.u%SN_RLo"U`"2C^gpR<OtetcAE%Mt#"GslqY'^#I]5BohPsK0gZn=qd^@Wo9XjJ6B:iGoG+W(r].X%:]@cK]+m`ZsHPb]0m-EK^="`BQb8q_=\pMg#gP@?jrVt48.p$r`m*;b8p^g'q&b&j&msU$7gA(OFhY/=DCr>]H\8rsDC;V+n\@!W1DSmP!\1o:WBuBZFn%'.G[c,iln8L?&E7_MV*Pg^/KUXmT!'HLWF1)Oe!;E>VS86"__#%#PY&D4)J@e^%cF;aRi3lUU$Z1+g\1(G@@N-?hhNb*^i:oYYmZ440*#SY\n0k:=^HVkj+K>OY57DKaWWU"#!q9Mq#C_.:i(d5VIX_da<`B<QIiRCD<*^#`IfeP6WOa/K5.';IYuG!>INJT>-rnlOh^<r0;KY.tI0R27<S)l\(P)7Vl?_ss$?0(HXp;^+$#j+KXp;^+"`RD?Xp;^+%Id+l#CaGEL:a4Z%fH;7^^m/#nGBNlO.n])qf;c3U,qf@o)S5JFl<!1!:EJ0H1:]h!4Sfi4S\k$J=BGZ*rQ!m^q3Ke*rQ"0)fC_5l9+k?%,cn=FWUJ[Wk_?ubu3pp2t%;a9!no_]M!JueK0tH*oWqq#E[7.KU5j_5W^&!?@$_onU*lP.FnOLo+BrX=U1&7a+2cV*C)hJ#VY!p^k)"^iMBca3&*TC]X6u)8&f1pQ[0\1bkR^td]W`m)IF%^$?gquj%I6^_[^X%Hpr:ZfE(pM2;klP#OqaPKU7iB_#N:)?<VLTs*mO`WS%m]s#o>;B1MIk9u9QNNo9pZ#VSn6K)^<G]N"8(rr7iEd^:=ps(B,_foG"j?O/<%4+dKN&ROaG"TSKoGj3rpr;R_pV/Sros6kW-`Z;nqIh5p9G6IsG8U0LT&cDYFiMCW,i4j?fl[%\]TuD?Y$RQ3dd:<S5hZLAB;<XGq;b-p2^kdh6=#HC49)&Bm9GG(@aV7Xk#I%^4d$7>&O>9"M,85d6D)-eZnpr^,l#3;X;EiI5ep>i"'_;@,R4(TB>0[@lB;-MSBL*`UTSZ!X@7,D34eaQ\l69.t9cm4K6$8;=UoBERMkIZ&'N3LPe4!>BA.%Se,O-JQ/i&,[p(;EZ<>V&i>5O,eLoQA,+iSjt>t!+pG4uTS4&M(l[(_S4hhcr,TacI(#+$`/(L#fG-unFQ,@+uDTBI87*U,nkr']_(lUViGjsN2[>XuBP69ijXP2_HLUsi,((TnugBW[mT03h#Yct5L>?FZ#;U#g`t]PrUIU&BG7]PrUITbW'O]PrUITe1bg]PrUITgaI*]PrUITj</B]L[f2;+TN8-nh)6?"i8j-nh)6?"iJp0eY*B6@8`kH!s8\>5`*X$VS(Xp-3%n=OMm5!&Nbk-!f^C0OnEkdY3\^1ZjB[?-"9F@pW9cKh_\*k(P$ckThil?9$Ae:'*66Kd0me,VW_737<LU!]/tm,@0LY0OnEKdY1Et1ZjB9?0EOf@pV.EKhMOUk!`(Wcq.W]]VsuB9HfV8JpC5<WQqu^oa=Bm)JLs\9EGSoWu>\-KhMOU8uikE15/C'$VJUCZnd>/!XhWDX0aX99EGSobH&!*KhMOu8h6jI15/C'.nV=jZq_;r$*5PW5e><6@)\lhO=kVf=RddHU^N^r<]l8>;)_Fp,d?9*</nJW67.6uO.pC=bnMo>XEYFZUMcrj8RTN4W#Be7KhMOuk!_/mSg\[n=>;J/;)_Fp,d:`a<24?.O@`j!]Vn<U9HfV8MKr'Y\sYl3JJIdN)Kdii9ELcYf?NKe.e8uqAq<@%$d7gWcQk7TFGAYCVOn"A+nIrC_$+`,G"s;D&Tic9pkaYFXNgs*"P4gICm%A#.S(hp&?-"0-BYj31Iq?X=)3=[,*P<*Z,#%mb[qKU%;]ZR-WMhG,VgAc&mT9Tbrh32I#png='Q2>R7&BT7"X1.C?.F<k_tToE;s#,Gqt4M$&Je744WDX8RtRe,cK@1G0;-d.3oO*Cpbt>,VgmGs#<J6[I;3_1+aaaN.Pg)P=_i*etRAg@5O/b<NO/^GI7Ip,b6ENDB5W;+iW`rO@W3Qe`J6C*)s1b'/`2ZP!i0Ki<Pi"gM<kC-0+uG+oarT\p'C!_V"a8q5/([](u/]Ri-@mfD$)G:-[dJ5K3#^+a!Nmq!Xi!aT(6&:JkY`)n9b&mf[m`7IN-Rf7r/dnBUKNgq`eFr9cJu*;r'i%G\GOpAk,QIZ`AT(Y\B%!0;SYgci=%L>NC.1c:`hUH>jAo^.?(^#!Y!h%B/Gm=e,PlaICCB]J(+$^2&e^O:?:)\1b3R$:3Oqs^I@*59*?-L;8tLGu^$nEkqo_Z%&nG"Wbahd.;_hJAh>g.&uX(PfN0Rg8\+#1dJ_o&BAS@e8@pfUY4=LjQm^C_#6\05i.Q4?2I\_FrU-YfuEdQalSDR5YC)H/l^sDZX5Ia+J$],.o1]#Lg=[G_mCNXuS]o!XTkX^7i0<)EJpu6[)HdF?EZ\m\Xaa">CAB:"@l&?lutLWjreY5]eqbK."H[8U")ZGljM&F>['m-bt"!2cD#L!k9=*VO$0S_#/L32(s;&Hj7sS\ZN<(R6pIW!;RoJ>'t)gNM+(.>AY`DKr!'$,"r]XpspQ+6&1;K?AN81N?H2.5qbV_N^f+?U7`;H)Fu)Dnq)cZRRnaFnq)cZ)G;;Go7Dl[RS4sV3PL<EiA=H-j,5mc:EpiU(L4o+L`562]&4cmUsqr5']6fjTGldV]&4KeACZKE_7+C+\/I(PE&4JM[?/@4FU'[#87F/]0j!1^bS64B$X(\RG9A\q,h>9tF4D;P'87da65FXm*QUntM7&Ga>]g9,;b1@LA2.0AJ]ngk=:88j?PmNe/S$Sb@Ao$jON7-MTdJ>W-K>nsRTKs.N*dE:@P)+HIUT13[F12]0+9/3<]ZB=IA%q;8d@,d/sO:X0eE*:@@:4JAjnnDQa9>7"16kd=o~>
+endstream
+endobj
+8 0 obj
+<< /Type /Page
+/Parent 1 0 R
+/MediaBox [ 0 0 595 842 ]
+/Resources 3 0 R
+/Contents 7 0 R
+>>
+endobj
+9 0 obj
+<< /Length 3803 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+Gat=/BpTgY&cAe=0fD3@gQ_!gWbr-%H[Bq?nSK$`Y[E-$#ltYUY`6udmM]f;-7cEtQ,Vbc]Vh).W&c.ZU3c[qlIOe/ZuagNh:9DIG5(3dgY).YgLY0?P]f'"1YKFQHEqn\p30j>.YR\CFtY4iXLN]Ir1DrnmbQ^L)koHS`^WiIf?5Be+%G9[;Eh1K&"l%F-?rF[f#n^T&#4u<Piq`1%*JN^&j<gG]mKtEDD[b&h6^KPJT<i@OWN>k?@Hh+4AD$Eo]RpYbO:)SEAEOqh6LAd$7O5a$2!HTlfG=%nhcb*O7%&%r.gqmR*7gVm]^$s)CUZ1alMZ[>qc3i-kB8P2^rt:jYJA>InG_RqXsCe;!tH*jQIf7qZ=p`..QB^,1-3.Pa=Uoo]Uh^0A"C&adRc%*ROZaP`OC+H?;F@YClE+^Zj,H^&Jq6-Yk&TF?o:Z!TeqiNZK4fq\u1j3ofJP!PSLIPQthF4Z]81T7M%ObWq4!kl'\;gc:S^d/gr\!gHo%7XB/An%W*\O-;@53P#7TrE#Y>oZ!#g)h?dp%Ec"9SfHPdo_oe+T"GBjkQ[^S2aR8tbs7;,!.)B]jjBPcNt1CP/QV;fYj+srOPGViT%T;12"qj;1OkR<kWV?+bb-5S\rT]OF!q@9mLrRG/4ouTH\1ON7nGsj:Jj82.1%Ek;c(eG8d<`@%+R/'P(E?+MX$U*aZt6GUO$NO1/QjEW1H#7%-7./Wb5?Y"9&0-eMFCl_8?.4XDc?U"rm:YW1LPb%.sQ7Wb6K$"9&65eMFt'Jc>ZQlFC?F5l^jRous[OT`>%bH=g;8d/SSm4nC3Bkl6.2Ssbl^kjR4qLEMt(R=PJKKLZTt]Z`Wp"bOeM$Gd.p%"q_*Ggri,bf%^jMZn^Qh$UuWbREQ7+F)s16#\V9"%<t2*d]C?1Ggm!jg?0]JmbHf#.c>sW%YZcR=R1&"R6A4DJ#Qe!eL3")k7cOZp=,pn7hh*AcY!]3`pj$'nY,/"j&;tI[h.)3Lp>q/6I@k'nVjE"j&;tI[h.)q4.]2/6I.ebjm;UB#/MU<=%`5(*p4o\]cN+1Hl20=`G5XJpX*naXfF$(Yo!@87o]3^>KK75r&fXo`[9?$^+Y3W%YXk>*-s[6[ceQciR6VJO"Y"h9Z53@=^[l_%"cn$upiKIDJ%n*mP-(qh!Lq4e*<0p'#M,HT3Z@l3hKip2F>_e/-m^mGY_IW%YYLg;A3p;.":/["n7iUV>YUBb0B\7t&45dN6\lJGOj:V*1=b!VHUT8p`NN!pg;,PkK'&"P=O7..-!+#cKDd;;/p5&PuhRUU5gJ,+u[.7VNCr76l:;NRB,C(D6<D2bKEU?3hKW+dc-<K_%O_pb8dV"s'@7'7V2@Jf1Be<,1DgUd?c1FFZtXr/"AYAs<d%WL5u5$Gh\L!@ftu-W2+T;*$t=B)"c];*$t=B!0Vj_2QeC.Q):DSfkO?3^BNRe/-mg*M?:dl3hKo%T',Bo`[9HetL:DCG1'1"^tH2JAAZFL0k*mB$%W;VM5o$YC\I?<'Xjh(X(_FdMaIuclGp`JHs@L;ZT0Iie;NU+NuYW&C`"4bju1YCm/uTI)I3TSNs])Z6&Em06VaI@FiP)#Q$pAQ3tLQ;ZVFc,Jpri&8%OA#^jS-O&cg(TF(t;;\4trJhRR45iAbrLqsgZRA^/gT8kV6'nk8=!WkGa=PF2"N)Th/*@p]&"^tH3r5IVC&97IJ_Tc$\JYPI5iX3Qh;uqR(&RN/&0LJi*i$Fi%+K-F,;AH1jnVB5lS#QMk4&uLE$GpUZ!J)7Agi<Q)hMh)7*Br+jr9k]^c:.?kG=DG3?eO[h*1l3(rSY#;qo;JSIIQ1<0CI4k]36/NTp`2MgLm):o6Bm,E^GQ`_A1J:JRNpn_)V^`L5+0$F&Is8.QC'C;U\N'6T6C3GY,_S#&T_GcIgB50tsLB/7(9a##4ehcWLt!0tsdJ%,&/;r&n!Qhm:-qE;IBZ[c,HdS.t"q$;MD]QlF>US!.;dhc>hB2F+U>\k+?jopln_qVla_UKuq5HFp,lpn!)D?oPM>\aIa[0YXaK9\G)B&hSFT@%:^D5>Z<b/We^Y[.!.Q(b[C!A(_jh,jITuMI@3hA]rKB>W<6WSCTHS]*cgr4N:tG3SQ'M#/_oMm::T#M-TcZD(sb'3SfqEcqGY8]g3SGYM^B*1Gsg+F`5V2,:GNm1r2&>h&E`;L^MF:2B*I)h9aD<0a7eo8Q3'c6`tcg2Af$%)5\`!(XDFXg0eFpVp?\KF3&KBcj!uZE4XQS2&4F)"km?X$;MPbd*A>qGMY4p$7A(6k-h]pG->]hEW=":@nH.V&F*Sn']PAo1T&9iFp)rk:($OV#34qa#;RD*p"8l4D+$X8;aW#I;Gb]Q8kLh@1o)<>"ngfSU_Mi@%B7E>5s>#n.E2(aL6RIh*7UaeP#@7rBh1Zb$L6;G8L_[J25DEC"nhAcU_Mi")H)]]JpR9=Q_.neMXe-0<90jJSq!#i@_AHY'fd]Joa(2-I.$)F`q?`oPp`CJe75_g;N,fWU`q8lFbD`FDhISOL/_][T["*=dUsGL@f0(j.`,(_LPV.+)N=DJU`qBZFc*,n']Xb!<5bW3NY.P@@XOgl'mV6O0@U3d:C9u;Qt#eVD(tsj+Vfh_Ft_>Lj"D<K&Xd,&6>\CtC.Ld*MVSZJ_0Db!'qm("0@U3d6Og"c9sK&=2AhK4U`q_9mY0A&I&%o#\LD\Te-=rC%4Mf__pU:/8!>pP-ONb6S7;4RV%?E:PWUu9F2s/`I^TsMWIe#YVqA[T.E&,'Pc#THam>8A@j/@IQV6C@nsd9S5,G&]0pS)7OIt*Bo'uo`g9I-6@Z]L-Dt<H1Q'-I@<*kGJI`0"C.pb+[FW4CgMEu^e^WFZo<;[ZI'SCccYfY);<(q%j<d?,`iSD'cXLpYl`ME3AQ+)&/jG0iV_TL%X<W!arC>M,L6).d!X("u=[1dHtWsZ.eQNsSDYG2;sn7qSGZ;p7`)\#9qe`^)QX4TY/)iVY7dB?)C0r^^JjeWfJ=/0+7Z=6_$\&q>u$Elq612#_Jk=[N:Y=?8^C?>HX9/-dW7_^]qjmM<d?sNT1dB<s`\bl1\(kl%d?^\I1g7JUoF59VH$Elq613R6:7Ba?<U[W$j/!F%8?[Egfd*XR,(kl%d?Q$S`g8S.[MG\UUqN^k,X7*df3E(mRX3n,0?s2mMO1\!/hI%%(Q%$^<X0LDd2&PCYat6p3`5Z\A73Tb8QWpQN2:gDsXsaGK@WRH-`3HT%>#>RrOlmYKl)0:lO\P*I)=>T$/FmN'-EhZf25qs6Zo>Jc9d2ZKca:eEhJ#^L$!DPC7!AP8C6M`3esb)%o([:Oj.pE'g%igj9j[@%CJmsLb1e2IoB0/D]]/&(Un3\@S=;oir^L[e=1mFZe._DoH^p17,!1;,[E0q*ETo,qlJK'BAEU/42L38GY$!n3.rUWmcC^28n]DYRZ[,06GhYW0rpFTd=1mgeeRPoU2MitQNIL!DY$%;\.rUWm6Ib4#^@7TA$+07]M(D&SIcWYp=e/A=Dj/7/eEBuJp6sM<V=HO$/8X/S<aLp0Ap$G>]M0RXRl?"c=!Y)^A,kET2Miu$h@Q9'AKmU*p?uZmk(tX*h@N^oOiZ[FrHlH:,dOY"6WeV&,+C[fD`M1N'3Wu#+fr=#Oj+pDpP-.KA7>(aYk!Z>2L"NFRr`H[=kLA1XLoa>boQ\*>Y/I7o7jL?MF;X8]a*:[(,g*r.^)BR(YsGB9k7](VQTKI7!?tk#?`8*]W"!_MF;X8]a!4Z[WtYm@MOadU3d3TM/;dLmeg?H94Sjp/$M`YooAJ2lIPt9%SlFX~>
+endstream
+endobj
+10 0 obj
+<< /Type /Page
+/Parent 1 0 R
+/MediaBox [ 0 0 595 842 ]
+/Resources 3 0 R
+/Contents 9 0 R
+>>
+endobj
+11 0 obj
+<< /Length 3625 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+Gat=pl'!AO&]MNR?dW8Ah#PVEWCj1r\[H]o!-@0DJ8h!q!>kkWF(9:im::-ZV))$pbtDN\D8a(oQWhOZ:F5](rlJr"nIVTP*U\FKA3.Bt,T\</(CtWqCFP$BQ`t?"E<!c5mAHS'jeGf8m2O@]YGSnZh`Q>cg#8L>rL7GbR:UPuQr7%f``GA"MrkOnAsl"=ML"An:6X*#._o:eW*(n)KJR,*(SgLXJ2tX]-cM$^VUTi#0[gg"WgLoQPT!&B)/E>e`QW4se9D!JV\2m,bh:7*)E3^5b;P,e<QrG*<#W4GF%p(I'XP<;;WA6peeiF*bj&e4NNWH.AICrXTecGa<bd!a@*YRMl;63i9W@PVJ=0&tFWGerXg^p_9n8YoYj+8kF>Kc5[fC$a+mM,\!b]s=7\fKjJ2tTQkW3hGAkJ'O4O.3_/Sr!.\bi;Qpb'?-mA0'0]72;imfCX16;_kR]DJMSpccJuQ8#:!Phl::C&@s=c8fFsLU+OA.ZGM[R'A1_'=P]/Rprob1TBn7"PUAi"Wgs(8rZ%Yd)LelnF/24CA\s#=s(0m*RK-&\5M??#h0ctjTl[<'Xs0edJ,3n[8(O`!P=%"f9[4KC&AEk2HFX65YGn3rXM140=KZO*bBh!V=>'!g6f-VoffA'p]uF/DJXl0$:CZ0`sC2KZ+@_/AR@2bj.?UanRDsn;]$uAre3TV6aeu*l#e1ANIN2"`fVjW;dlWSp^[FC/D1)/'cp\\nQuFQGd?>s1.pSkjp5p1?WPsA7VNDm+l(),'fZRW=)&:*,M^;2'fZ^[=)&:j7_"FJ.r]B9Y1+T^JoD[$<npD>Bb7`^\<KKF<c*Q23QKcU[8WYdj36;uXf_(P1KS<&G;RUhD%,/+O#(jR#'$>VDYD@V\A'h$C(Riugh-S&Kj-Z\V8at)$/mdhBIhm"R4C.N40"LgD9U`A2u4MtqnH$]\>)*qF5+C8(%1`V=(r4i<%"*g=L])`pGlRS#c%ZEOnIJ?\/"H,b`s*b7FlBmjAreTo/KAPiZd]tol;Rq7rd[_pF)71EKTqKg:7ZQdec(')Q0*ep"MO=%JDg+Po@S0eo,?h2V@1H=)&9_>/-'#gL-Yk>ik9l6Ip)@lS`tee\3X`AGnF#0)EUkqmr;Zp"T8QpjYE0noZr9laQD,EHD!dmH^]k+l()hD=7D(I9k-nop_<)(>KMq)tR%`pRimS=pVV-F[u4PRB(aAKq>dDF[t)&0N\._3iZ9*D1(.Op)EV1L/Jst=%Dq@\W*dS_L@-Jg=OkP]jbm>lgSc,H+IkqC0t%4onp;>Y<0UMK=T^fePX$6\ZN%s_L>u:BB/=CW*V41pq"*1(@M'4DX6W:cp'><pq"*1`pp]GW7CaU1s@Dm285*B([f'9]ZSj&ToWcfnTFK:pq3@$T^H<;>oMikjr.Ss>Xs4>H"AjhMpt>alY)es?cV3.HsIZQ,N]nO8'gM"=4__oHsIZY1GIGU3oW3sd<1uPIbf[Y,O=ZO$g351odVlsFi3"Z>iY.+lf^j*EAm]:'@I\uY9U3Fs'E^um+4tQ]X#83\9L6LY$\MB2r$o4Y46YANaNs@Y9UA\2pB%\bqW0tYARe+c<R>7>kS'@qJZ)ZaCLFaFh.Fl>9A@amYC8G55;M:^RDVGAed'Bri!B`(-V]<@MD!0&8NT8/;TiD1*B2C<rc^':FLia-WUY3;W4q^ENV?#F>bfX7&9kpF4-r";aL^WWGm.j+NYj?l/t.YA:TmOVe6!MU<b6iI&B7nKHpY<'u'/s0s<G[C#V4NlX=7^7cB7*Z)3VYIIEQ8r\H$X!"bKsNI.Q455[j8aXFe+&Eab%W&hVE4oM@T'LlAP-`.fVW&hV%4ThEX)#9)\)!M]kWma&Z1E];D;5_)?doO@3W_R_=<i%M@'K_H:MmVWWdpNDKWA&@N40d-['LaC]CUm=[p%+`aS@=4Vd9Xq\_C0]r6jaBmW&_C%3sJ*P0ZnQ#0u^ARRZlR`6Rf):Ob1;(hq?gJPf!,R0lE-OOW\g@GJC:1"i+?]>/Db)Nk8LEKf9!@Thd(PNk8LEKeEJF\V)GJ:+)J@Lf33T!7BHbm-]p,!Ot6YL0SS#Ap8`($Gb2S89)(qRaX?_1jDKhnFkn\Q#`ED3PDabrNB'*]^n+d`_](>=kl@o"b&YnmADmZd$aG/Q^m[3%9eWm@s%:5TdK(:'WsL[o1s'X)P^g3$oN$[T^_S^W72ZTK4h,S49U@RcPa<+UG4e8cVP:$#R\m^L.[HQ8U,uYfL&KF!qGbPNLq=i'7:&mYF+qJXiY78cJS(eRsh13*;8XoP:DR>!ITWjpd7m1W\[Uh+K+18![9&ZSJ`n7hEmk^";)?VcO?'WpB]:0+G.H?R\<X>7gRU4+bIQXR\<VhFJEZ-g,)2ofLPC,V(oP*aA<P+#RXdML.[Gt,#FJ[VL3J=)5Zjr"DVBX6/d@;:oWt;!]A)UT^Hs&1u:Tm-6*WI]hXj4Y7RYS7g*t<;l0#"!,<_k6/Cj+Bcoq8D+Z"NH^uXGh]bl1PR-P\Vb.'%M.Eq*5oga5$C)OE6_GbY&_(5T=#+;Uj7`i/,US+(/Edfu2;Uir-8Z=ai<E@eT17iO!7^'V@QM`kj[#^GE]_<0-UKkqi5P=\M%9j4rJ4GEQ=u`G&pQSaeV'hjNqtQ`^+5qbl/kTt;]`XkB!-Pl'I-j(Qn(%MM]=TjhAaE>Vl6pfC/PacOe\2dgS9S>Z/Xr3)F$]apAIk,2ffk:hB:q=q$Q9<QUnB*??a2M)Q0qbPIYt('RT"cqcos`>i\"[o0TF'Nc`(%)T5(iF#L4e@dgttJ1EL5Mk&t;\Z1..Fhj7\`'kHFNE.LfQL2>0RqQr=D]7T'FHtjF@m47WL=/'CN6GoRY__V4cPNb4+>,FAD8md&@m481;M2L#I'tbf\;pB4j[p!A,2]Ru>/YR-k:9VK&/Ub\2Jf3H\a-'>pbW%0@>gfH@\knVWBagna]l]+(Fu?P)$"FC(.$as:hbG=h/)-rY.NL?NR9Bs1"8TDK#0O/Ti)!*Y$t<GESXqrBn4ftD"&W$SG&>NNe(WjO_j_8/tBWK2P`/nO$HG5+t+F'c4>9YT2llg>nn$fB]ZiXQ'=8iiD&6+DGI277T=SkOqOr.OSb`g-@o#!6^dQ<_!A$k/eKkj-EskoFcj3qJO,(HRfo%'Q_"FeS\TuH2484n=R'0U*cQ6'K+<l!#qYa%*tPmH"Q/uP/9>Y69>*u""0Mr=d.>s&7S_=T<?Z1+WI<qf+Y;U@5L,UWRWhq"6_H>gV&(cJ98BY_f_B%tF);!%]jIH!&$er<\KHg/8RNE#<m4g6^iD^f<Kk3RIO:>j.Y6^?07P\--Eu;&KtY<udKuutga7S(0-&cjNi,HV1NJ,A8RSC)kESeMPYVjn9jjgl9.'hE8mo$#&?\`8V>#lm"0P7(Bn=!*S%qYb(In[7WBjeQq_]P`Y4QUh4?TgQIH1"A9l&m[&4TpFI,;`Q)3%.(QLA(J_h\\)k+-:.f^OVSF%m.V>Ar>G6#$5uJXRQJ:rfBC6<+Lgco"Oe_hdXBpfFW@@0sNBBlb,2iV^`$S\p1HbJ[YL_hdV\6s$P@+>0sUC_S+s].'*q2LJT4F%m>nXCD]FYU55Nhl_fF7"o!8lml.0&9Vms\+`\t#E)-F\G~>
+endstream
+endobj
+12 0 obj
+<< /Type /Page
+/Parent 1 0 R
+/MediaBox [ 0 0 595 842 ]
+/Resources 3 0 R
+/Contents 11 0 R
+>>
+endobj
+13 0 obj
+<< /Length 1495 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+Gat%e6#YO:&4Z-f'`nFNG*'!T7j=r);VSgQ,.A\Q*a85ECc>(H)@>c+9oufu4l[f^3$X(O#[b5&oKA>r%%k$GqigJlY&i1HDZA_7G/'ZZcLR%^U,=BQ0#lc#0m<H[m[)C@*kVlMn'AR`I8#%-l/T,<f5CW\/q\2c*8m>CdA_d(b8%&cB&YK_)\unqBH]F-n,X[*I"tZ40:U!a-N"5_4l;qbM!_NP-N")[*LSW7`:J^<HBZ!6R#(+\Tj^W,lkel>D1.Wm@IaGM-GE8W5[?1Q9OOe$THT_f$L#hF/JG8fi]nh"$ZQhaQ]Obr@J0\cpa5q@h).I"$!&?G4sCNePDM^9Z>T:gf(85tPqi(u!*G^a/GbI)&RS*c[`g`23cc/62G#TlLFP&3!%)>K/""i1/2NjtbWmLC_8H^nAsO<=JCu:`HGL$7bVJ3kJ4Y-L:,)3qR@.X+Nr[WT1F0e1c-.s'=bZ+WE3CTj\qGFDGL7[6)6XXN1'NEL'q1h-`XMuLZG9;H6o23op^)L$?XP9eUD[6Ig`fRk$k2NmTk24_!32<8Tl=Y3Td&MK!`dCY:q/AnBUSAlJLY5=.,5as[*1KP:h:(EKptGaQ5T-'W3QV^Nm5p+iu\E(XarCTbs>l&7A)/DfJGMlOhn%qZd5&Op4c:_eVK/K&a2h,2U,5H1B'b9arJ(e%5T!Tk.osq&[&DEju*W+XR1Sp[jKmuWsljLC*.A^_(3YQ>\+MkD:ijFg*1d5CKu=r]2p7?Y8!3om^'T_N/%[<M$-2lEMtf[WJl[]m0t:]PtNeI4p\[YY$?Q+GsJl3-^_M_*cII_M[JGnU[[-XQC&bs4GN@5(W`#FV1Q8&Mb9R/&CoKTjsmQB0"fqNXuM@_6Ae=7"`rW32fm0$M/9:cB!/EIju1hR4I%#o4^TKPb_6Q:1KPPi&Cdeg@sCeR+m4+d-PI.[<Kb0tpb6XS)C"3k!3-LGF2bTu<Fl#X5a>b3[(1WR#&h)+E4'6G5FT,\1*Y."<g)DDm&ZVU,Qh2i/'7:SGo^\BJEC!-#&dkn>U:7F/e.QI<p\6MhKO<.RXS3R'+M?5Q+>$nQj`Ap]tN0M<h;%qelCi^cX?1DKhG!a"q@t_Q+>$nG%h35;/`6";0rKVd.:8/_-FL1108eA:m:R?X$)*GYcQ/UjV^G1X"mb%#'43UcWo]P6d8so=*Y!kiP(GbdPHWHB4S19%-GET,BK\o<58CQ>lF=cg;,FnRB&FPRV1_"b_?!QF+n7'oqaTgQ"_oghL@=_*+r+@$_NifAV7Ot^Wp)H_-Ed3C>WDOm&tK&PeKH6rASe_D_N"$f?=uD5ul7Q>icpKKh_-eIRMmKW-YD)\]QjugT^^,i<nJ8M"F:+)pE0QIm;2an-t8LI_EDVb;V3TfULC&c^-bDFa[MV\$(jJ5Hauhrc!+-F`V\MF1f&Smm`'YB4qe0^:eg">W\K/^]/I>/0EO>qa\iMQcF<n#B.pAVmFE4MRRYdDYGM#!>>4h*r~>
+endstream
+endobj
+14 0 obj
+<< /Type /Page
+/Parent 1 0 R
+/MediaBox [ 0 0 595 842 ]
+/Resources 3 0 R
+/Contents 13 0 R
+>>
+endobj
+15 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F14
+/BaseFont /ZapfDingbats >>
+endobj
+16 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F5
+/BaseFont /Times-Roman
+/Encoding /WinAnsiEncoding >>
+endobj
+17 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F13
+/BaseFont /Symbol >>
+endobj
+18 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F1
+/BaseFont /Helvetica
+/Encoding /WinAnsiEncoding >>
+endobj
+19 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F9
+/BaseFont /Courier
+/Encoding /WinAnsiEncoding >>
+endobj
+1 0 obj
+<< /Type /Pages
+/Count 5
+/Kids [6 0 R 8 0 R 10 0 R 12 0 R 14 0 R ] >>
+endobj
+2 0 obj
+<< /Type /Catalog
+/Pages 1 0 R
+ >>
+endobj
+3 0 obj
+<<
+/Font << /F5 16 0 R /F14 15 0 R /F13 17 0 R /F1 18 0 R /F9 19 0 R >>
+/ProcSet [ /PDF /ImageB /ImageC /Text ] >>
+endobj
+xref
+0 20
+0000000000 65535 f
+0000016170 00000 n
+0000016255 00000 n
+0000016305 00000 n
+0000000015 00000 n
+0000000071 00000 n
+0000002919 00000 n
+0000003025 00000 n
+0000006052 00000 n
+0000006158 00000 n
+0000010053 00000 n
+0000010160 00000 n
+0000013878 00000 n
+0000013986 00000 n
+0000015574 00000 n
+0000015682 00000 n
+0000015767 00000 n
+0000015877 00000 n
+0000015956 00000 n
+0000016064 00000 n
+trailer
+<<
+/Size 20
+/Root 2 0 R
+/Info 4 0 R
+>>
+startxref
+16438
+%%EOF
diff --git a/src/documentation/content/xdocs/fo/fonts.pdf b/src/documentation/content/xdocs/fo/fonts.pdf
deleted file mode 100644
index 5c84a41b2..000000000
--- a/src/documentation/content/xdocs/fo/fonts.pdf
+++ /dev/null
Binary files differ
diff --git a/src/documentation/content/xdocs/fo/size.fo b/src/documentation/content/xdocs/fo/size.fo
index 1de6b0245..225adb491 100644
--- a/src/documentation/content/xdocs/fo/size.fo
+++ b/src/documentation/content/xdocs/fo/size.fo
@@ -19,18 +19,19 @@
<fo:root font-family="Times Roman" font-size="12pt" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
- <fo:simple-page-master
- margin-right="1.5cm"
- margin-left="1.5cm"
- margin-bottom="2cm"
- margin-top="1cm"
- page-width="21cm"
- page-height="29.7cm"
- master-name="left">
- <fo:region-body margin-top="0.5cm" margin-bottom="1.7cm"/>
- <fo:region-before extent="0.5cm"/>
- <fo:region-after extent="1.5cm"/>
- </fo:simple-page-master>
+ <fo:simple-page-master
+ margin-right="1.5cm"
+ margin-left="1.5cm"
+ margin-bottom="2cm"
+ margin-top="1cm"
+ page-width="21cm"
+ page-height="29.7cm"
+ master-name="left">
+ <fo:region-before extent="0.5cm"/>
+ <fo:region-body margin-top="0.5cm" margin-bottom="1.7cm"/>
+ <fo:region-after extent="1.5cm"/>
+ </fo:simple-page-master>
+
</fo:layout-master-set>
<fo:page-sequence id="N2528" master-reference="left">
diff --git a/src/documentation/content/xdocs/fo/size.fo.pdf b/src/documentation/content/xdocs/fo/size.fo.pdf
new file mode 100644
index 000000000..177160580
--- /dev/null
+++ b/src/documentation/content/xdocs/fo/size.fo.pdf
Binary files differ
diff --git a/src/documentation/content/xdocs/fo/size.pdf b/src/documentation/content/xdocs/fo/size.pdf
deleted file mode 100644
index add8fe871..000000000
--- a/src/documentation/content/xdocs/fo/size.pdf
+++ /dev/null
Binary files differ
diff --git a/src/documentation/content/xdocs/index.xml b/src/documentation/content/xdocs/index.xml
index 8a95934e3..0b05b6e2b 100644
--- a/src/documentation/content/xdocs/index.xml
+++ b/src/documentation/content/xdocs/index.xml
@@ -17,6 +17,7 @@
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "http://forrest.apache.org/dtd/document-v13.dtd">
+
<document>
<header>
<title>Apacheâ„¢ FOP</title>
@@ -25,22 +26,25 @@
<body>
<section id="intro">
<title>Introduction</title>
- <p>
- Apacheâ„¢ FOP (Formatting Objects Processor) is a print formatter driven by XSL
+ <p>Apacheâ„¢ FOP (Formatting Objects Processor) is a print formatter driven by XSL
formatting objects (XSL-FO) and an output independent formatter. It is a Java
application that reads a formatting object (FO) tree and renders the resulting
- pages to a specified output. <link href="1.1rc1/output.html">Output formats</link>
+ pages to a specified output. <link href="1.0/output.html">Output formats</link>
currently supported include PDF, PS, PCL, AFP, XML (area tree representation),
Print, AWT and PNG, and to a lesser extent, RTF and TXT. The primary output target is PDF.
</p>
- <p>
- The Apacheâ„¢ FOP project is part of the <link href="http://www.apache.org">Apacheâ„¢</link>
- Software Foundation, which is a wider community of users and developers of open source projects.
- </p>
- <figure width="480" height="260" src="images/document.jpg" alt="Render Diagram" />
- <p>
- A release candidate (rc1) of the latest version of FOP is available at <link href="1.1rc1/">FOP 1.1rc1</link>.
+ <p>The Apacheâ„¢ FOP project is part of the <a href="http://www.apache.org">Apacheâ„¢</a>
+ Software Foundation, which is a wider community of users and developers of open
+ source projects.
</p>
+ <figure width="480" height="260" src="images/document.jpg" alt="Render Diagram" />
+ <p>
+ A stable release of the latest version of FOP (<link href="1.0/">1.0</link>) is
+ available. It's the third
+ stable release after the large redesign effort and implements a large subset of the
+ <link href="http://www.w3.org/TR/xsl11/">XSL-FO Version 1.1 W3C
+ Recommendation</link>.
+ </p>
<p>
Support for each of the standard's objects and properties is detailed in <link href="compliance.html">FOP Compliance</link>.
<link href="download.html">Download</link> options include a precompiled version, source code, and many example files to get you started. <link href="resources.html">Resources</link> include links to XSL-FO introductions and many other useful references. A checklist for <link href="gethelp.html">Getting Help</link> will guide you toward maximizing the usefulness of FOP.
diff --git a/src/documentation/content/xdocs/knownissues.xml b/src/documentation/content/xdocs/knownissues.xml
index d916f0171..7c63fb69d 100644
--- a/src/documentation/content/xdocs/knownissues.xml
+++ b/src/documentation/content/xdocs/knownissues.xml
@@ -16,14 +16,7 @@
limitations under the License.
-->
<!-- $Id$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "http://forrest.apache.org/dtd/document-v13.dtd" [
-<!ATTLIST document
- xmlns:xi CDATA #IMPLIED>
-<!ELEMENT xi:include EMPTY>
-<!ATTLIST xi:include
- href CDATA #IMPLIED>
-<!ENTITY % local.sections "|xi:include">
-]>
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<title>Apacheâ„¢ FOP: Known Issues</title>
@@ -37,25 +30,27 @@
from data in FOP's code repository (Trunk) and may not exactly represent the list of issues in
the latest release.
</p>
+ <note>
+ <p>
+ For additional information on known issues in Apache FOP, please have a look at the following pages, too:
+ </p>
+ <ul>
+ <li><a href="bugs.html">the bug list in Bugzilla</a></li>
+ <li><a href="http://wiki.apache.org/xmlgraphics-fop/FOPProjectTasks">the task list in the Wiki</a></li>
+ </ul>
+ </note>
<p>
Apacheâ„¢ FOP has an extensive automated testing infrastructure. Parts of this infrastructure are several
sets of test cases. When a test case is listed in disabled-testcases.xml it is disabled in the JUnit
tests during the normal build process. This indicates a problem in the current codebase. When a bug is
fixed or a missing feature is added the entry for the relevant test case(s) are removed.
</p>
- <p>
- For additional information on known issues in Apache FOP, please have a look at the following pages, too:
- </p>
- <ul>
- <li><link href="bugs.html">the bug list in Bugzilla</link></li>
- <li><link href="http://wiki.apache.org/xmlgraphics-fop/FOPProjectTasks">the task list in the Wiki</link></li>
- </ul>
<section>
<title>FO Tree</title>
<p>
This section lists currently disabled test cases in the test suite for the FO tree tests.
The data for this section comes from
- <link href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/test/fotree/disabled-testcases.xml">test/fotree/disabled-testcases.xml</link>.
+ <a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/test/fotree/disabled-testcases.xml">test/fotree/disabled-testcases.xml</a>.
</p>
<xi:include href="cocoon://knownissues-raw-fotree.xml#xpointer(/document/body/*)"/>
</section>
@@ -64,7 +59,7 @@
<p>
This section lists currently disabled test cases in the test suite for the layout engine tests.
The data for this section comes from
- <link href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/test/layoutengine/disabled-testcases.xml">test/layoutengine/disabled-testcases.xml</link>.
+ <a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/test/layoutengine/disabled-testcases.xml">test/layoutengine/disabled-testcases.xml</a>.
</p>
<xi:include href="cocoon://knownissues-raw-layoutengine.xml#xpointer(/document/body/*)"/>
</section>
diff --git a/src/documentation/content/xdocs/license.xml b/src/documentation/content/xdocs/license.xml
index 95e8b455a..b3b552a84 100644
--- a/src/documentation/content/xdocs/license.xml
+++ b/src/documentation/content/xdocs/license.xml
@@ -17,6 +17,7 @@
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "http://forrest.apache.org/dtd/document-v13.dtd">
+
<document>
<header>
<title>Apacheâ„¢ FOP License</title>
@@ -27,7 +28,7 @@
<title>License</title>
<p>
All new Apacheâ„¢ FOP releases will be licensed under the <strong>Apacheâ„¢ License, version 2.0</strong>.
- Releases up through version 0.20.5 were released under the Apacheâ„¢ License, version 1.1.
+ Releases until version 0.20.5 are released unter the Apacheâ„¢ License, version 1.1.
</p>
<p>
To inspect the license terms please consult the LICENSE and NOTICE files in the root
diff --git a/src/documentation/content/xdocs/maillist.xml b/src/documentation/content/xdocs/maillist.xml
index b24166462..ec5e274dc 100644
--- a/src/documentation/content/xdocs/maillist.xml
+++ b/src/documentation/content/xdocs/maillist.xml
@@ -83,7 +83,7 @@ If you are using Microsoft Outlook, this setting can be found at the "Mail Forma
source, or other semantic XML? If so, the question is <em>almost certainly not
appropriate to this list</em>. In general, the only input documents that are
appropriate on this list are XSL-FO snippets. See <link
- href="1.1rc1/running.html#check-input">Running Xalan</link> for instructions about capturing the XSL-FO document that is actually submitted to FOP. If you haven't examined the XSL-FO document yourself, then you are not yet prepared to formulate a FOP-specific question.</li>
+ href="1.0/running.html#check-input">Running Xalan</link> for instructions about capturing the XSL-FO document that is actually submitted to FOP. If you haven't examined the XSL-FO document yourself, then you are not yet prepared to formulate a FOP-specific question.</li>
<li>If you are providing one or more XSL-FO snippets:
<ul>
<li>Have you reduced them to the shortest possible complete, <strong>self-contained</strong> document that demonstrates the problem? Please do so.</li>
diff --git a/src/documentation/content/xdocs/news-data.xml b/src/documentation/content/xdocs/news-data.xml
index 4b8956cd1..1fec872df 100644
--- a/src/documentation/content/xdocs/news-data.xml
+++ b/src/documentation/content/xdocs/news-data.xml
@@ -17,15 +17,6 @@
-->
<!-- $Id$ -->
<news>
- <item date="2012-07-02" title="Apacheâ„¢ FOP 1.1rc1 Available">
- <p>
- This is a candidate release for an upcoming FOP Version 1.1 (stable) release.
- release of the new FOP codebase. This release
- contains bug fixes and new features. See
- <a href="1.1rc1/releaseNotes_1.1rc1.html">Release Notes</a> for a list of
- the most important changes.
- </p>
- </item>
<item date="2012-02-24" title="New committer">
<p>Welcome Glenn Adams!</p>
</item>
diff --git a/src/documentation/content/xdocs/news.xml b/src/documentation/content/xdocs/news.xml
index 688558226..978314977 100644
--- a/src/documentation/content/xdocs/news.xml
+++ b/src/documentation/content/xdocs/news.xml
@@ -16,24 +16,17 @@
limitations under the License.
-->
<!-- $Id$ -->
-<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "http://forrest.apache.org/dtd/document-v13.dtd" [
-<!ATTLIST document
- xmlns:xi CDATA #IMPLIED>
-<!ELEMENT xi:include EMPTY>
-<!ATTLIST xi:include
- href CDATA #IMPLIED>
-<!ENTITY % local.sections "|xi:include">
-]>
-<document xmlns:xi="http://www.w3.org/2001/XInclude">
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+<document>
<header>
<title>Apacheâ„¢ FOP News</title>
<version>$Revision$</version>
</header>
<body>
<p>
- RSS Feed: <link href="subproject-news-feed.rss"><img src="feed-icon-14x14.png" alt="Subproject News Feed"/></link>
+ RSS Feed: <a href="subproject-news-feed.rss"><img src="feed-icon-14x14.png" alt="Subproject News Feed"/></a>
</p>
- <xi:include href="cocoon://subproject-news-document.xml#xpointer(/document/body/*)"/>
+ <xi:include href="cocoon://subproject-news-document.xml#xpointer(/document/body/*)" xmlns:xi="http://www.w3.org/2001/XInclude"/>
</body>
</document>
diff --git a/src/documentation/content/xdocs/quickstartguide.xml b/src/documentation/content/xdocs/quickstartguide.xml
index 3d369c08c..2020e4b36 100644
--- a/src/documentation/content/xdocs/quickstartguide.xml
+++ b/src/documentation/content/xdocs/quickstartguide.xml
@@ -29,15 +29,15 @@
<p>The goal of this <strong>Quick Start Guide</strong> is to help novice users get Apache FOP up and running quickly. Typically, you'll need to:</p>
<ol>
<li><link href="download.html">Download FOP</link></li>
- <li><link href="1.1rc1/compiling.html">Build FOP</link> (you can skip this step if you download the binary distribution!)</li>
- <li><link href="1.1rc1/configuration.html">Configure FOP</link></li>
- <li><link href="1.1rc1/running.html">Run FOP</link></li>
+ <li><link href="1.0/compiling.html">Build FOP</link> (you can skip this step if you download the binary distribution!)</li>
+ <li><link href="1.0/configuration.html">Configure FOP</link></li>
+ <li><link href="1.0/running.html">Run FOP</link></li>
</ol>
<p>Here are some links to help you find out what FOP can do, as well as how and where to get help:</p>
<ul>
- <li><link href="1.1rc1/embedding.html">Calling FOP from a Java Application</link></li>
- <li><link href="1.1rc1/servlets.html">Using FOP in Servlets</link></li>
- <li><link href="1.1rc1/anttask.html">Using FOP in an 'Ant' Build Script</link></li>
+ <li><link href="1.0/embedding.html">Calling FOP from a Java Application</link></li>
+ <li><link href="1.0/servlets.html">Using FOP in Servlets</link></li>
+ <li><link href="1.0/anttask.html">Using FOP in an 'Ant' Build Script</link></li>
<li><link href="compliance.html" title="FOP Compliance">XSL-FO Compliance</link> (what FOP supports and what it doesn't)</li>
<li><link href="faq.html">FAQs</link></li>
<li><link href="gethelp.html">Getting Help</link></li>
@@ -45,7 +45,7 @@
</ul>
<p>
Once you've familiarized yourself with the basics, you can get more detailed information,
- in the detailed FOP <link href="1.1rc1/index.html">product documentation</link>.
+ in the detailed FOP <link href="1.0/index.html">product documentation</link>.
</p>
</section>
diff --git a/src/documentation/content/xdocs/site.xml b/src/documentation/content/xdocs/site.xml
index c750f9556..322f5e52c 100644
--- a/src/documentation/content/xdocs/site.xml
+++ b/src/documentation/content/xdocs/site.xml
@@ -29,9 +29,13 @@
<faqs label="FAQs" href="faq.html"/>
<maillist label="Mailing Lists" href="maillist.html"/>
<license label="License" href="license.html"/>
- <asf-sponsorship label="ASF Sponsorship Program" href="http://www.apache.org/foundation/sponsorship.html"/>
- <asf-thanks label="ASF Thanks" href="http://www.apache.org/foundation/thanks.html"/>
- <asf-security label="Security" href="http://www.apache.org/security/"/>
+ <asf-sponsorship label="ASF Sponsorship Program" href="http://www.apache.org/foundation/sponsorship.html"/>"
+ <asf-thanks label="ASF Thanks" href="http://www.apache.org/foundation/thanks.html"/>"
+ <asf-security label="Security" href="http://www.apache.org/security/"/>
+ <!--
+ <all_site label="Full HTML" href="wholesite.html"/>
+ <all_sitePDF label="Full PDF" href="wholesite.pdf"/>
+ -->
</about>
<resources label="Resources">
@@ -55,82 +59,80 @@
-->
<!--
- BEGIN Version 1.0 documentation tab
+ BEGIN Version 0.95 documentation tab
-->
- <trunk label="Apacheâ„¢ FOP 1.0" href="1.0/" tab="previousversion">
+ <trunk label="Apacheâ„¢ FOP 0.95" href="0.95/" tab="previousversion">
<about label="About" href="index.html"/>
- <release label="Release Notes" href="releaseNotes_1.0.html"/>
- <changes label="Changes (1.0)" href="changes_1.0.html"/>
+ <release label="Release Notes" href="releaseNotes_0.95.html"/>
+ <changes label="Changes (0.95)" href="changes_0.95.html"/>
+ <changes-beta label="Changes (0.95beta)" href="changes_0.95beta.html"/>
<knownissues label="Known Issues" href="knownissues_overview.html"/>
<upgrading label="Upgrading" href="upgrading.html"/>
<using label="Using Apacheâ„¢ FOP">
- <ant label="Ant Task" href="anttask.html"/>
<build label="Build" href="compiling.html"/>
<config label="Configure" href="configuration.html"/>
- <embed label="Embed" href="embedding.html"/>
<run label="Run" href="running.html"/>
+ <embed label="Embed" href="embedding.html"/>
<servlet label="Servlets" href="servlets.html"/>
+ <ant label="Ant Task" href="anttask.html"/>
</using>
<features label="Features">
- <accessibility label="Accessibility" href="accessibility.html"/>
- <events label="Events" href="events.html"/>
- <extensions label="Extensions" href="extensions.html"/>
- <fonts label="Fonts" href="fonts.html"/>
<output label="Output Targets" href="output.html"/>
- <graphics label="Graphics" href="graphics.html"/>
- <hyphenation label="Hyphenation" href="hyphenation.html"/>
<if label="Intermediate Format" href="intermediate.html"/>
- <metadata label="Metadata" href="metadata.html"/>
+ <pdfencryption label="PDF Encryption" href="pdfencryption.html"/>
<pdfa label="PDF/A" href="pdfa.html"/>
<pdfx label="PDF/X" href="pdfx.html"/>
- <pdfencryption label="PDF Encryption" href="pdfencryption.html"/>
+ <graphics label="Graphics" href="graphics.html"/>
+ <fonts label="Fonts" href="fonts.html"/>
+ <hyphenation label="Hyphenation" href="hyphenation.html"/>
+ <extensions label="Extensions" href="extensions.html"/>
+ <metadata label="Metadata" href="metadata.html"/>
</features>
</trunk>
<!--
- END Version 1.0 documentation tab
+ END Version 0.95 documentation tab
-->
-
+
<!--
- BEGIN Version 1.1rc1 documentation tab
+ BEGIN Version 1.0 documentation tab
-->
- <trunk label="Apacheâ„¢ FOP 1.1rc1" href="1.1rc1/" tab="stableversion">
+ <trunk label="Apacheâ„¢ FOP 1.0" href="1.0/" tab="stableversion">
<about label="About" href="index.html"/>
- <release label="Release Notes" href="releaseNotes_1.1rc1.html"/>
- <changes label="Changes (1.1rc1)" href="changes_1.1rc1.html"/>
+ <release label="Release Notes" href="releaseNotes_1.0.html"/>
+ <changes label="Changes (1.0)" href="changes_1.0.html"/>
<knownissues label="Known Issues" href="knownissues_overview.html"/>
<upgrading label="Upgrading" href="upgrading.html"/>
<using label="Using Apacheâ„¢ FOP">
- <ant label="Ant Task" href="anttask.html"/>
<build label="Build" href="compiling.html"/>
<config label="Configure" href="configuration.html"/>
- <embed label="Embed" href="embedding.html"/>
<run label="Run" href="running.html"/>
+ <embed label="Embed" href="embedding.html"/>
<servlet label="Servlets" href="servlets.html"/>
+ <ant label="Ant Task" href="anttask.html"/>
</using>
<features label="Features">
- <accessibility label="Accessibility" href="accessibility.html"/>
- <complexscripts label="Complex Scripts" href="complexscripts.html"/>
- <events label="Events" href="events.html"/>
- <extensions label="Extensions" href="extensions.html"/>
- <fonts label="Fonts" href="fonts.html"/>
- <graphics label="Graphics" href="graphics.html"/>
- <hyphenation label="Hyphenation" href="hyphenation.html"/>
- <if label="Intermediate Format" href="intermediate.html"/>
- <metadata label="Metadata" href="metadata.html"/>
<output label="Output Targets" href="output.html"/>
+ <if label="Intermediate Format" href="intermediate.html"/>
+ <pdfencryption label="PDF Encryption" href="pdfencryption.html"/>
<pdfa label="PDF/A" href="pdfa.html"/>
<pdfx label="PDF/X" href="pdfx.html"/>
- <pdfencryption label="PDF Encryption" href="pdfencryption.html"/>
+ <graphics label="Graphics" href="graphics.html"/>
+ <fonts label="Fonts" href="fonts.html"/>
+ <hyphenation label="Hyphenation" href="hyphenation.html"/>
+ <extensions label="Extensions" href="extensions.html"/>
+ <events label="Events" href="events.html"/>
+ <metadata label="Metadata" href="metadata.html"/>
+ <accessibility label="Accessibility" href="accessibility.html"/>
</features>
</trunk>
<!--
- END Version 1.1rc1 documentation tab
+ END Version 1.0 documentation tab
-->
<!--
@@ -141,14 +143,20 @@
<upgrading label="Upgrading" href="upgrading.html"/>
<using label="Using Apacheâ„¢ FOP">
- <ant label="Ant Task" href="anttask.html"/>
<build label="Build" href="compiling.html"/>
<config label="Configure" href="configuration.html"/>
- <embed label="Embed" href="embedding.html"/>
<run label="Run" href="running.html"/>
+ <embed label="Embed" href="embedding.html"/>
<servlet label="Servlets" href="servlets.html"/>
+ <ant label="Ant Task" href="anttask.html"/>
</using>
+ <!--
+ NOTA BENE NOTA BENE NOTA BENE
+ The following features should be maintained in alphabetic order by
+ (displayed) label value.
+ NOTA BENE NOTA BENE NOTA BENE
+ -->
<features label="Features">
<accessibility label="Accessibility" href="accessibility.html"/>
<complexscripts label="Complex Scripts" href="complexscripts.html"/>
diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml
index 1b6f1dc2b..8a6ea5dce 100644
--- a/src/documentation/content/xdocs/status.xml
+++ b/src/documentation/content/xdocs/status.xml
@@ -27,27 +27,23 @@
<body>
<section>
<title>Status</title>
- <p>Last updated 02 July 2012.</p>
+ <p>[last updated 5 July 2010]</p>
<p>
- Apacheâ„¢ FOP version 1.1rc1 (candidate) was released on 02 July 2012.
+ Apacheâ„¢ FOP version 0.95 was released on 5 August 2008. Apacheâ„¢ FOP version 1.0 was released on 21 July 2010.
</p>
</section>
<section>
<title>Development Status</title>
+
+ <p>The FOP code base is gradually evolving, from version 0.90
+ released on 22 November 2005, to version 1.0 released on 21 July
+ 2010. Further releases in the 1.x series may be expected.</p>
+ <p>FOP releases before version 0.90 were based on a different
+ code base. The last release in that series was version 0.20.5,
+ released on 18 July 2003. This series is no longer maintained.</p>
<p>
- The FOP code base is gradually evolving, from Version 0.90,
- released on 22 November 2005, to Version 1.1, expected to be released during
- the Summer of 2012. Further releases in the 1.x series and beyond are expected.
- </p>
- <p>
- FOP releases prior to version 0.90 were based on a different
- code base. The last release in that series was version 0.20.5,
- released on 18 July 2003. This earlier series is no longer maintained.
- </p>
- <p>
- If you are looking for future release dates, keep in mind that FOP is an Open
- Source project and we're a combination of volunteers (working in our free time) and
- sponsored contributors (generally focusing on our sponsor's needs). What we have
+ If you're looking for a long-term road-map we have to disappoint you. This is Open
+ Source and we're mostly volunteers working in their free time. What we have
is an idea where we want to go. How fast we get there depends on the
available time, on how well our ideas work out while developing and on you!
There's a <a href="http://wiki.apache.org/xmlgraphics-fop/RoadMap">document in the Wiki</a>
@@ -86,11 +82,11 @@
</tr>
<tr>
<td>PDF (Library and Renderer)</td>
- <td>stable</td>
+ <td>stable (SVG: stable)</td>
</tr>
<tr>
<td>PostScript</td>
- <td>stable</td>
+ <td>stable (SVG: stable with restrictions)</td>
</tr>
<tr>
<td>Java2D, AWT, Bitmap Renderers</td>
diff --git a/src/documentation/content/xdocs/tabs.xml b/src/documentation/content/xdocs/tabs.xml
index 27e99b67c..a9c458fe3 100644
--- a/src/documentation/content/xdocs/tabs.xml
+++ b/src/documentation/content/xdocs/tabs.xml
@@ -21,8 +21,8 @@
<tabs software="FOP" title="FOP" copyright="@year@ The Apache Software Foundation" xmlns:xlink="http://www.w3.org/1999/xlink">
<tab label="Home" dir=""/>
+ <tab label="Version 0.95" dir="0.95/"/>
<tab label="Version 1.0" dir="1.0/"/>
- <tab label="Version 1.1rc1" dir="1.1rc1/"/>
<tab label="FOP Trunk" dir="trunk/"/>
<tab label="Development" dir="dev/"/>
</tabs>
diff --git a/src/documentation/content/xdocs/team.xml b/src/documentation/content/xdocs/team.xml
index 4eb2da7b3..a8f0602e4 100644
--- a/src/documentation/content/xdocs/team.xml
+++ b/src/documentation/content/xdocs/team.xml
@@ -44,7 +44,7 @@
is an XP/Agile practitioner with interests in open source content management and electronic
document generation. He is a UK expat now residing in Singapore.</li>
<li id="ad"><link href="mailto:adelmelle@apache.org">Andreas Delmelle</link> (AD)</li>
- <li id="pjfh"> <link href="mailto:phancock.at.apache.org">Peter Hancock</link>
+ <li id="pjfh"> <a href="mailto:phancock.at.apache.org">Peter Hancock</a>
(PH) is a Java developer from England.</li>
<li id="vh"><link href="mailto:vhennebert@apache.org">Vincent Hennebert</link>
(VH), a Java developer from France; with an interest in typography, and in using
diff --git a/src/documentation/content/xdocs/trunk/configuration.xml b/src/documentation/content/xdocs/trunk/configuration.xml
index 563ae9647..b30a091a5 100644
--- a/src/documentation/content/xdocs/trunk/configuration.xml
+++ b/src/documentation/content/xdocs/trunk/configuration.xml
@@ -281,24 +281,6 @@
treated as zero penalty in most cases. For more details on the image loading framework,
please consult the documentation there.
</p>
- <p>
- The ImageLoaderPNG and ImageLoaderRawPNG have a hard-coded penalty of 1000 and as such the
- ImageLoaderImageIO image loader will be selected by default when loading PNGs unless
- the latter is disabled by awarding a INFINITE penalty to it, or one of the former two is
- promoted by awarding a strong negative penalty (say, -10000) to it.
- </p>
- <source><![CDATA[<fop version="1.0">
- [..]
- <image-loading>
- <penalty value="-10000"
- class="org.apache.xmlgraphics.image.loader.impl.ImageLoaderRawPNG"/>
- <penalty value="INFINITE"
- class="org.apache.xmlgraphics.image.loader.impl.ImageLoaderPNG"/>
- <penalty value="INFINITE"
- class="org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderImageIO"/>
- </image-loading>
- <renderers....
-</fop>]]></source>
</section>
<section id="renderers">
<title>Renderer configuration</title>
diff --git a/src/documentation/content/xdocs/trunk/fonts.xml b/src/documentation/content/xdocs/trunk/fonts.xml
index ba607e40b..f3481607d 100644
--- a/src/documentation/content/xdocs/trunk/fonts.xml
+++ b/src/documentation/content/xdocs/trunk/fonts.xml
@@ -493,10 +493,10 @@
Various notes related to embedded fonts:
</p>
<ul>
- <li>The font is simply embedded into the output file, it is not converted.</li>
- <li>When FOP embeds a font in a PDF file, it adds a prefix to the fontname to ensure that
- the name will not match the fontname of an installed font. This is helpful with older
- versions of Acrobat Reader that preferred installed fonts over embedded fonts.</li>
+ <li>The PostScript renderer does not yet support TrueType fonts, but can embed Type 1 fonts.</li>
+ <li>The font is simply embedded into the PDF file, it is not converted.</li>
+ <li>When FOP embeds a font, it adds a prefix to the fontname to ensure that the name will not match the fontname of an installed font.
+ This is helpful with older versions of Acrobat Reader that preferred installed fonts over embedded fonts.</li>
<li>When embedding PostScript fonts, the entire font is always embedded.</li>
<li>When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a subset of the
original font, containing only the glyphs used, is embedded in the output document.
@@ -576,4 +576,4 @@
</p>
</section>
</body>
-</document>
+</document> \ No newline at end of file
diff --git a/src/documentation/content/xdocs/trunk/graphics.xml b/src/documentation/content/xdocs/trunk/graphics.xml
index eb05013b7..b1653443a 100644
--- a/src/documentation/content/xdocs/trunk/graphics.xml
+++ b/src/documentation/content/xdocs/trunk/graphics.xml
@@ -108,7 +108,7 @@
<tr>
<td><a href="#png">PNG</a> (Portable Network Graphic)</td>
<td>bitmap</td>
- <td>(X)</td>
+ <td/>
<td/>
<td>X</td>
</tr>
@@ -217,8 +217,8 @@
</tr>
<tr>
<td><a href="#png">PNG</a> (Portable Network Graphic)</td>
- <td>X [2]</td>
- <td>X [2]</td>
+ <td>X</td>
+ <td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
@@ -383,11 +383,8 @@
<section id="png">
<title>PNG</title>
<p>
- FOP native support of PNG only includes the variants with 8 bits per channel and without
- interlacing. Native support requires using the ImageLoaderRawPNG image loader.
- Support through a Image I/O codec can use either the internal XGC PNG codec or the JRE PNG
- codec. The associated image loaders are, respectively, ImageLoaderPNG and ImageLoaderImageIO.
- Transparency is supported but not guaranteed to work with every output format.
+ PNG images are supported through an Image&amp;nbsp;I/O codec. Transparency is supported but
+ not guaranteed to work with every output format.
</p>
</section>
<section id="svg">
diff --git a/src/documentation/intermediate-format-ng/fop-intermediate-format-ng.xsd b/src/documentation/intermediate-format-ng/fop-intermediate-format-ng.xsd
index 6e17c793b..bea5275a5 100644
--- a/src/documentation/intermediate-format-ng/fop-intermediate-format-ng.xsd
+++ b/src/documentation/intermediate-format-ng/fop-intermediate-format-ng.xsd
@@ -34,7 +34,6 @@
<xs:element ref="mf:page-sequence" minOccurs="1" maxOccurs="unbounded"/>
<xs:element ref="mf:trailer"/>
</xs:sequence>
- <xs:attribute name="version" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="header">
diff --git a/src/documentation/resources/stylesheets/known-issues2document.xsl b/src/documentation/resources/stylesheets/known-issues2document.xsl
index ad0c4d70a..8e10c35a2 100644
--- a/src/documentation/resources/stylesheets/known-issues2document.xsl
+++ b/src/documentation/resources/stylesheets/known-issues2document.xsl
@@ -46,10 +46,4 @@
</li>
</xsl:template>
- <xsl:template match="@*|*|text()|processing-instruction()|comment()">
- <xsl:copy>
- <xsl:apply-templates select="@*|*|text()|processing-instruction()|comment()"/>
- </xsl:copy>
- </xsl:template>
-
</xsl:stylesheet>
diff --git a/src/java/META-INF/services/org.apache.fop.render.ImageHandler b/src/java/META-INF/services/org.apache.fop.render.ImageHandler
index 9066913ad..f9b890c8e 100644
--- a/src/java/META-INF/services/org.apache.fop.render.ImageHandler
+++ b/src/java/META-INF/services/org.apache.fop.render.ImageHandler
@@ -1,7 +1,6 @@
org.apache.fop.render.pdf.PDFImageHandlerGraphics2D
org.apache.fop.render.pdf.PDFImageHandlerRenderedImage
org.apache.fop.render.pdf.PDFImageHandlerRawJPEG
-org.apache.fop.render.pdf.PDFImageHandlerRawPNG
org.apache.fop.render.pdf.PDFImageHandlerRawCCITTFax
org.apache.fop.render.pdf.PDFImageHandlerSVG
org.apache.fop.render.java2d.Java2DImageHandlerRenderedImage
@@ -12,7 +11,6 @@ org.apache.fop.render.ps.PSImageHandlerRenderedImage
org.apache.fop.render.ps.PSImageHandlerEPS
org.apache.fop.render.ps.PSImageHandlerRawCCITTFax
org.apache.fop.render.ps.PSImageHandlerRawJPEG
-org.apache.fop.render.ps.PSImageHandlerRawPNG
org.apache.fop.render.ps.PSImageHandlerGraphics2D
org.apache.fop.render.ps.PSImageHandlerSVG
org.apache.fop.render.afp.AFPImageHandlerRenderedImage
diff --git a/src/java/org/apache/fop/accessibility/Accessibility.java b/src/java/org/apache/fop/accessibility/Accessibility.java
index 88ec6dbdd..c842cf43f 100644
--- a/src/java/org/apache/fop/accessibility/Accessibility.java
+++ b/src/java/org/apache/fop/accessibility/Accessibility.java
@@ -28,12 +28,6 @@ public final class Accessibility {
/** Constant string for the rendering options key to enable accessibility features. */
public static final String ACCESSIBILITY = "accessibility";
- /**
- * The value to be set on the 'role' property for the element and its descendants to
- * be considered as artifacts.
- */
- public static final String ROLE_ARTIFACT = "artifact";
-
private Accessibility() { }
}
diff --git a/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java b/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java
index 27469d6e0..47c227e9a 100644
--- a/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java
+++ b/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java
@@ -23,7 +23,6 @@ import java.util.Stack;
import org.xml.sax.SAXException;
-import org.apache.fop.accessibility.Accessibility;
import org.apache.fop.accessibility.StructureTreeEventHandler;
import org.apache.fop.fo.DelegatingFOEventHandler;
import org.apache.fop.fo.FOEventHandler;
@@ -58,8 +57,6 @@ import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.pagination.PageSequence;
import org.apache.fop.fo.pagination.Root;
import org.apache.fop.fo.pagination.StaticContent;
-import org.apache.fop.fo.properties.CommonAccessibility;
-import org.apache.fop.fo.properties.CommonAccessibilityHolder;
/**
* Allows to create the structure tree of an FO document, by converting FO
@@ -358,7 +355,6 @@ public class FO2StructureTreeConverter extends DelegatingFOEventHandler {
@Override
public void startStatic(StaticContent staticContent) {
- handleStartArtifact(staticContent);
converter.startStatic(staticContent);
super.startStatic(staticContent);
}
@@ -366,7 +362,6 @@ public class FO2StructureTreeConverter extends DelegatingFOEventHandler {
@Override
public void endStatic(StaticContent statisContent) {
converter.endStatic(statisContent);
- handleEndArtifact(statisContent);
super.endStatic(statisContent);
}
@@ -459,7 +454,6 @@ public class FO2StructureTreeConverter extends DelegatingFOEventHandler {
@Override
public void startWrapper(Wrapper wrapper) {
- handleStartArtifact(wrapper);
converter.startWrapper(wrapper);
super.startWrapper(wrapper);
}
@@ -467,7 +461,6 @@ public class FO2StructureTreeConverter extends DelegatingFOEventHandler {
@Override
public void endWrapper(Wrapper wrapper) {
converter.endWrapper(wrapper);
- handleEndArtifact(wrapper);
super.endWrapper(wrapper);
}
@@ -495,22 +488,4 @@ public class FO2StructureTreeConverter extends DelegatingFOEventHandler {
super.endExternalDocument(document);
}
- private void handleStartArtifact(CommonAccessibilityHolder fobj) {
- if (isArtifact(fobj)) {
- converters.push(converter);
- converter = eventSwallower;
- }
- }
-
- private void handleEndArtifact(CommonAccessibilityHolder fobj) {
- if (isArtifact(fobj)) {
- converter = converters.pop();
- }
- }
-
- private boolean isArtifact(CommonAccessibilityHolder fobj) {
- CommonAccessibility accessibility = fobj.getCommonAccessibility();
- return Accessibility.ROLE_ARTIFACT.equalsIgnoreCase(accessibility.getRole());
- }
-
}
diff --git a/src/java/org/apache/fop/afp/AFPGraphics2D.java b/src/java/org/apache/fop/afp/AFPGraphics2D.java
index 7172b0ee3..e9a269ac4 100644
--- a/src/java/org/apache/fop/afp/AFPGraphics2D.java
+++ b/src/java/org/apache/fop/afp/AFPGraphics2D.java
@@ -67,7 +67,7 @@ import org.apache.fop.svg.NativeImageHandler;
/**
* This is a concrete implementation of {@link AbstractGraphics2D} (and
- * therefore of {@link java.awt.Graphics2D}) which is able to generate GOCA byte
+ * therefore of {@link Graphics2D}) which is able to generate GOCA byte
* codes.
*
* @see org.apache.xmlgraphics.java2d.AbstractGraphics2D
@@ -165,7 +165,7 @@ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHand
}
/**
- * Returns the AFP resource manager associated with this {@link java.awt.Graphics2D} instance.
+ * Returns the AFP resource manager associated with this {@link Graphics2D} instance.
* @return the resource manager
*/
public AFPResourceManager getResourceManager() {
diff --git a/src/java/org/apache/fop/afp/modca/ImageObject.java b/src/java/org/apache/fop/afp/modca/ImageObject.java
index e42639248..adb56e626 100644
--- a/src/java/org/apache/fop/afp/modca/ImageObject.java
+++ b/src/java/org/apache/fop/afp/modca/ImageObject.java
@@ -119,8 +119,7 @@ public class ImageObject extends AbstractDataObject {
* Sets the image IDE color model.
*
* @param colorModel the IDE color model.
- * @deprecated Use {@link org.apache.fop.afp.ioca.IDEStructureParameter#setColorModel(byte)}
- * instead.
+ * @deprecated Use {@link IDEStructureParameter#setColorModel(byte)} instead.
*/
public void setIDEColorModel(byte colorModel) {
getImageSegment().setIDEColorModel(colorModel);
@@ -129,8 +128,7 @@ public class ImageObject extends AbstractDataObject {
/**
* Set either additive or subtractive mode (used for ASFLAG).
* @param subtractive true for subtractive mode, false for additive mode
- * @deprecated Use {@link org.apache.fop.afp.ioca.IDEStructureParameter#setSubtractive(boolean)}
- * instead.
+ * @deprecated Use {@link IDEStructureParameter#setSubtractive(boolean)} instead.
*/
public void setSubtractive(boolean subtractive) {
getImageSegment().setSubtractive(subtractive);
diff --git a/src/java/org/apache/fop/afp/modca/PresentationTextData.java b/src/java/org/apache/fop/afp/modca/PresentationTextData.java
index c0934b1e5..b68131413 100644
--- a/src/java/org/apache/fop/afp/modca/PresentationTextData.java
+++ b/src/java/org/apache/fop/afp/modca/PresentationTextData.java
@@ -46,7 +46,7 @@ import org.apache.fop.afp.util.BinaryUtils;
* which signal an alternate mode of processing for the content of the current
* Presentation Text data.
* <p>
- * The content for this object can be created using {@link org.apache.fop.afp.ptoca.PtocaBuilder}.
+ * The content for this object can be created using {@link PtocaBuilder}.
*/
public class PresentationTextData extends AbstractAFPObject implements PtocaConstants {
diff --git a/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java b/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java
index 2872976b6..f379546e2 100644
--- a/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java
+++ b/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java
@@ -44,8 +44,7 @@ public class DefaultFOPResourceAccessor extends SimpleResourceAccessor {
* Constructor for resource to be accessed via the {@link FOUserAgent}. This contructor
* can take two base URIs: the category base URI is the one to use when differentiating between
* normal resources (ex. images) and font resources. So, if fonts need to be accessed, you can
- * set the {@link org.apache.fop.fonts.FontManager}'s base URI instead of the one on the
- * {@link org.apache.fop.apps.FopFactory}.
+ * set the {@link FontManager}'s base URI instead of the one on the {@link FopFactory}.
* @param userAgent the FO user agent
* @param categoryBaseURI the category base URI (may be null)
* @param baseURI the custom base URI to resolve relative URIs against (may be null)
diff --git a/src/java/org/apache/fop/apps/FOUserAgent.java b/src/java/org/apache/fop/apps/FOUserAgent.java
index 035b6f1a1..665c1abf8 100644
--- a/src/java/org/apache/fop/apps/FOUserAgent.java
+++ b/src/java/org/apache/fop/apps/FOUserAgent.java
@@ -355,7 +355,7 @@ public class FOUserAgent {
/**
* Sets font base URL.
* @param fontBaseUrl font base URL
- * @deprecated Use {@link org.apache.fop.fonts.FontManager#setFontBaseURL(String)} instead.
+ * @deprecated Use {@link FontManager#setFontBaseURL(String)} instead.
*/
public void setFontBaseURL(String fontBaseUrl) {
try {
@@ -500,8 +500,7 @@ public class FOUserAgent {
/**
* Returns the font base URL.
* @return the font base URL
- * @deprecated Use {@link org.apache.fop.fonts.FontManager#getFontBaseURL()} instead.
- * This method is not used by FOP.
+ * @deprecated Use {@link FontManager#getFontBaseURL()} instead. This method is not used by FOP.
*/
public String getFontBaseURL() {
String fontBase = getFactory().getFontManager().getFontBaseURL();
diff --git a/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java b/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java
index 6db6be726..3b7c14b0e 100644
--- a/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java
+++ b/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java
@@ -1783,9 +1783,9 @@ public class GlyphPositioningTable extends GlyphTable {
* Find device adjustment.
* @param fontSize the font size to search for
* @return an adjustment if font size matches an entry
+ * @asf.todo at present, assumes that 1 device unit equals one point
*/
public int findAdjustment ( int fontSize ) {
- // [TODO] at present, assumes that 1 device unit equals one point
int fs = fontSize / 1000;
if ( fs < startSize ) {
return 0;
diff --git a/src/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java b/src/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java
index 9afb893b5..a9110d378 100644
--- a/src/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java
+++ b/src/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java
@@ -31,7 +31,6 @@ import org.apache.commons.logging.LogFactory;
import org.apache.fop.fonts.truetype.FontFileReader;
import org.apache.fop.fonts.truetype.TTFDirTabEntry;
import org.apache.fop.fonts.truetype.TTFFile;
-import org.apache.fop.fonts.truetype.TTFTableName;
// CSOFF: AvoidNestedBlocksCheck
// CSOFF: NoWhitespaceAfterCheck
@@ -127,7 +126,7 @@ public final class OTFAdvancedTypographicTableReader {
return gpos;
}
- private void readLangSysTable(TTFTableName tableTag, long langSysTable, String langSysTag) throws IOException {
+ private void readLangSysTable(String tableTag, long langSysTable, String langSysTag) throws IOException {
in.seekSet(langSysTable);
if (log.isDebugEnabled()) {
log.debug(tableTag + " lang sys table: " + langSysTag );
@@ -169,7 +168,7 @@ public final class OTFAdvancedTypographicTableReader {
private static String defaultTag = "dflt";
- private void readScriptTable(TTFTableName tableTag, long scriptTable, String scriptTag) throws IOException {
+ private void readScriptTable(String tableTag, long scriptTable, String scriptTag) throws IOException {
in.seekSet(scriptTable);
if (log.isDebugEnabled()) {
log.debug(tableTag + " script table: " + scriptTag );
@@ -222,7 +221,7 @@ public final class OTFAdvancedTypographicTableReader {
seLanguages = null;
}
- private void readScriptList(TTFTableName tableTag, long scriptList) throws IOException {
+ private void readScriptList(String tableTag, long scriptList) throws IOException {
in.seekSet(scriptList);
// read script record count
int ns = in.readTTFUShort();
@@ -251,7 +250,7 @@ public final class OTFAdvancedTypographicTableReader {
}
}
- private void readFeatureTable(TTFTableName tableTag, long featureTable, String featureTag, int featureIndex) throws IOException {
+ private void readFeatureTable(String tableTag, long featureTable, String featureTag, int featureIndex) throws IOException {
in.seekSet(featureTable);
if (log.isDebugEnabled()) {
log.debug(tableTag + " feature table: " + featureTag );
@@ -279,7 +278,7 @@ public final class OTFAdvancedTypographicTableReader {
seFeatures.put ( "f" + featureIndex, new Object[] { featureTag, lul } );
}
- private void readFeatureList(TTFTableName tableTag, long featureList) throws IOException {
+ private void readFeatureList(String tableTag, long featureList) throws IOException {
in.seekSet(featureList);
// read feature record count
int nf = in.readTTFUShort();
@@ -3145,9 +3144,9 @@ public final class OTFAdvancedTypographicTableReader {
resetATSubState();
}
- private void readLookupTable(TTFTableName tableTag, int lookupSequence, long lookupTable) throws IOException {
- boolean isGSUB = tableTag.equals ( TTFTableName.GSUB );
- boolean isGPOS = tableTag.equals ( TTFTableName.GPOS );
+ private void readLookupTable(String tableTag, int lookupSequence, long lookupTable) throws IOException {
+ boolean isGSUB = tableTag.equals ( "GSUB" );
+ boolean isGPOS = tableTag.equals ( "GPOS" );
in.seekSet(lookupTable);
// read lookup type
int lt = in.readTTFUShort();
@@ -3198,7 +3197,7 @@ public final class OTFAdvancedTypographicTableReader {
}
}
- private void readLookupList(TTFTableName tableTag, long lookupList) throws IOException {
+ private void readLookupList(String tableTag, long lookupList) throws IOException {
in.seekSet(lookupList);
// read lookup record count
int nl = in.readTTFUShort();
@@ -3233,7 +3232,7 @@ public final class OTFAdvancedTypographicTableReader {
* @param lookupList offset to lookup list from beginning of font file
* @throws IOException In case of a I/O problem
*/
- private void readCommonLayoutTables(TTFTableName tableTag, long scriptList, long featureList, long lookupList) throws IOException {
+ private void readCommonLayoutTables(String tableTag, long scriptList, long featureList, long lookupList) throws IOException {
if ( scriptList > 0 ) {
readScriptList ( tableTag, scriptList );
}
@@ -3245,7 +3244,7 @@ public final class OTFAdvancedTypographicTableReader {
}
}
- private void readGDEFClassDefTable(TTFTableName tableTag, int lookupSequence, long subtableOffset) throws IOException {
+ private void readGDEFClassDefTable(String tableTag, int lookupSequence, long subtableOffset) throws IOException {
initATSubState();
in.seekSet(subtableOffset);
// subtable is a bare class definition table
@@ -3257,7 +3256,7 @@ public final class OTFAdvancedTypographicTableReader {
resetATSubState();
}
- private void readGDEFAttachmentTable(TTFTableName tableTag, int lookupSequence, long subtableOffset) throws IOException {
+ private void readGDEFAttachmentTable(String tableTag, int lookupSequence, long subtableOffset) throws IOException {
initATSubState();
in.seekSet(subtableOffset);
// read coverage offset
@@ -3275,7 +3274,7 @@ public final class OTFAdvancedTypographicTableReader {
resetATSubState();
}
- private void readGDEFLigatureCaretTable(TTFTableName tableTag, int lookupSequence, long subtableOffset) throws IOException {
+ private void readGDEFLigatureCaretTable(String tableTag, int lookupSequence, long subtableOffset) throws IOException {
initATSubState();
in.seekSet(subtableOffset);
// read coverage offset
@@ -3305,7 +3304,7 @@ public final class OTFAdvancedTypographicTableReader {
resetATSubState();
}
- private void readGDEFMarkAttachmentTable(TTFTableName tableTag, int lookupSequence, long subtableOffset) throws IOException {
+ private void readGDEFMarkAttachmentTable(String tableTag, int lookupSequence, long subtableOffset) throws IOException {
initATSubState();
in.seekSet(subtableOffset);
// subtable is a bare class definition table
@@ -3317,7 +3316,7 @@ public final class OTFAdvancedTypographicTableReader {
resetATSubState();
}
- private void readGDEFMarkGlyphsTableFormat1(TTFTableName tableTag, int lookupSequence, long subtableOffset, int subtableFormat) throws IOException {
+ private void readGDEFMarkGlyphsTableFormat1(String tableTag, int lookupSequence, long subtableOffset, int subtableFormat) throws IOException {
initATSubState();
in.seekSet(subtableOffset);
// skip over format (already known)
@@ -3351,7 +3350,7 @@ public final class OTFAdvancedTypographicTableReader {
resetATSubState();
}
- private void readGDEFMarkGlyphsTable(TTFTableName tableTag, int lookupSequence, long subtableOffset) throws IOException {
+ private void readGDEFMarkGlyphsTable(String tableTag, int lookupSequence, long subtableOffset) throws IOException {
in.seekSet(subtableOffset);
// read mark set subtable format
int sf = in.readTTFUShort();
@@ -3367,11 +3366,11 @@ public final class OTFAdvancedTypographicTableReader {
* @throws IOException In case of a I/O problem
*/
private void readGDEF() throws IOException {
- TTFTableName tableTag = TTFTableName.GDEF;
+ String tableTag = "GDEF";
// Initialize temporary state
initATState();
// Read glyph definition (GDEF) table
- TTFDirTabEntry dirTab = ttf.getDirectoryEntry( tableTag );
+ TTFDirTabEntry dirTab = ttf.getDirectoryEntry ( tableTag );
if ( gdef != null ) {
if (log.isDebugEnabled()) {
log.debug(tableTag + ": ignoring duplicate table");
@@ -3440,7 +3439,7 @@ public final class OTFAdvancedTypographicTableReader {
* @throws IOException In case of a I/O problem
*/
private void readGSUB() throws IOException {
- TTFTableName tableTag = TTFTableName.GSUB;
+ String tableTag = "GSUB";
// Initialize temporary state
initATState();
// Read glyph substitution (GSUB) table
@@ -3477,7 +3476,7 @@ public final class OTFAdvancedTypographicTableReader {
* @throws IOException In case of a I/O problem
*/
private void readGPOS() throws IOException {
- TTFTableName tableTag = TTFTableName.GPOS;
+ String tableTag = "GPOS";
// Initialize temporary state
initATState();
// Read glyph positioning (GPOS) table
diff --git a/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java b/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java
index 26249bc22..ce4585828 100644
--- a/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java
+++ b/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java
@@ -360,7 +360,7 @@ public class IndicScriptProcessor extends DefaultScriptProcessor {
}
/** Abstract syllabizer. */
- protected abstract static class Syllabizer implements Comparable {
+ protected abstract static class Syllabizer {
private String script;
private String language;
Syllabizer ( String script, String language ) {
diff --git a/src/java/org/apache/fop/fo/FOEventHandler.java b/src/java/org/apache/fop/fo/FOEventHandler.java
index 11b6d4a2f..743708b72 100644
--- a/src/java/org/apache/fop/fo/FOEventHandler.java
+++ b/src/java/org/apache/fop/fo/FOEventHandler.java
@@ -123,17 +123,11 @@ public abstract class FOEventHandler {
public void endDocument() throws SAXException {
}
- /**
- * Called upon start of root element.
- * @param root element
- */
+ /** {@inheritDoc} */
public void startRoot(Root root) {
}
- /**
- * Called upon end of root element.
- * @param root element
- */
+ /** {@inheritDoc} */
public void endRoot(Root root) {
}
@@ -419,9 +413,9 @@ public abstract class FOEventHandler {
/**
* Process end of a Static.
- * @param staticContent StaticContent that is ending
+ * @param statisContent StaticContent that is ending
*/
- public void endStatic(StaticContent staticContent) {
+ public void endStatic(StaticContent statisContent) {
}
diff --git a/src/java/org/apache/fop/fo/flow/Wrapper.java b/src/java/org/apache/fop/fo/flow/Wrapper.java
index 0aec7ce16..1302e3134 100644
--- a/src/java/org/apache/fop/fo/flow/Wrapper.java
+++ b/src/java/org/apache/fop/fo/flow/Wrapper.java
@@ -26,10 +26,7 @@ import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOText;
import org.apache.fop.fo.FObjMixed;
-import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
-import org.apache.fop.fo.properties.CommonAccessibility;
-import org.apache.fop.fo.properties.CommonAccessibilityHolder;
/**
* Class modelling the <a href=http://www.w3.org/TR/xsl/#fo_wrapper">
@@ -37,13 +34,13 @@ import org.apache.fop.fo.properties.CommonAccessibilityHolder;
* The <code>fo:wrapper</code> object serves as a property holder for
* its child node objects.
*/
-public class Wrapper extends FObjMixed implements CommonAccessibilityHolder {
+public class Wrapper extends FObjMixed {
+ // The value of properties relevant for fo:wrapper.
+ // End of property values
// used for FO validation
private boolean blockOrInlineItemFound = false;
- private CommonAccessibility commonAccessibility;
-
/**
* Create a Wrapper instance that is a child of the
* given {@link FONode}
@@ -55,12 +52,6 @@ public class Wrapper extends FObjMixed implements CommonAccessibilityHolder {
}
@Override
- public void bind(PropertyList pList) throws FOPException {
- super.bind(pList);
- commonAccessibility = CommonAccessibility.getInstance(pList);
- }
-
- @Override
protected void startOfNode() throws FOPException {
super.startOfNode();
getFOEventHandler().startWrapper(this);
@@ -145,10 +136,6 @@ public class Wrapper extends FObjMixed implements CommonAccessibilityHolder {
return FO_WRAPPER;
}
- public CommonAccessibility getCommonAccessibility() {
- return commonAccessibility;
- }
-
@Override
public boolean isDelimitedTextRangeBoundary ( int boundary ) {
return false;
diff --git a/src/java/org/apache/fop/fo/properties/CondLengthProperty.java b/src/java/org/apache/fop/fo/properties/CondLengthProperty.java
index 19c8af1bb..07eec7361 100644
--- a/src/java/org/apache/fop/fo/properties/CondLengthProperty.java
+++ b/src/java/org/apache/fop/fo/properties/CondLengthProperty.java
@@ -26,7 +26,6 @@ import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.expr.PropertyException;
-import org.apache.fop.util.CompareUtil;
/**
* Superclass for properties that have conditional lengths
@@ -193,8 +192,8 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
if (obj instanceof CondLengthProperty) {
CondLengthProperty clp = (CondLengthProperty)obj;
- return (CompareUtil.equal(this.length, clp.length)
- && CompareUtil.equal(this.conditionality, clp.conditionality));
+ return (this.length == clp.length
+ && this.conditionality == clp.conditionality);
}
return false;
}
diff --git a/src/java/org/apache/fop/fonts/CMapSegment.java b/src/java/org/apache/fop/fonts/BFEntry.java
index 816df2ca0..d3c7956ba 100644
--- a/src/java/org/apache/fop/fonts/CMapSegment.java
+++ b/src/java/org/apache/fop/fonts/BFEntry.java
@@ -20,49 +20,26 @@
package org.apache.fop.fonts;
/**
- * A segment in a cmap table of format 4. Unicode code points between
- * {@link #getUnicodeStart()} and {@link #getUnicodeEnd()} map to contiguous glyph indices
- * starting from {@link #getGlyphStartIndex()}.
+ * This is just a holder class for bfentries, groups of characters of a base font (bf).
*/
-public final class CMapSegment {
+public class BFEntry {
- private final int unicodeStart;
- private final int unicodeEnd;
- private final int glyphStartIndex;
+ private int unicodeStart;
+ private int unicodeEnd;
+ private int glyphStartIndex;
/**
- * Creates a new segment.
- *
+ * Main constructor.
* @param unicodeStart Unicode start index
* @param unicodeEnd Unicode end index
* @param glyphStartIndex glyph start index
*/
- public CMapSegment(int unicodeStart, int unicodeEnd, int glyphStartIndex) {
+ public BFEntry(int unicodeStart, int unicodeEnd, int glyphStartIndex) {
this.unicodeStart = unicodeStart;
this.unicodeEnd = unicodeEnd;
this.glyphStartIndex = glyphStartIndex;
}
- @Override
- public int hashCode() {
- int hc = 17;
- hc = 31 * hc + unicodeStart;
- hc = 31 * hc + unicodeEnd;
- hc = 31 * hc + glyphStartIndex;
- return hc;
- }
-
- @Override
- public boolean equals(Object o) {
- if (o instanceof CMapSegment) {
- CMapSegment ce = (CMapSegment) o;
- return ce.unicodeStart == this.unicodeStart
- && ce.unicodeEnd == this.unicodeEnd
- && ce.glyphStartIndex == this.glyphStartIndex;
- }
- return false;
- }
-
/**
* Returns the unicodeStart.
* @return the Unicode start index
@@ -90,7 +67,7 @@ public final class CMapSegment {
/** {@inheritDoc} */
@Override
public String toString() {
- StringBuilder sb = new StringBuilder("CMapSegment: ");
+ StringBuilder sb = new StringBuilder("BFEntry: ");
sb.append ( "{ UC[" );
sb.append ( unicodeStart );
sb.append ( ',' );
diff --git a/src/java/org/apache/fop/fonts/CIDFontType.java b/src/java/org/apache/fop/fonts/CIDFontType.java
index 20a94b9dd..ce01fa629 100644
--- a/src/java/org/apache/fop/fonts/CIDFontType.java
+++ b/src/java/org/apache/fop/fonts/CIDFontType.java
@@ -34,7 +34,7 @@ public class CIDFontType extends ValuedEnum {
/**
* CID Font Type 2 (based on TrueType format)
*/
- public static final CIDFontType CIDTYPE2 = new CIDFontType("CIDFontType2", 2);
+ public static final CIDFontType CIDTYPE2 = new CIDFontType("CIDFontType2", 1);
/**
diff --git a/src/java/org/apache/fop/fonts/CustomFont.java b/src/java/org/apache/fop/fonts/CustomFont.java
index 89f515205..c6b43fe98 100644
--- a/src/java/org/apache/fop/fonts/CustomFont.java
+++ b/src/java/org/apache/fop/fonts/CustomFont.java
@@ -42,7 +42,6 @@ public abstract class CustomFont extends Typeface
private String embedFileName = null;
private String embedResourceName = null;
private FontResolver resolver = null;
- private EmbeddingMode embeddingMode = EmbeddingMode.AUTO;
private int capHeight = 0;
private int xHeight = 0;
@@ -63,9 +62,6 @@ public abstract class CustomFont extends Typeface
private boolean useKerning = true;
private boolean useAdvanced = true;
- /** the character map, mapping Unicode ranges to glyph indices. */
- protected CMapSegment[] cmap;
-
/** {@inheritDoc} */
public String getFontName() {
return fontName;
@@ -116,14 +112,6 @@ public abstract class CustomFont extends Typeface
}
/**
- * Returns the embedding mode for this font.
- * @return embedding mode
- */
- public EmbeddingMode getEmbeddingMode() {
- return embeddingMode;
- }
-
- /**
* Returns a Source representing an embeddable font file.
* @return Source for an embeddable font file
* @throws IOException if embedFileName is not null but Source is not found
@@ -349,13 +337,6 @@ public abstract class CustomFont extends Typeface
/**
* {@inheritDoc}
*/
- public void setEmbeddingMode(EmbeddingMode embeddingMode) {
- this.embeddingMode = embeddingMode;
- }
-
- /**
- * {@inheritDoc}
- */
public void setCapHeight(int capHeight) {
this.capHeight = capHeight;
}
@@ -492,25 +473,4 @@ public abstract class CustomFont extends Typeface
}
}
- /**
- * Sets the character map for this font. It maps all available Unicode characters
- * to their glyph indices inside the font.
- * @param cmap the character map
- */
- public void setCMap(CMapSegment[] cmap) {
- this.cmap = new CMapSegment[cmap.length];
- System.arraycopy(cmap, 0, this.cmap, 0, cmap.length);
- }
-
- /**
- * Returns the character map for this font. It maps all available Unicode characters
- * to their glyph indices inside the font.
- * @return the character map
- */
- public CMapSegment[] getCMap() {
- CMapSegment[] copy = new CMapSegment[cmap.length];
- System.arraycopy(this.cmap, 0, copy, 0, this.cmap.length);
- return copy;
- }
-
}
diff --git a/src/java/org/apache/fop/fonts/CustomFontCollection.java b/src/java/org/apache/fop/fonts/CustomFontCollection.java
index fc8c947e4..6e798a8f7 100644
--- a/src/java/org/apache/fop/fonts/CustomFontCollection.java
+++ b/src/java/org/apache/fop/fonts/CustomFontCollection.java
@@ -72,7 +72,7 @@ public class CustomFontCollection implements FontCollection {
List<FontTriplet> triplets = embedFontInfo.getFontTriplets();
for (int tripletIndex = 0; tripletIndex < triplets.size(); tripletIndex++) {
- FontTriplet triplet = triplets.get(tripletIndex);
+ FontTriplet triplet = (FontTriplet) triplets.get(tripletIndex);
fontInfo.addFontProperties(internalName, triplet);
}
}
diff --git a/src/java/org/apache/fop/fonts/EmbedFontInfo.java b/src/java/org/apache/fop/fonts/EmbedFontInfo.java
index 64bd200be..8848c0a87 100644
--- a/src/java/org/apache/fop/fonts/EmbedFontInfo.java
+++ b/src/java/org/apache/fop/fonts/EmbedFontInfo.java
@@ -25,8 +25,6 @@ import java.util.List;
/**
* FontInfo contains meta information on fonts (where is the metrics file etc.)
- * TODO: We need to remove this class and think about more intelligent design patterns
- * (Data classes => Procedural code)
*/
public class EmbedFontInfo implements Serializable {
@@ -43,8 +41,6 @@ public class EmbedFontInfo implements Serializable {
protected boolean advanced;
/** the requested encoding mode for the font */
protected EncodingMode encodingMode = EncodingMode.AUTO;
- /** the requested embedding mode for this font */
- protected EmbeddingMode embeddingMode = EmbeddingMode.AUTO;
/** the PostScript name of the font */
protected String postScriptName = null;
@@ -153,14 +149,6 @@ public class EmbedFontInfo implements Serializable {
}
/**
- * Returns the embedding mode for this font.
- * @return the embedding mode.
- */
- public EmbeddingMode getEmbeddingMode() {
- return embeddingMode;
- }
-
- /**
* Defines whether the font is embedded or not.
* @param value true to embed the font, false to reference it
*/
@@ -187,17 +175,6 @@ public class EmbedFontInfo implements Serializable {
this.encodingMode = mode;
}
- /**
- * Sets the embedding mode for this font, currently not supported for Type 1 fonts.
- * @param embeddingMode the new embedding mode.
- */
- public void setEmbeddingMode(EmbeddingMode embeddingMode) {
- if (embeddingMode == null) {
- throw new NullPointerException("embeddingMode must not be null");
- }
- this.embeddingMode = embeddingMode;
- }
-
private void readObject(java.io.ObjectInputStream in)
throws IOException, ClassNotFoundException {
in.defaultReadObject();
diff --git a/src/java/org/apache/fop/fonts/EmbeddingMode.java b/src/java/org/apache/fop/fonts/EmbeddingMode.java
deleted file mode 100644
index 5a3e905c9..000000000
--- a/src/java/org/apache/fop/fonts/EmbeddingMode.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.util.Locale;
-
-/**
- * This enumerates the embedding mode of fonts; full; subset; auto (auto defaults to full for
- * Type 1 fonts and subset for TrueType fonts.
- */
-public enum EmbeddingMode {
- /** Default option: assumes FULL for Type 1 fonts and SUBSET for TrueType fonts. */
- AUTO,
- /** Full font embedding: This means the whole of the font is written to file. */
- FULL,
- /** Subset font embedding: Only the mandatory tables and a subset of glyphs are written
- * to file.*/
- SUBSET;
-
- /**
- * Returns the name of this embedding mode.
- * @return the name of this embedding mode in lower case.
- */
- public String getName() {
- return this.toString().toLowerCase(Locale.ENGLISH);
- }
-
- /**
- * Returns the embedding mode corresponding to the given name.
- * @param value the name of an embedding mode (not case sensitive)
- * @return the corresponding embedding mode
- */
- public static EmbeddingMode getValue(String value) {
- for (EmbeddingMode mode : EmbeddingMode.values()) {
- if (mode.toString().equalsIgnoreCase(value)) {
- return mode;
- }
- }
- throw new IllegalArgumentException("Invalid embedding-mode: " + value);
- }
-}
diff --git a/src/java/org/apache/fop/fonts/EncodingMode.java b/src/java/org/apache/fop/fonts/EncodingMode.java
index 78ffb7ac6..8a40d6593 100644
--- a/src/java/org/apache/fop/fonts/EncodingMode.java
+++ b/src/java/org/apache/fop/fonts/EncodingMode.java
@@ -52,7 +52,7 @@ public enum EncodingMode {
* @param name the name of the encoding mode to look up
* @return the encoding mode constant
*/
- public static EncodingMode getValue(String name) {
+ public static EncodingMode getEncodingMode(String name) {
for (EncodingMode em : EncodingMode.values()) {
if (name.equalsIgnoreCase(em.getName())) {
return em;
diff --git a/src/java/org/apache/fop/fonts/FontInfoConfigurator.java b/src/java/org/apache/fop/fonts/FontInfoConfigurator.java
index 042709884..34b6ed1d0 100644
--- a/src/java/org/apache/fop/fonts/FontInfoConfigurator.java
+++ b/src/java/org/apache/fop/fonts/FontInfoConfigurator.java
@@ -254,16 +254,12 @@ public class FontInfoConfigurator {
boolean useKerning = fontCfg.getAttributeAsBoolean("kerning", true);
boolean useAdvanced = fontCfg.getAttributeAsBoolean("advanced", true);
- EncodingMode encodingMode = EncodingMode.getValue(
+ EncodingMode encodingMode = EncodingMode.getEncodingMode(
fontCfg.getAttribute("encoding-mode", EncodingMode.AUTO.getName()));
- EmbeddingMode embeddingMode = EmbeddingMode.getValue(
- fontCfg.getAttribute("embedding-mode", EmbeddingMode.AUTO.toString()));
EmbedFontInfo embedFontInfo
= new EmbedFontInfo(metricsUrl, useKerning, useAdvanced, tripletList, embedUrl,
subFont);
embedFontInfo.setEncodingMode(encodingMode);
- embedFontInfo.setEmbeddingMode(embeddingMode);
-
boolean skipCachedFont = false;
if (fontCache != null) {
if (!fontCache.containsFont(embedFontInfo)) {
diff --git a/src/java/org/apache/fop/fonts/FontLoader.java b/src/java/org/apache/fop/fonts/FontLoader.java
index 9bdbcd350..91b763939 100644
--- a/src/java/org/apache/fop/fonts/FontLoader.java
+++ b/src/java/org/apache/fop/fonts/FontLoader.java
@@ -85,17 +85,15 @@ public abstract class FontLoader {
* @param fontFile the File representation of the font
* @param subFontName the sub-fontname of a font (for TrueType Collections, null otherwise)
* @param embedded indicates whether the font is embedded or referenced
- * @param embeddingMode the embedding mode
* @param encodingMode the requested encoding mode
* @param resolver the font resolver to use when resolving URIs
* @return the newly loaded font
* @throws IOException In case of an I/O error
*/
public static CustomFont loadFont(File fontFile, String subFontName,
- boolean embedded, EmbeddingMode embeddingMode, EncodingMode encodingMode,
- FontResolver resolver) throws IOException {
+ boolean embedded, EncodingMode encodingMode, FontResolver resolver) throws IOException {
return loadFont(fontFile.toURI().toURL(), subFontName,
- embedded, embeddingMode, encodingMode, resolver);
+ embedded, encodingMode, resolver);
}
/**
@@ -103,17 +101,16 @@ public abstract class FontLoader {
* @param fontUrl the URL representation of the font
* @param subFontName the sub-fontname of a font (for TrueType Collections, null otherwise)
* @param embedded indicates whether the font is embedded or referenced
- * @param embeddingMode the embedding mode of the font
* @param encodingMode the requested encoding mode
* @param resolver the font resolver to use when resolving URIs
* @return the newly loaded font
* @throws IOException In case of an I/O error
*/
public static CustomFont loadFont(URL fontUrl, String subFontName,
- boolean embedded, EmbeddingMode embeddingMode, EncodingMode encodingMode,
+ boolean embedded, EncodingMode encodingMode,
FontResolver resolver) throws IOException {
return loadFont(fontUrl.toExternalForm(), subFontName,
- embedded, embeddingMode, encodingMode, true, true,
+ embedded, encodingMode, true, true,
resolver);
}
@@ -122,7 +119,6 @@ public abstract class FontLoader {
* @param fontFileURI the URI to the font
* @param subFontName the sub-fontname of a font (for TrueType Collections, null otherwise)
* @param embedded indicates whether the font is embedded or referenced
- * @param embeddingMode the embedding mode of the font
* @param encodingMode the requested encoding mode
* @param useKerning indicates whether kerning information should be loaded if available
* @param useAdvanced indicates whether advanced typographic information shall be loaded if
@@ -132,8 +128,8 @@ public abstract class FontLoader {
* @throws IOException In case of an I/O error
*/
public static CustomFont loadFont(String fontFileURI, String subFontName,
- boolean embedded, EmbeddingMode embeddingMode, EncodingMode encodingMode,
- boolean useKerning, boolean useAdvanced, FontResolver resolver) throws IOException {
+ boolean embedded, EncodingMode encodingMode, boolean useKerning,
+ boolean useAdvanced, FontResolver resolver) throws IOException {
fontFileURI = fontFileURI.trim();
boolean type1 = isType1(fontFileURI);
FontLoader loader;
@@ -142,14 +138,10 @@ public abstract class FontLoader {
throw new IllegalArgumentException(
"CID encoding mode not supported for Type 1 fonts");
}
- if (embeddingMode == EmbeddingMode.SUBSET) {
- throw new IllegalArgumentException(
- "Subset embedding for Type 1 fonts is not supported");
- }
loader = new Type1FontLoader(fontFileURI, embedded, useKerning, resolver);
} else {
loader = new TTFFontLoader(fontFileURI, subFontName,
- embedded, embeddingMode, encodingMode, useKerning, useAdvanced, resolver);
+ embedded, encodingMode, useKerning, useAdvanced, resolver);
}
return loader.getFont();
}
diff --git a/src/java/org/apache/fop/fonts/FontReader.java b/src/java/org/apache/fop/fonts/FontReader.java
index 46ea9123d..9d75ad74f 100644
--- a/src/java/org/apache/fop/fonts/FontReader.java
+++ b/src/java/org/apache/fop/fonts/FontReader.java
@@ -64,7 +64,7 @@ public class FontReader extends DefaultHandler {
private Map<Integer, Integer> currentKerning = null;
- private List<CMapSegment> bfranges = null;
+ private List<BFEntry> bfranges = null;
private void createFont(InputSource source) throws FOPException {
XMLReader parser = null;
@@ -154,14 +154,12 @@ public class FontReader extends DefaultHandler {
/**
* {@inheritDoc}
*/
- @Override
public void startDocument() {
}
/**
* {@inheritDoc}
*/
- @Override
public void setDocumentLocator(Locator locator) {
// this.locator = locator; // not used at present
}
@@ -169,7 +167,6 @@ public class FontReader extends DefaultHandler {
/**
* {@inheritDoc}
*/
- @Override
public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException {
if (localName.equals("font-metrics")) {
@@ -201,9 +198,9 @@ public class FontReader extends DefaultHandler {
returnFont.putKerningEntry(new Integer(attributes.getValue("kpx1")),
currentKerning);
} else if ("bfranges".equals(localName)) {
- bfranges = new ArrayList<CMapSegment>();
+ bfranges = new ArrayList<BFEntry>();
} else if ("bf".equals(localName)) {
- CMapSegment entry = new CMapSegment(getInt(attributes.getValue("us")),
+ BFEntry entry = new BFEntry(getInt(attributes.getValue("us")),
getInt(attributes.getValue("ue")),
getInt(attributes.getValue("gi")));
bfranges.add(entry);
@@ -239,7 +236,6 @@ public class FontReader extends DefaultHandler {
/**
* {@inheritDoc}
*/
- @Override
public void endElement(String uri, String localName, String qName) throws SAXException {
String content = text.toString().trim();
if ("font-name".equals(localName)) {
@@ -307,7 +303,7 @@ public class FontReader extends DefaultHandler {
multiFont.setWidthArray(wds);
} else if ("bfranges".equals(localName)) {
- multiFont.setCMap(bfranges.toArray(new CMapSegment[0]));
+ multiFont.setBFEntries(bfranges.toArray(new BFEntry[0]));
}
text.setLength(0); //Reset text buffer (see characters())
}
@@ -315,7 +311,6 @@ public class FontReader extends DefaultHandler {
/**
* {@inheritDoc}
*/
- @Override
public void characters(char[] ch, int start, int length) {
text.append(ch, start, length);
}
diff --git a/src/java/org/apache/fop/fonts/FontType.java b/src/java/org/apache/fop/fonts/FontType.java
index edd8d0c37..56039b519 100644
--- a/src/java/org/apache/fop/fonts/FontType.java
+++ b/src/java/org/apache/fop/fonts/FontType.java
@@ -130,9 +130,4 @@ public class FontType {
return value;
}
- @Override
- public String toString() {
- return name;
- }
-
}
diff --git a/src/java/org/apache/fop/fonts/LazyFont.java b/src/java/org/apache/fop/fonts/LazyFont.java
index dfad4ffce..7077c53b9 100644
--- a/src/java/org/apache/fop/fonts/LazyFont.java
+++ b/src/java/org/apache/fop/fonts/LazyFont.java
@@ -36,6 +36,7 @@ import org.apache.fop.apps.FOPException;
import org.apache.fop.complexscripts.fonts.Positionable;
import org.apache.fop.complexscripts.fonts.Substitutable;
+
/**
* This class is used to defer the loading of a font until it is really used.
*/
@@ -48,8 +49,7 @@ public class LazyFont extends Typeface implements FontDescriptor, Substitutable,
private boolean useKerning;
private boolean useAdvanced;
private EncodingMode encodingMode = EncodingMode.AUTO;
- private EmbeddingMode embeddingMode = EmbeddingMode.AUTO;
- private boolean embedded = true;
+ private boolean embedded;
private String subFontName;
private boolean isMetricsLoaded;
@@ -74,7 +74,6 @@ public class LazyFont extends Typeface implements FontDescriptor, Substitutable,
this.useAdvanced = fontInfo.getAdvanced();
}
this.encodingMode = fontInfo.getEncodingMode();
- this.embeddingMode = fontInfo.getEmbeddingMode();
this.subFontName = fontInfo.getSubFontName();
this.embedded = fontInfo.isEmbedded();
this.resolver = resolver;
@@ -148,9 +147,8 @@ public class LazyFont extends Typeface implements FontDescriptor, Substitutable,
if (fontEmbedPath == null) {
throw new RuntimeException("Cannot load font. No font URIs available.");
}
- realFont = FontLoader.loadFont(fontEmbedPath, subFontName,
- embedded, embeddingMode, encodingMode,
- useKerning, useAdvanced, resolver);
+ realFont = FontLoader.loadFont(fontEmbedPath, this.subFontName,
+ this.embedded, this.encodingMode, useKerning, useAdvanced, resolver);
}
if (realFont instanceof FontDescriptor) {
realFontDescriptor = (FontDescriptor) realFont;
diff --git a/src/java/org/apache/fop/fonts/MultiByteFont.java b/src/java/org/apache/fop/fonts/MultiByteFont.java
index 54b772b2e..73ef7c228 100644
--- a/src/java/org/apache/fop/fonts/MultiByteFont.java
+++ b/src/java/org/apache/fop/fonts/MultiByteFont.java
@@ -51,6 +51,14 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl
private CIDSubset subset = new CIDSubset();
+ /**
+ * A map from Unicode indices to glyph indices. No assumption
+ * about ordering is made below. If lookup is changed to a binary
+ * search (from the current linear search), then addPrivateUseMapping()
+ * needs to be changed to perform ordered inserts.
+ */
+ private BFEntry[] bfentries = null;
+
/* advanced typographic support */
private GlyphDefinitionTable gdef;
private GlyphSubstitutionTable gsub;
@@ -74,31 +82,26 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl
}
/** {@inheritDoc} */
- @Override
public int getDefaultWidth() {
return defaultWidth;
}
/** {@inheritDoc} */
- @Override
public String getRegistry() {
return "Adobe";
}
/** {@inheritDoc} */
- @Override
public String getOrdering() {
return "UCS";
}
/** {@inheritDoc} */
- @Override
public int getSupplement() {
return 0;
}
/** {@inheritDoc} */
- @Override
public CIDFontType getCIDType() {
return cidType;
}
@@ -112,7 +115,6 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl
}
/** {@inheritDoc} */
- @Override
public String getEmbedFontName() {
if (isEmbeddable()) {
return FontUtil.stripWhiteSpace(super.getFontName());
@@ -126,18 +128,17 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl
return !(getEmbedFileName() == null && getEmbedResourceName() == null);
}
+ /** {@inheritDoc} */
public boolean isSubsetEmbedded() {
return true;
}
/** {@inheritDoc} */
- @Override
public CIDSubset getCIDSubset() {
return this.subset;
}
/** {@inheritDoc} */
- @Override
public String getEncodingName() {
return encoding;
}
@@ -170,30 +171,30 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl
int idx = c;
int retIdx = SingleByteEncoding.NOT_FOUND_CODE_POINT;
- for (int i = 0; (i < cmap.length) && retIdx == 0; i++) {
- if (cmap[i].getUnicodeStart() <= idx
- && cmap[i].getUnicodeEnd() >= idx) {
+ for (int i = 0; (i < bfentries.length) && retIdx == 0; i++) {
+ if (bfentries[i].getUnicodeStart() <= idx
+ && bfentries[i].getUnicodeEnd() >= idx) {
- retIdx = cmap[i].getGlyphStartIndex()
+ retIdx = bfentries[i].getGlyphStartIndex()
+ idx
- - cmap[i].getUnicodeStart();
+ - bfentries[i].getUnicodeStart();
}
}
return retIdx;
}
/**
- * Add a private use mapping {PU,GI} to the existing character map.
+ * Add a private use mapping {PU,GI} to the existing BFENTRIES map.
* N.B. Does not insert in order, merely appends to end of existing map.
*/
private synchronized void addPrivateUseMapping ( int pu, int gi ) {
assert findGlyphIndex ( pu ) == SingleByteEncoding.NOT_FOUND_CODE_POINT;
- CMapSegment[] oldCmap = cmap;
- int cmapLength = oldCmap.length;
- CMapSegment[] newCmap = new CMapSegment [ cmapLength + 1 ];
- System.arraycopy ( oldCmap, 0, newCmap, 0, cmapLength );
- newCmap [ cmapLength ] = new CMapSegment ( pu, pu, gi );
- cmap = newCmap;
+ BFEntry[] bfeOld = bfentries;
+ int bfeCnt = bfeOld.length;
+ BFEntry[] bfeNew = new BFEntry [ bfeCnt + 1 ];
+ System.arraycopy ( bfeOld, 0, bfeNew, 0, bfeCnt );
+ bfeNew [ bfeCnt ] = new BFEntry ( pu, pu, gi );
+ bfentries = bfeNew;
}
/**
@@ -251,12 +252,12 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl
// [TBD] - needs optimization, i.e., change from linear search to binary search
private int findCharacterFromGlyphIndex ( int gi, boolean augment ) {
int cc = 0;
- for ( int i = 0, n = cmap.length; i < n; i++ ) {
- CMapSegment segment = cmap [ i ];
- int s = segment.getGlyphStartIndex();
- int e = s + ( segment.getUnicodeEnd() - segment.getUnicodeStart() );
+ for ( int i = 0, n = bfentries.length; i < n; i++ ) {
+ BFEntry be = bfentries [ i ];
+ int s = be.getGlyphStartIndex();
+ int e = s + ( be.getUnicodeEnd() - be.getUnicodeStart() );
if ( ( gi >= s ) && ( gi <= e ) ) {
- cc = segment.getUnicodeStart() + ( gi - s );
+ cc = be.getUnicodeStart() + ( gi - s );
break;
}
}
@@ -272,7 +273,6 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl
/** {@inheritDoc} */
- @Override
public char mapChar(char c) {
notifyMapOperation();
int glyphIndex = findGlyphIndex(c);
@@ -287,12 +287,20 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl
}
/** {@inheritDoc} */
- @Override
public boolean hasChar(char c) {
return (findGlyphIndex(c) != SingleByteEncoding.NOT_FOUND_CODE_POINT);
}
/**
+ * Sets the array of BFEntry instances which constitutes the Unicode to glyph index map for
+ * a font. ("BF" means "base font")
+ * @param entries the Unicode to glyph index map
+ */
+ public void setBFEntries(BFEntry[] entries) {
+ this.bfentries = entries;
+ }
+
+ /**
* Sets the defaultWidth.
* @param defaultWidth The defaultWidth to set
*/
diff --git a/src/java/org/apache/fop/fonts/MutableFont.java b/src/java/org/apache/fop/fonts/MutableFont.java
index 3ebc3c465..41c552a0b 100644
--- a/src/java/org/apache/fop/fonts/MutableFont.java
+++ b/src/java/org/apache/fop/fonts/MutableFont.java
@@ -61,12 +61,6 @@ public interface MutableFont {
void setEmbedResourceName(String name);
/**
- * Sets the embedding mode.
- * @param embeddingMode the embedding mode
- */
- void setEmbeddingMode(EmbeddingMode embeddingMode);
-
- /**
* Sets the capital height value.
* @param capHeight capital height
*/
diff --git a/src/java/org/apache/fop/fonts/SingleByteFont.java b/src/java/org/apache/fop/fonts/SingleByteFont.java
index 1aed72d69..d5901297f 100644
--- a/src/java/org/apache/fop/fonts/SingleByteFont.java
+++ b/src/java/org/apache/fop/fonts/SingleByteFont.java
@@ -31,8 +31,6 @@ import org.apache.commons.logging.LogFactory;
import org.apache.xmlgraphics.fonts.Glyphs;
-import org.apache.fop.fonts.truetype.TTFFile.PostScriptVersion;
-
/**
* Generic SingleByte font
*/
@@ -50,7 +48,6 @@ public class SingleByteFont extends CustomFont {
private List<SimpleSingleByteEncoding> additionalEncodings;
private Map<Character, Character> alternativeCodes;
- private PostScriptVersion ttPostScriptVersion;
/**
* Main constructor.
@@ -400,26 +397,5 @@ public class SingleByteFont extends CustomFont {
}
}
- /**
- * Sets the version of the PostScript table stored in the TrueType font represented by
- * this instance.
- *
- * @param version version of the <q>post</q> table
- */
- public void setTrueTypePostScriptVersion(PostScriptVersion version) {
- ttPostScriptVersion = version;
- }
-
- /**
- * Returns the version of the PostScript table stored in the TrueType font represented by
- * this instance.
- *
- * @return the version of the <q>post</q> table
- */
- public PostScriptVersion getTrueTypePostScriptVersion() {
- assert getFontType() == FontType.TRUETYPE;
- return ttPostScriptVersion;
- }
-
}
diff --git a/src/java/org/apache/fop/fonts/apps/TTFReader.java b/src/java/org/apache/fop/fonts/apps/TTFReader.java
index 224c8de2f..6acb490c2 100644
--- a/src/java/org/apache/fop/fonts/apps/TTFReader.java
+++ b/src/java/org/apache/fop/fonts/apps/TTFReader.java
@@ -20,6 +20,7 @@
package org.apache.fop.fonts.apps;
import java.io.IOException;
+import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@@ -33,9 +34,9 @@ import org.xml.sax.SAXException;
import org.apache.commons.logging.LogFactory;
import org.apache.fop.Version;
-import org.apache.fop.fonts.CMapSegment;
import org.apache.fop.fonts.FontUtil;
import org.apache.fop.fonts.truetype.FontFileReader;
+import org.apache.fop.fonts.truetype.TTFCmapEntry;
import org.apache.fop.fonts.truetype.TTFFile;
import org.apache.fop.util.CommandLineLogger;
@@ -287,9 +288,9 @@ public class TTFReader extends AbstractFontReader {
root.appendChild(el);
el.appendChild(doc.createTextNode(ttf.getFullName()));
}
- Set<String> familyNames = ttf.getFamilyNames();
+ Set familyNames = ttf.getFamilyNames();
if (familyNames.size() > 0) {
- String familyName = familyNames.iterator().next();
+ String familyName = (String)familyNames.iterator().next();
el = doc.createElement("family-name");
root.appendChild(el);
el.appendChild(doc.createTextNode(familyName));
@@ -385,7 +386,9 @@ public class TTFReader extends AbstractFontReader {
el = doc.createElement("bfranges");
mel.appendChild(el);
- for (CMapSegment ce : ttf.getCMaps()) {
+ Iterator iter = ttf.getCMaps().listIterator();
+ while (iter.hasNext()) {
+ TTFCmapEntry ce = (TTFCmapEntry)iter.next();
Element el2 = doc.createElement("bf");
el.appendChild(el2);
el2.setAttribute("us", String.valueOf(ce.getUnicodeStart()));
@@ -440,28 +443,31 @@ public class TTFReader extends AbstractFontReader {
Document doc = parent.getOwnerDocument();
// Get kerning
- Set<Integer> kerningKeys;
+ Iterator iter;
if (isCid) {
- kerningKeys = ttf.getKerning().keySet();
+ iter = ttf.getKerning().keySet().iterator();
} else {
- kerningKeys = ttf.getAnsiKerning().keySet();
+ iter = ttf.getAnsiKerning().keySet().iterator();
}
- for (Integer kpx1 : kerningKeys) {
+ while (iter.hasNext()) {
+ Integer kpx1 = (Integer)iter.next();
el = doc.createElement("kerning");
el.setAttribute("kpx1", kpx1.toString());
parent.appendChild(el);
Element el2 = null;
- Map<Integer, Integer> h2;
+ Map h2;
if (isCid) {
- h2 = ttf.getKerning().get(kpx1);
+ h2 = (Map)ttf.getKerning().get(kpx1);
} else {
- h2 = ttf.getAnsiKerning().get(kpx1);
+ h2 = (Map)ttf.getAnsiKerning().get(kpx1);
}
- for (Integer kpx2 : h2.keySet()) {
+ Iterator iter2 = h2.keySet().iterator();
+ while (iter2.hasNext()) {
+ Integer kpx2 = (Integer)iter2.next();
if (isCid || kpx2.intValue() < 256) {
el2 = doc.createElement("pair");
el2.setAttribute("kpx2", kpx2.toString());
diff --git a/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java b/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java
index deee4b018..bd0a33cb1 100644
--- a/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java
+++ b/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java
@@ -32,7 +32,6 @@ import org.apache.commons.logging.LogFactory;
import org.apache.fop.fonts.CustomFont;
import org.apache.fop.fonts.EmbedFontInfo;
-import org.apache.fop.fonts.EmbeddingMode;
import org.apache.fop.fonts.EncodingMode;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.FontCache;
@@ -223,7 +222,7 @@ public class FontInfoFinder {
}
try {
TTFFontLoader ttfLoader = new TTFFontLoader(
- fontFileURL, fontName, true, EmbeddingMode.AUTO, EncodingMode.AUTO,
+ fontFileURL, fontName, true, EncodingMode.AUTO,
useKerning, useAdvanced, resolver);
customFont = ttfLoader.getFont();
if (this.eventListener != null) {
@@ -248,8 +247,7 @@ public class FontInfoFinder {
} else {
// The normal case
try {
- customFont = FontLoader.loadFont(fontURL, null, true, EmbeddingMode.AUTO,
- EncodingMode.AUTO, resolver);
+ customFont = FontLoader.loadFont(fontURL, null, true, EncodingMode.AUTO, resolver);
if (this.eventListener != null) {
customFont.setEventListener(this.eventListener);
}
diff --git a/src/java/org/apache/fop/fonts/truetype/FontFileReader.java b/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
index 5da25e4b4..b97120990 100644
--- a/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
+++ b/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
@@ -90,13 +90,23 @@ public class FontFileReader {
}
/**
+ * Set current file position to offset
+ *
+ * @param add The number of bytes to advance
+ * @throws IOException In case of an I/O problem
+ */
+ public void seekAdd(long add) throws IOException {
+ seekSet(current + add);
+ }
+
+ /**
* Skip a given number of bytes.
*
* @param add The number of bytes to advance
* @throws IOException In case of an I/O problem
*/
public void skip(long add) throws IOException {
- seekSet(current + add);
+ seekAdd(add);
}
/**
@@ -123,7 +133,7 @@ public class FontFileReader {
* @return One byte
* @throws IOException If EOF is reached
*/
- private byte read() throws IOException {
+ public byte read() throws IOException {
if (current >= fsize) {
throw new java.io.EOFException("Reached EOF, file size=" + fsize);
}
@@ -268,14 +278,14 @@ public class FontFileReader {
public final String readTTFString() throws IOException {
int i = current;
while (file[i++] != 0) {
- if (i >= fsize) {
+ if (i > fsize) {
throw new java.io.EOFException("Reached EOF, file size="
+ fsize);
}
}
- byte[] tmp = new byte[i - current - 1];
- System.arraycopy(file, current, tmp, 0, i - current - 1);
+ byte[] tmp = new byte[i - current];
+ System.arraycopy(file, current, tmp, 0, i - current);
return new String(tmp, "ISO-8859-1");
}
@@ -343,11 +353,6 @@ public class FontFileReader {
System.arraycopy(file, offset, ret, 0, length);
return ret;
}
- /**
- * Returns the full byte array representation of the file.
- * @return byte array.
- */
- public byte[] getAllBytes() {
- return file;
- }
+
+
}
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java b/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java
new file mode 100644
index 000000000..897d5e2de
--- /dev/null
+++ b/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java
@@ -0,0 +1,118 @@
+/*
+ * 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.truetype;
+
+/**
+ * The CMap entry contains information of a Unicode range and the
+ * the glyph indexes related to the range
+ */
+public class TTFCmapEntry {
+
+ private int unicodeStart;
+ private int unicodeEnd;
+ private int glyphStartIndex;
+
+ TTFCmapEntry() {
+ unicodeStart = 0;
+ unicodeEnd = 0;
+ glyphStartIndex = 0;
+ }
+
+ TTFCmapEntry(int unicodeStart, int unicodeEnd, int glyphStartIndex) {
+ this.unicodeStart = unicodeStart;
+ this.unicodeEnd = unicodeEnd;
+ this.glyphStartIndex = glyphStartIndex;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int hashCode() {
+ int hc = super.hashCode();
+ hc ^= ( hc * 11 ) + unicodeStart;
+ hc ^= ( hc * 19 ) + unicodeEnd;
+ hc ^= ( hc * 23 ) + glyphStartIndex;
+ return hc;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean equals(Object o) {
+ if (o instanceof TTFCmapEntry) {
+ TTFCmapEntry ce = (TTFCmapEntry)o;
+ if (ce.unicodeStart == this.unicodeStart
+ && ce.unicodeEnd == this.unicodeEnd
+ && ce.glyphStartIndex == this.glyphStartIndex) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Returns the glyphStartIndex.
+ * @return int
+ */
+ public int getGlyphStartIndex() {
+ return glyphStartIndex;
+ }
+
+ /**
+ * Returns the unicodeEnd.
+ * @return int
+ */
+ public int getUnicodeEnd() {
+ return unicodeEnd;
+ }
+
+ /**
+ * Returns the unicodeStart.
+ * @return int
+ */
+ public int getUnicodeStart() {
+ return unicodeStart;
+ }
+
+ /**
+ * Sets the glyphStartIndex.
+ * @param glyphStartIndex The glyphStartIndex to set
+ */
+ public void setGlyphStartIndex(int glyphStartIndex) {
+ this.glyphStartIndex = glyphStartIndex;
+ }
+
+ /**
+ * Sets the unicodeEnd.
+ * @param unicodeEnd The unicodeEnd to set
+ */
+ public void setUnicodeEnd(int unicodeEnd) {
+ this.unicodeEnd = unicodeEnd;
+ }
+
+ /**
+ * Sets the unicodeStart.
+ * @param unicodeStart The unicodeStart to set
+ */
+ public void setUnicodeStart(int unicodeStart) {
+ this.unicodeStart = unicodeStart;
+ }
+
+}
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFDirTabEntry.java b/src/java/org/apache/fop/fonts/truetype/TTFDirTabEntry.java
index c273d4471..1f05ebfa1 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFDirTabEntry.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFDirTabEntry.java
@@ -33,14 +33,6 @@ public class TTFDirTabEntry {
private long offset;
private long length;
- public TTFDirTabEntry() {
- }
-
- public TTFDirTabEntry(long offset, long length) {
- this.offset = offset;
- this.length = length;
- }
-
/**
* Read Dir Tab.
* @param in font file reader
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFFile.java b/src/java/org/apache/fop/fonts/truetype/TTFFile.java
index bc979f277..65ab560cf 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFFile.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFFile.java
@@ -20,18 +20,11 @@
package org.apache.fop.fonts.truetype;
import java.io.IOException;
-import java.util.ArrayList;
import java.util.BitSet;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -43,7 +36,6 @@ import org.apache.fop.complexscripts.fonts.GlyphDefinitionTable;
import org.apache.fop.complexscripts.fonts.GlyphPositioningTable;
import org.apache.fop.complexscripts.fonts.GlyphSubstitutionTable;
import org.apache.fop.complexscripts.fonts.OTFAdvancedTypographicTableReader;
-import org.apache.fop.fonts.CMapSegment;
import org.apache.fop.fonts.FontUtil;
/**
@@ -54,100 +46,10 @@ import org.apache.fop.fonts.FontUtil;
public class TTFFile {
static final byte NTABS = 24;
+ static final int NMACGLYPHS = 258;
static final int MAX_CHAR_CODE = 255;
static final int ENC_BUF_SIZE = 1024;
- private static final String[] MAC_GLYPH_ORDERING = {
- /* 0x000 */
- ".notdef", ".null", "nonmarkingreturn", "space",
- "exclam", "quotedbl", "numbersign", "dollar",
- "percent", "ampersand", "quotesingle", "parenleft",
- "parenright", "asterisk", "plus", "comma",
- /* 0x010 */
- "hyphen", "period", "slash", "zero",
- "one", "two", "three", "four",
- "five", "six", "seven", "eight",
- "nine", "colon", "semicolon", "less",
- /* 0x020 */
- "equal", "greater", "question", "at",
- "A", "B", "C", "D",
- "E", "F", "G", "H",
- "I", "J", "K", "L",
- /* 0x030 */
- "M", "N", "O", "P",
- "Q", "R", "S", "T",
- "U", "V", "W", "X",
- "Y", "Z", "bracketleft", "backslash",
- /* 0x040 */
- "bracketright", "asciicircum", "underscore", "grave",
- "a", "b", "c", "d",
- "e", "f", "g", "h",
- "i", "j", "k", "l",
- /* 0x050 */
- "m", "n", "o", "p",
- "q", "r", "s", "t",
- "u", "v", "w", "x",
- "y", "z", "braceleft", "bar",
- /* 0x060 */
- "braceright", "asciitilde", "Adieresis", "Aring",
- "Ccedilla", "Eacute", "Ntilde", "Odieresis",
- "Udieresis", "aacute", "agrave", "acircumflex",
- "adieresis", "atilde", "aring", "ccedilla",
- /* 0x070 */
- "eacute", "egrave", "ecircumflex", "edieresis",
- "iacute", "igrave", "icircumflex", "idieresis",
- "ntilde", "oacute", "ograve", "ocircumflex",
- "odieresis", "otilde", "uacute", "ugrave",
- /* 0x080 */
- "ucircumflex", "udieresis", "dagger", "degree",
- "cent", "sterling", "section", "bullet",
- "paragraph", "germandbls", "registered", "copyright",
- "trademark", "acute", "dieresis", "notequal",
- /* 0x090 */
- "AE", "Oslash", "infinity", "plusminus",
- "lessequal", "greaterequal", "yen", "mu",
- "partialdiff", "summation", "product", "pi",
- "integral", "ordfeminine", "ordmasculine", "Omega",
- /* 0x0A0 */
- "ae", "oslash", "questiondown", "exclamdown",
- "logicalnot", "radical", "florin", "approxequal",
- "Delta", "guillemotleft", "guillemotright", "ellipsis",
- "nonbreakingspace", "Agrave", "Atilde", "Otilde",
- /* 0x0B0 */
- "OE", "oe", "endash", "emdash",
- "quotedblleft", "quotedblright", "quoteleft", "quoteright",
- "divide", "lozenge", "ydieresis", "Ydieresis",
- "fraction", "currency", "guilsinglleft", "guilsinglright",
- /* 0x0C0 */
- "fi", "fl", "daggerdbl", "periodcentered",
- "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex",
- "Ecircumflex", "Aacute", "Edieresis", "Egrave",
- "Iacute", "Icircumflex", "Idieresis", "Igrave",
- /* 0x0D0 */
- "Oacute", "Ocircumflex", "apple", "Ograve",
- "Uacute", "Ucircumflex", "Ugrave", "dotlessi",
- "circumflex", "tilde", "macron", "breve",
- "dotaccent", "ring", "cedilla", "hungarumlaut",
- /* 0x0E0 */
- "ogonek", "caron", "Lslash", "lslash",
- "Scaron", "scaron", "Zcaron", "zcaron",
- "brokenbar", "Eth", "eth", "Yacute",
- "yacute", "Thorn", "thorn", "minus",
- /* 0x0F0 */
- "multiply", "onesuperior", "twosuperior", "threesuperior",
- "onehalf", "onequarter", "threequarters", "franc",
- "Gbreve", "gbreve", "Idotaccent", "Scedilla",
- "scedilla", "Cacute", "cacute", "Ccaron",
- /* 0x100 */
- "ccaron", "dcroat"
- };
-
- /** The FontFileReader used to read this TrueType font. */
- protected FontFileReader fontFile;
-
- /** Set to true to get even more debug output than with level DEBUG */
- public static final boolean TRACE_ENABLED = false;
-
private final String encoding = "WinAnsiEncoding"; // Default encoding
private final short firstChar = 0;
@@ -159,31 +61,33 @@ public class TTFFile {
/**
* Table directory
*/
- protected Map<TTFTableName, TTFDirTabEntry> dirTabs;
- private Map<Integer, Map<Integer, Integer>> kerningTab; // for CIDs
+ protected Map dirTabs;
+ private Map<Integer, Map<Integer, Integer>> kerningTab; // for CIDs
private Map<Integer, Map<Integer, Integer>> ansiKerningTab; // For winAnsiEncoding
- private List<CMapSegment> cmaps;
- private Set<UnicodeMapping> unicodeMappings;
+ private List cmaps;
+ private Set unicodeMappings;
private int upem; // unitsPerEm from "head" table
private int nhmtx; // Number of horizontal metrics
- private PostScriptVersion postScriptVersion;
+ private int postFormat;
private int locaFormat;
/**
* Offset to last loca
*/
protected long lastLoca = 0;
private int numberOfGlyphs; // Number of glyphs in font (read from "maxp" table)
+ private int nmGlyphs; // Used in fixWidths - remove?
/**
* Contains glyph data
*/
protected TTFMtxEntry[] mtxTab; // Contains glyph data
+ private final int[] mtxEncoded = null;
private String postScriptName = "";
private String fullName = "";
private String notice = "";
- private Set<String> familyNames = new HashSet<String>();
+ private final Set familyNames = new java.util.HashSet(); //Set<String>
private String subFamilyName = "";
private long italicAngle = 0;
@@ -212,12 +116,12 @@ public class TTFFile {
private short lastChar = 0;
private int[] ansiWidth;
- private Map<Integer, List<Integer>> ansiIndex;
+ private Map ansiIndex;
// internal mapping of glyph indexes to unicode indexes
// used for quick mappings in this class
- private final Map<Integer, Integer> glyphToUnicodeMap = new HashMap<Integer, Integer> ();
- private final Map<Integer, Integer> unicodeToGlyphMap = new HashMap<Integer, Integer> ();
+ private final Map glyphToUnicodeMap = new java.util.HashMap();
+ private final Map unicodeToGlyphMap = new java.util.HashMap();
private TTFDirTabEntry currentDirTab;
@@ -232,10 +136,6 @@ public class TTFFile {
*/
protected Log log = LogFactory.getLog(TTFFile.class);
- public TTFFile() {
- this(true, false);
- }
-
/**
* Constructor
* @param useKerning true if kerning data should be loaded
@@ -247,9 +147,9 @@ public class TTFFile {
}
/**
- * Key-value helper class.
+ * Key-value helper class
*/
- final class UnicodeMapping implements Comparable {
+ class UnicodeMapping implements Comparable {
private final int unicodeIndex;
private final int glyphIndex;
@@ -317,42 +217,28 @@ public class TTFFile {
}
/**
- * Version of the PostScript table (<q>post</q>) contained in this font.
- */
- public static enum PostScriptVersion {
- /** PostScript table version 1.0. */
- V1,
- /** PostScript table version 2.0. */
- V2,
- /** PostScript table version 3.0. */
- V3,
- /** Unknown version of the PostScript table. */
- UNKNOWN;
- }
-
- /**
* Obtain directory table entry.
* @param name (tag) of entry
* @return a directory table entry or null if none found
*/
- public TTFDirTabEntry getDirectoryEntry(TTFTableName name) {
- return dirTabs.get(name);
+ public TTFDirTabEntry getDirectoryEntry ( String name ) {
+ return (TTFDirTabEntry) dirTabs.get ( name );
}
/**
* Position inputstream to position indicated
* in the dirtab offset + offset
* @param in font file reader
- * @param tableName (tag) of table
+ * @param name (tag) of table
* @param offset from start of table
* @return true if seek succeeded
* @throws IOException if I/O exception occurs during seek
*/
- public boolean seekTab(FontFileReader in, TTFTableName tableName,
+ public boolean seekTab(FontFileReader in, String name,
long offset) throws IOException {
- TTFDirTabEntry dt = dirTabs.get(tableName);
+ TTFDirTabEntry dt = getDirectoryEntry ( name );
if (dt == null) {
- log.error("Dirtab " + tableName.getName() + " not found.");
+ log.error("Dirtab " + name + " not found.");
return false;
} else {
in.seekSet(dt.getOffset() + offset);
@@ -388,12 +274,12 @@ public class TTFFile {
* Set the unicodeIndex in the TTFMtxEntries and fills in the
* cmaps vector.
*/
- private boolean readCMAP() throws IOException {
+ private boolean readCMAP(FontFileReader in) throws IOException {
unicodeMappings = new java.util.TreeSet();
- seekTab(fontFile, TTFTableName.CMAP, 2);
- int numCMap = fontFile.readTTFUShort(); // Number of cmap subtables
+ seekTab(in, "cmap", 2);
+ int numCMap = in.readTTFUShort(); // Number of cmap subtables
long cmapUniOffset = 0;
long symbolMapOffset = 0;
@@ -403,9 +289,9 @@ public class TTFFile {
//Read offset for all tables. We are only interested in the unicode table
for (int i = 0; i < numCMap; i++) {
- int cmapPID = fontFile.readTTFUShort();
- int cmapEID = fontFile.readTTFUShort();
- long cmapOffset = fontFile.readTTFLong();
+ int cmapPID = in.readTTFUShort();
+ int cmapEID = in.readTTFUShort();
+ long cmapOffset = in.readTTFULong();
if (log.isDebugEnabled()) {
log.debug("Platform ID: " + cmapPID + " Encoding: " + cmapEID);
@@ -420,9 +306,9 @@ public class TTFFile {
}
if (cmapUniOffset > 0) {
- return readUnicodeCmap(cmapUniOffset, 1);
+ return readUnicodeCmap(in, cmapUniOffset, 1);
} else if (symbolMapOffset > 0) {
- return readUnicodeCmap(symbolMapOffset, 0);
+ return readUnicodeCmap(in, symbolMapOffset, 0);
} else {
log.fatal("Unsupported TrueType font: No Unicode or Symbol cmap table"
+ " not present. Aborting");
@@ -431,26 +317,26 @@ public class TTFFile {
}
private boolean readUnicodeCmap // CSOK: MethodLength
- (long cmapUniOffset, int encodingID)
+ (FontFileReader in, long cmapUniOffset, int encodingID)
throws IOException {
//Read CMAP table and correct mtxTab.index
int mtxPtr = 0;
// Read unicode cmap
- seekTab(fontFile, TTFTableName.CMAP, cmapUniOffset);
- int cmapFormat = fontFile.readTTFUShort();
- /*int cmap_length =*/ fontFile.readTTFUShort(); //skip cmap length
+ seekTab(in, "cmap", cmapUniOffset);
+ int cmapFormat = in.readTTFUShort();
+ /*int cmap_length =*/ in.readTTFUShort(); //skip cmap length
if (log.isDebugEnabled()) {
log.debug("CMAP format: " + cmapFormat);
}
if (cmapFormat == 4) {
- fontFile.skip(2); // Skip version number
- int cmapSegCountX2 = fontFile.readTTFUShort();
- int cmapSearchRange = fontFile.readTTFUShort();
- int cmapEntrySelector = fontFile.readTTFUShort();
- int cmapRangeShift = fontFile.readTTFUShort();
+ in.skip(2); // Skip version number
+ int cmapSegCountX2 = in.readTTFUShort();
+ int cmapSearchRange = in.readTTFUShort();
+ int cmapEntrySelector = in.readTTFUShort();
+ int cmapRangeShift = in.readTTFUShort();
if (log.isDebugEnabled()) {
log.debug("segCountX2 : " + cmapSegCountX2);
@@ -466,26 +352,26 @@ public class TTFFile {
int[] cmapRangeOffsets = new int[cmapSegCountX2 / 2];
for (int i = 0; i < (cmapSegCountX2 / 2); i++) {
- cmapEndCounts[i] = fontFile.readTTFUShort();
+ cmapEndCounts[i] = in.readTTFUShort();
}
- fontFile.skip(2); // Skip reservedPad
+ in.skip(2); // Skip reservedPad
for (int i = 0; i < (cmapSegCountX2 / 2); i++) {
- cmapStartCounts[i] = fontFile.readTTFUShort();
+ cmapStartCounts[i] = in.readTTFUShort();
}
for (int i = 0; i < (cmapSegCountX2 / 2); i++) {
- cmapDeltas[i] = fontFile.readTTFShort();
+ cmapDeltas[i] = in.readTTFShort();
}
//int startRangeOffset = in.getCurrentPos();
for (int i = 0; i < (cmapSegCountX2 / 2); i++) {
- cmapRangeOffsets[i] = fontFile.readTTFUShort();
+ cmapRangeOffsets[i] = in.readTTFUShort();
}
- int glyphIdArrayOffset = fontFile.getCurrentPos();
+ int glyphIdArrayOffset = in.getCurrentPos();
BitSet eightBitGlyphs = new BitSet(256);
@@ -527,17 +413,19 @@ public class TTFFile {
+ (j - cmapStartCounts[i])
+ (i)
- cmapSegCountX2 / 2) * 2;
- fontFile.seekSet(glyphOffset);
- glyphIdx = (fontFile.readTTFUShort() + cmapDeltas[i])
+ in.seekSet(glyphOffset);
+ glyphIdx = (in.readTTFUShort() + cmapDeltas[i])
& 0xffff;
unicodeMappings.add(new UnicodeMapping(glyphIdx, j));
mtxTab[glyphIdx].getUnicodeIndex().add(new Integer(j));
// Also add winAnsiWidth
- List<Integer> v = ansiIndex.get(new Integer(j));
+ List v = (List)ansiIndex.get(new Integer(j));
if (v != null) {
- for (Integer aIdx : v) {
+ Iterator e = v.listIterator();
+ while (e.hasNext()) {
+ Integer aIdx = (Integer)e.next();
ansiWidth[aIdx.intValue()]
= mtxTab[glyphIdx].getWx();
@@ -578,9 +466,11 @@ public class TTFFile {
}
// Also add winAnsiWidth
- List<Integer> v = ansiIndex.get(new Integer(j));
+ List v = (List)ansiIndex.get(new Integer(j));
if (v != null) {
- for (Integer aIdx : v) {
+ Iterator e = v.listIterator();
+ while (e.hasNext()) {
+ Integer aIdx = (Integer)e.next();
ansiWidth[aIdx.intValue()] = mtxTab[glyphIdx].getWx();
}
}
@@ -658,14 +548,14 @@ public class TTFFile {
// Create an index hash to the ansiWidth
// Can't just index the winAnsiEncoding when inserting widths
// same char (eg bullet) is repeated more than one place
- ansiIndex = new HashMap<Integer, List<Integer>>();
+ ansiIndex = new java.util.HashMap();
for (int i = 32; i < Glyphs.WINANSI_ENCODING.length; i++) {
Integer ansi = new Integer(i);
Integer uni = new Integer(Glyphs.WINANSI_ENCODING[i]);
- List<Integer> v = ansiIndex.get(uni);
+ List v = (List)ansiIndex.get(uni);
if (v == null) {
- v = new ArrayList<Integer>();
+ v = new java.util.ArrayList();
ansiIndex.put(uni, v);
}
v.add(ansi);
@@ -684,12 +574,12 @@ public class TTFFile {
* @throws IOException In case of an I/O problem
*/
public boolean readFont(FontFileReader in, String name) throws IOException {
- fontFile = in;
+
/*
* Check if TrueType collection, and that the name
* exists in the collection
*/
- if (!checkTTC(name)) {
+ if (!checkTTC(in, name)) {
if (name == null) {
throw new IllegalArgumentException(
"For TrueType collection you must specify which font "
@@ -700,26 +590,26 @@ public class TTFFile {
}
}
- readDirTabs();
- readFontHeader();
- getNumGlyphs();
+ readDirTabs(in);
+ readFontHeader(in);
+ getNumGlyphs(in);
if (log.isDebugEnabled()) {
log.debug("Number of glyphs in font: " + numberOfGlyphs);
}
- readHorizontalHeader();
- readHorizontalMetrics();
+ readHorizontalHeader(in);
+ readHorizontalMetrics(in);
initAnsiWidths();
- readPostScript();
- readOS2();
+ readPostScript(in);
+ readOS2(in);
determineAscDesc();
if (!isCFF) {
- readIndexToLocation();
- readGlyf();
+ readIndexToLocation(in);
+ readGlyf(in);
}
- readName();
- boolean pcltFound = readPCLT();
+ readName(in);
+ boolean pcltFound = readPCLT(in);
// Read cmap table and fill in ansiwidths
- boolean valid = readCMAP();
+ boolean valid = readCMAP(in);
if (!valid) {
return false;
}
@@ -727,7 +617,7 @@ public class TTFFile {
createCMaps();
if ( useKerning ) {
- readKerning();
+ readKerning(in);
}
// Read advanced typographic tables.
@@ -750,47 +640,33 @@ public class TTFFile {
return true;
}
- /**
- * Reads a font.
- *
- * @param in FontFileReader to read from
- * @param name Name to be checked for in the font file
- * @param glyphs Map of glyphs (glyphs has old index as (Integer) key and
- * new index as (Integer) value)
- * @throws IOException in case of an I/O problem
- */
- public void readFont(FontFileReader in, String name,
- Map<Integer, Integer> glyphs) throws IOException {
- readFont(in, name);
- }
-
private void createCMaps() {
- cmaps = new ArrayList<CMapSegment>();
- int unicodeStart;
- int glyphStart;
- int unicodeEnd;
+ cmaps = new java.util.ArrayList();
+ TTFCmapEntry tce = new TTFCmapEntry();
- Iterator<UnicodeMapping> e = unicodeMappings.iterator();
- UnicodeMapping um = e.next();
+ Iterator e = unicodeMappings.iterator();
+ UnicodeMapping um = (UnicodeMapping)e.next();
UnicodeMapping lastMapping = um;
- unicodeStart = um.getUnicodeIndex();
- glyphStart = um.getGlyphIndex();
+ tce.setUnicodeStart(um.getUnicodeIndex());
+ tce.setGlyphStartIndex(um.getGlyphIndex());
while (e.hasNext()) {
- um = e.next();
+ um = (UnicodeMapping)e.next();
if (((lastMapping.getUnicodeIndex() + 1) != um.getUnicodeIndex())
|| ((lastMapping.getGlyphIndex() + 1) != um.getGlyphIndex())) {
- unicodeEnd = lastMapping.getUnicodeIndex();
- cmaps.add(new CMapSegment(unicodeStart, unicodeEnd, glyphStart));
- unicodeStart = um.getUnicodeIndex();
- glyphStart = um.getGlyphIndex();
+ tce.setUnicodeEnd(lastMapping.getUnicodeIndex());
+ cmaps.add(tce);
+
+ tce = new TTFCmapEntry();
+ tce.setUnicodeStart(um.getUnicodeIndex());
+ tce.setGlyphStartIndex(um.getGlyphIndex());
}
lastMapping = um;
}
- unicodeEnd = lastMapping.getUnicodeIndex();
- cmaps.add(new CMapSegment(unicodeStart, unicodeEnd, glyphStart));
+ tce.setUnicodeEnd(um.getUnicodeIndex());
+ cmaps.add(tce);
}
/**
@@ -805,15 +681,11 @@ public class TTFFile {
}
}
- PostScriptVersion getPostScriptVersion() {
- return postScriptVersion;
- }
-
/**
* Returns the font family names of the font.
* @return Set The family names (a Set of Strings)
*/
- public Set<String> getFamilyNames() {
+ public Set getFamilyNames() {
return familyNames;
}
@@ -858,30 +730,19 @@ public class TTFFile {
}
/**
- * Returns the number of bytes necessary to pad the currentPosition so that a table begins
- * on a 4-byte boundary.
- * @param currentPosition the position to pad.
- * @return int the number of bytes to pad.
- */
- protected int getPadSize(int currentPosition) {
- int padSize = 4 - (currentPosition % 4);
- return padSize < 4 ? padSize : 0;
- }
-
- /**
* Returns the Flags attribute of the font.
* @return int The Flags
*/
public int getFlags() {
int flags = 32; // Use Adobe Standard charset
if (italicAngle != 0) {
- flags |= 64;
+ flags = flags | 64;
}
if (isFixedPitch != 0) {
- flags |= 2;
+ flags = flags | 2;
}
if (hasSerifs) {
- flags |= 1;
+ flags = flags | 1;
}
return flags;
}
@@ -919,6 +780,7 @@ public class TTFFile {
}
/**
+ * Returns the font bounding box.
* @return int[] The font bbox
*/
public int[] getFontBBox() {
@@ -1024,10 +886,11 @@ public class TTFFile {
* FontFileReader and fill the global HashMap dirTabs
* with the table name (String) as key and a TTFDirTabEntry
* as value.
+ * @param in FontFileReader to read the table directory from
* @throws IOException in case of an I/O problem
*/
- protected void readDirTabs() throws IOException {
- int sfntVersion = fontFile.readTTFLong(); // TTF_FIXED_SIZE (4 bytes)
+ protected void readDirTabs(FontFileReader in) throws IOException {
+ int sfntVersion = in.readTTFLong(); // TTF_FIXED_SIZE (4 bytes)
switch (sfntVersion) {
case 0x10000:
log.debug("sfnt version: OpenType 1.0");
@@ -1046,45 +909,42 @@ public class TTFFile {
log.debug("Unknown sfnt version: " + Integer.toHexString(sfntVersion));
break;
}
- int ntabs = fontFile.readTTFUShort();
- fontFile.skip(6); // 3xTTF_USHORT_SIZE
+ int ntabs = in.readTTFUShort();
+ in.skip(6); // 3xTTF_USHORT_SIZE
- dirTabs = new HashMap<TTFTableName, TTFDirTabEntry>();
+ dirTabs = new java.util.HashMap();
TTFDirTabEntry[] pd = new TTFDirTabEntry[ntabs];
log.debug("Reading " + ntabs + " dir tables");
-
for (int i = 0; i < ntabs; i++) {
pd[i] = new TTFDirTabEntry();
- String tableName = pd[i].read(fontFile);
- dirTabs.put(TTFTableName.getValue(tableName), pd[i]);
+ dirTabs.put(pd[i].read(in), pd[i]);
}
- dirTabs.put(TTFTableName.TABLE_DIRECTORY,
- new TTFDirTabEntry(0L, fontFile.getCurrentPos()));
log.debug("dir tables: " + dirTabs.keySet());
}
/**
* Read the "head" table, this reads the bounding box and
* sets the upem (unitsPerEM) variable
+ * @param in FontFileReader to read the header from
* @throws IOException in case of an I/O problem
*/
- protected void readFontHeader() throws IOException {
- seekTab(fontFile, TTFTableName.HEAD, 2 * 4 + 2 * 4);
- int flags = fontFile.readTTFUShort();
+ protected void readFontHeader(FontFileReader in) throws IOException {
+ seekTab(in, "head", 2 * 4 + 2 * 4);
+ int flags = in.readTTFUShort();
if (log.isDebugEnabled()) {
log.debug("flags: " + flags + " - " + Integer.toString(flags, 2));
}
- upem = fontFile.readTTFUShort();
+ upem = in.readTTFUShort();
if (log.isDebugEnabled()) {
log.debug("unit per em: " + upem);
}
- fontFile.skip(16);
+ in.skip(16);
- fontBBox1 = fontFile.readTTFShort();
- fontBBox2 = fontFile.readTTFShort();
- fontBBox3 = fontFile.readTTFShort();
- fontBBox4 = fontFile.readTTFShort();
+ fontBBox1 = in.readTTFShort();
+ fontBBox2 = in.readTTFShort();
+ fontBBox3 = in.readTTFShort();
+ fontBBox4 = in.readTTFShort();
if (log.isDebugEnabled()) {
log.debug("font bbox: xMin=" + fontBBox1
+ " yMin=" + fontBBox2
@@ -1092,18 +952,19 @@ public class TTFFile {
+ " yMax=" + fontBBox4);
}
- fontFile.skip(2 + 2 + 2);
+ in.skip(2 + 2 + 2);
- locaFormat = fontFile.readTTFShort();
+ locaFormat = in.readTTFShort();
}
/**
* Read the number of glyphs from the "maxp" table
+ * @param in FontFileReader to read the number of glyphs from
* @throws IOException in case of an I/O problem
*/
- protected void getNumGlyphs() throws IOException {
- seekTab(fontFile, TTFTableName.MAXP, 4);
- numberOfGlyphs = fontFile.readTTFUShort();
+ protected void getNumGlyphs(FontFileReader in) throws IOException {
+ seekTab(in, "maxp", 4);
+ numberOfGlyphs = in.readTTFUShort();
}
@@ -1111,16 +972,17 @@ public class TTFFile {
* Read the "hhea" table to find the ascender and descender and
* size of "hmtx" table, as a fixed size font might have only
* one width.
+ * @param in FontFileReader to read the hhea table from
* @throws IOException in case of an I/O problem
*/
- protected void readHorizontalHeader()
+ protected void readHorizontalHeader(FontFileReader in)
throws IOException {
- seekTab(fontFile, TTFTableName.HHEA, 4);
- hheaAscender = fontFile.readTTFShort();
- hheaDescender = fontFile.readTTFShort();
+ seekTab(in, "hhea", 4);
+ hheaAscender = in.readTTFShort();
+ hheaDescender = in.readTTFShort();
- fontFile.skip(2 + 2 + 3 * 2 + 8 * 2);
- nhmtx = fontFile.readTTFUShort();
+ in.skip(2 + 2 + 3 * 2 + 8 * 2);
+ nhmtx = in.readTTFUShort();
if (log.isDebugEnabled()) {
log.debug("hhea.Ascender: " + formatUnitsForDebug(hheaAscender));
@@ -1134,11 +996,12 @@ public class TTFFile {
* in the mtxTab array. If the number of metrics is less
* than the number of glyphs (eg fixed size fonts), extend
* the mtxTab array and fill in the missing widths
+ * @param in FontFileReader to read the hmtx table from
* @throws IOException in case of an I/O problem
*/
- protected void readHorizontalMetrics()
+ protected void readHorizontalMetrics(FontFileReader in)
throws IOException {
- seekTab(fontFile, TTFTableName.HMTX, 0);
+ seekTab(in, "hmtx", 0);
int mtxSize = Math.max(numberOfGlyphs, nhmtx);
mtxTab = new TTFMtxEntry[mtxSize];
@@ -1150,8 +1013,8 @@ public class TTFFile {
mtxTab[i] = new TTFMtxEntry();
}
for (int i = 0; i < nhmtx; i++) {
- mtxTab[i].setWx(fontFile.readTTFUShort());
- mtxTab[i].setLsb(fontFile.readTTFUShort());
+ mtxTab[i].setWx(in.readTTFUShort());
+ mtxTab[i].setLsb(in.readTTFUShort());
if (log.isTraceEnabled()) {
log.trace(" width[" + i + "] = "
@@ -1164,7 +1027,7 @@ public class TTFFile {
int lastWidth = mtxTab[nhmtx - 1].getWx();
for (int i = nhmtx; i < mtxSize; i++) {
mtxTab[i].setWx(lastWidth);
- mtxTab[i].setLsb(fontFile.readTTFUShort());
+ mtxTab[i].setLsb(in.readTTFUShort());
}
}
}
@@ -1174,37 +1037,35 @@ public class TTFFile {
* Read the "post" table
* containing the PostScript names of the glyphs.
*/
- private void readPostScript() throws IOException {
- seekTab(fontFile, TTFTableName.POST, 0);
- int postFormat = fontFile.readTTFLong();
- italicAngle = fontFile.readTTFULong();
- underlinePosition = fontFile.readTTFShort();
- underlineThickness = fontFile.readTTFShort();
- isFixedPitch = fontFile.readTTFULong();
+ private void readPostScript(FontFileReader in) throws IOException {
+ seekTab(in, "post", 0);
+ postFormat = in.readTTFLong();
+ italicAngle = in.readTTFULong();
+ underlinePosition = in.readTTFShort();
+ underlineThickness = in.readTTFShort();
+ isFixedPitch = in.readTTFULong();
//Skip memory usage values
- fontFile.skip(4 * 4);
+ in.skip(4 * 4);
log.debug("PostScript format: 0x" + Integer.toHexString(postFormat));
switch (postFormat) {
case 0x00010000:
log.debug("PostScript format 1");
- postScriptVersion = PostScriptVersion.V1;
- for (int i = 0; i < MAC_GLYPH_ORDERING.length; i++) {
- mtxTab[i].setName(MAC_GLYPH_ORDERING[i]);
+ for (int i = 0; i < Glyphs.MAC_GLYPH_NAMES.length; i++) {
+ mtxTab[i].setName(Glyphs.MAC_GLYPH_NAMES[i]);
}
break;
case 0x00020000:
log.debug("PostScript format 2");
- postScriptVersion = PostScriptVersion.V2;
int numGlyphStrings = 0;
// Read Number of Glyphs
- int l = fontFile.readTTFUShort();
+ int l = in.readTTFUShort();
// Read indexes
for (int i = 0; i < l; i++) {
- mtxTab[i].setIndex(fontFile.readTTFUShort());
+ mtxTab[i].setIndex(in.readTTFUShort());
if (mtxTab[i].getIndex() > 257) {
//Index is not in the Macintosh standard set
@@ -1224,16 +1085,16 @@ public class TTFFile {
+ " set. Total number of glyphs=" + l);
}
for (int i = 0; i < psGlyphsBuffer.length; i++) {
- psGlyphsBuffer[i] = fontFile.readTTFString(fontFile.readTTFUByte());
+ psGlyphsBuffer[i] = in.readTTFString(in.readTTFUByte());
}
//Set glyph names
for (int i = 0; i < l; i++) {
- if (mtxTab[i].getIndex() < MAC_GLYPH_ORDERING.length) {
- mtxTab[i].setName(MAC_GLYPH_ORDERING[mtxTab[i].getIndex()]);
+ if (mtxTab[i].getIndex() < NMACGLYPHS) {
+ mtxTab[i].setName(Glyphs.MAC_GLYPH_NAMES[mtxTab[i].getIndex()]);
} else {
if (!mtxTab[i].isIndexReserved()) {
- int k = mtxTab[i].getIndex() - MAC_GLYPH_ORDERING.length;
+ int k = mtxTab[i].getIndex() - NMACGLYPHS;
if (log.isTraceEnabled()) {
log.trace(k + " i=" + i + " mtx=" + mtxTab.length
@@ -1249,11 +1110,9 @@ public class TTFFile {
case 0x00030000:
// PostScript format 3 contains no glyph names
log.debug("PostScript format 3");
- postScriptVersion = PostScriptVersion.V3;
break;
default:
log.error("Unknown PostScript format: " + postFormat);
- postScriptVersion = PostScriptVersion.UNKNOWN;
}
}
@@ -1261,60 +1120,60 @@ public class TTFFile {
/**
* Read the "OS/2" table
*/
- private void readOS2() throws IOException {
+ private void readOS2(FontFileReader in) throws IOException {
// Check if font is embeddable
- TTFDirTabEntry os2Entry = dirTabs.get(TTFTableName.OS2);
+ TTFDirTabEntry os2Entry = getDirectoryEntry ( "OS/2" );
if (os2Entry != null) {
- seekTab(fontFile, TTFTableName.OS2, 0);
- int version = fontFile.readTTFUShort();
+ seekTab(in, "OS/2", 0);
+ int version = in.readTTFUShort();
if (log.isDebugEnabled()) {
log.debug("OS/2 table: version=" + version
+ ", offset=" + os2Entry.getOffset() + ", len=" + os2Entry.getLength());
}
- fontFile.skip(2); //xAvgCharWidth
- this.usWeightClass = fontFile.readTTFUShort();
+ in.skip(2); //xAvgCharWidth
+ this.usWeightClass = in.readTTFUShort();
// usWidthClass
- fontFile.skip(2);
+ in.skip(2);
- int fsType = fontFile.readTTFUShort();
+ int fsType = in.readTTFUShort();
if (fsType == 2) {
isEmbeddable = false;
} else {
isEmbeddable = true;
}
- fontFile.skip(11 * 2);
- fontFile.skip(10); //panose array
- fontFile.skip(4 * 4); //unicode ranges
- fontFile.skip(4);
- fontFile.skip(3 * 2);
+ in.skip(11 * 2);
+ in.skip(10); //panose array
+ in.skip(4 * 4); //unicode ranges
+ in.skip(4);
+ in.skip(3 * 2);
int v;
- os2Ascender = fontFile.readTTFShort(); //sTypoAscender
- os2Descender = fontFile.readTTFShort(); //sTypoDescender
+ os2Ascender = in.readTTFShort(); //sTypoAscender
+ os2Descender = in.readTTFShort(); //sTypoDescender
if (log.isDebugEnabled()) {
log.debug("sTypoAscender: " + os2Ascender
+ " -> internal " + convertTTFUnit2PDFUnit(os2Ascender));
log.debug("sTypoDescender: " + os2Descender
+ " -> internal " + convertTTFUnit2PDFUnit(os2Descender));
}
- v = fontFile.readTTFShort(); //sTypoLineGap
+ v = in.readTTFShort(); //sTypoLineGap
if (log.isDebugEnabled()) {
log.debug("sTypoLineGap: " + v);
}
- v = fontFile.readTTFUShort(); //usWinAscent
+ v = in.readTTFUShort(); //usWinAscent
if (log.isDebugEnabled()) {
log.debug("usWinAscent: " + formatUnitsForDebug(v));
}
- v = fontFile.readTTFUShort(); //usWinDescent
+ v = in.readTTFUShort(); //usWinDescent
if (log.isDebugEnabled()) {
log.debug("usWinDescent: " + formatUnitsForDebug(v));
}
//version 1 OS/2 table might end here
if (os2Entry.getLength() >= 78 + (2 * 4) + (2 * 2)) {
- fontFile.skip(2 * 4);
- this.os2xHeight = fontFile.readTTFShort(); //sxHeight
- this.os2CapHeight = fontFile.readTTFShort(); //sCapHeight
+ in.skip(2 * 4);
+ this.os2xHeight = in.readTTFShort(); //sxHeight
+ this.os2CapHeight = in.readTTFShort(); //sCapHeight
if (log.isDebugEnabled()) {
log.debug("sxHeight: " + this.os2xHeight);
log.debug("sCapHeight: " + this.os2CapHeight);
@@ -1328,40 +1187,42 @@ public class TTFFile {
/**
* Read the "loca" table.
+ * @param in FontFileReader to read from
* @throws IOException In case of a I/O problem
*/
- protected final void readIndexToLocation()
+ protected final void readIndexToLocation(FontFileReader in)
throws IOException {
- if (!seekTab(fontFile, TTFTableName.LOCA, 0)) {
+ if (!seekTab(in, "loca", 0)) {
throw new IOException("'loca' table not found, happens when the font file doesn't"
+ " contain TrueType outlines (trying to read an OpenType CFF font maybe?)");
}
for (int i = 0; i < numberOfGlyphs; i++) {
- mtxTab[i].setOffset(locaFormat == 1 ? fontFile.readTTFULong()
- : (fontFile.readTTFUShort() << 1));
+ mtxTab[i].setOffset(locaFormat == 1 ? in.readTTFULong()
+ : (in.readTTFUShort() << 1));
}
- lastLoca = (locaFormat == 1 ? fontFile.readTTFULong()
- : (fontFile.readTTFUShort() << 1));
+ lastLoca = (locaFormat == 1 ? in.readTTFULong()
+ : (in.readTTFUShort() << 1));
}
/**
* Read the "glyf" table to find the bounding boxes.
+ * @param in FontFileReader to read from
* @throws IOException In case of a I/O problem
*/
- private void readGlyf() throws IOException {
- TTFDirTabEntry dirTab = dirTabs.get(TTFTableName.GLYF);
+ private void readGlyf(FontFileReader in) throws IOException {
+ TTFDirTabEntry dirTab = getDirectoryEntry ( "glyf" );
if (dirTab == null) {
throw new IOException("glyf table not found, cannot continue");
}
for (int i = 0; i < (numberOfGlyphs - 1); i++) {
if (mtxTab[i].getOffset() != mtxTab[i + 1].getOffset()) {
- fontFile.seekSet(dirTab.getOffset() + mtxTab[i].getOffset());
- fontFile.skip(2);
+ in.seekSet(dirTab.getOffset() + mtxTab[i].getOffset());
+ in.skip(2);
final int[] bbox = {
- fontFile.readTTFShort(),
- fontFile.readTTFShort(),
- fontFile.readTTFShort(),
- fontFile.readTTFShort()};
+ in.readTTFShort(),
+ in.readTTFShort(),
+ in.readTTFShort(),
+ in.readTTFShort()};
mtxTab[i].setBoundingBox(bbox);
} else {
mtxTab[i].setBoundingBox(mtxTab[0].getBoundingBox());
@@ -1369,17 +1230,17 @@ public class TTFFile {
}
- long n = (dirTabs.get(TTFTableName.GLYF)).getOffset();
+ long n = dirTab.getOffset();
for (int i = 0; i < numberOfGlyphs; i++) {
if ((i + 1) >= mtxTab.length
|| mtxTab[i].getOffset() != mtxTab[i + 1].getOffset()) {
- fontFile.seekSet(n + mtxTab[i].getOffset());
- fontFile.skip(2);
+ in.seekSet(n + mtxTab[i].getOffset());
+ in.skip(2);
final int[] bbox = {
- fontFile.readTTFShort(),
- fontFile.readTTFShort(),
- fontFile.readTTFShort(),
- fontFile.readTTFShort()};
+ in.readTTFShort(),
+ in.readTTFShort(),
+ in.readTTFShort(),
+ in.readTTFShort()};
mtxTab[i].setBoundingBox(bbox);
} else {
/**@todo Verify that this is correct, looks like a copy/paste bug (jm)*/
@@ -1400,33 +1261,34 @@ public class TTFFile {
/**
* Read the "name" table.
+ * @param in FontFileReader to read from
* @throws IOException In case of a I/O problem
*/
- private void readName() throws IOException {
- seekTab(fontFile, TTFTableName.NAME, 2);
- int i = fontFile.getCurrentPos();
- int n = fontFile.readTTFUShort();
- int j = fontFile.readTTFUShort() + i - 2;
+ private void readName(FontFileReader in) throws IOException {
+ seekTab(in, "name", 2);
+ int i = in.getCurrentPos();
+ int n = in.readTTFUShort();
+ int j = in.readTTFUShort() + i - 2;
i += 2 * 2;
while (n-- > 0) {
// getLogger().debug("Iteration: " + n);
- fontFile.seekSet(i);
- final int platformID = fontFile.readTTFUShort();
- final int encodingID = fontFile.readTTFUShort();
- final int languageID = fontFile.readTTFUShort();
+ in.seekSet(i);
+ final int platformID = in.readTTFUShort();
+ final int encodingID = in.readTTFUShort();
+ final int languageID = in.readTTFUShort();
- int k = fontFile.readTTFUShort();
- int l = fontFile.readTTFUShort();
+ int k = in.readTTFUShort();
+ int l = in.readTTFUShort();
if (((platformID == 1 || platformID == 3)
&& (encodingID == 0 || encodingID == 1))) {
- fontFile.seekSet(j + fontFile.readTTFUShort());
+ in.seekSet(j + in.readTTFUShort());
String txt;
if (platformID == 3) {
- txt = fontFile.readTTFString(l, encodingID);
+ txt = in.readTTFString(l, encodingID);
} else {
- txt = fontFile.readTTFString(l);
+ txt = in.readTTFString(l);
}
if (log.isDebugEnabled()) {
@@ -1470,20 +1332,21 @@ public class TTFFile {
/**
* Read the "PCLT" table to find xHeight and capHeight.
+ * @param in FontFileReader to read from
* @throws IOException In case of a I/O problem
*/
- private boolean readPCLT() throws IOException {
- TTFDirTabEntry dirTab = dirTabs.get(TTFTableName.PCLT);
+ private boolean readPCLT(FontFileReader in) throws IOException {
+ TTFDirTabEntry dirTab = getDirectoryEntry ( "PCLT" );
if (dirTab != null) {
- fontFile.seekSet(dirTab.getOffset() + 4 + 4 + 2);
- xHeight = fontFile.readTTFUShort();
+ in.seekSet(dirTab.getOffset() + 4 + 4 + 2);
+ xHeight = in.readTTFUShort();
log.debug("xHeight from PCLT: " + formatUnitsForDebug(xHeight));
- fontFile.skip(2 * 2);
- capHeight = fontFile.readTTFUShort();
+ in.skip(2 * 2);
+ capHeight = in.readTTFUShort();
log.debug("capHeight from PCLT: " + formatUnitsForDebug(capHeight));
- fontFile.skip(2 + 16 + 8 + 6 + 1 + 1);
+ in.skip(2 + 16 + 8 + 6 + 1 + 1);
- int serifStyle = fontFile.readTTFUByte();
+ int serifStyle = in.readTTFUByte();
serifStyle = serifStyle >> 6;
serifStyle = serifStyle & 3;
if (serifStyle == 1) {
@@ -1613,18 +1476,19 @@ public class TTFFile {
/**
* Read the kerning table, create a table for both CIDs and
* winAnsiEncoding.
+ * @param in FontFileReader to read from
* @throws IOException In case of a I/O problem
*/
- private void readKerning() throws IOException {
+ private void readKerning(FontFileReader in) throws IOException {
// Read kerning
- kerningTab = new HashMap<Integer, Map<Integer, Integer>>();
- ansiKerningTab = new HashMap<Integer, Map<Integer, Integer>>();
- TTFDirTabEntry dirTab = dirTabs.get(TTFTableName.KERN);
+ kerningTab = new java.util.HashMap();
+ ansiKerningTab = new java.util.HashMap();
+ TTFDirTabEntry dirTab = getDirectoryEntry ( "kern" );
if (dirTab != null) {
- seekTab(fontFile, TTFTableName.KERN, 2);
- for (int n = fontFile.readTTFUShort(); n > 0; n--) {
- fontFile.skip(2 * 2);
- int k = fontFile.readTTFUShort();
+ seekTab(in, "kern", 2);
+ for (int n = in.readTTFUShort(); n > 0; n--) {
+ in.skip(2 * 2);
+ int k = in.readTTFUShort();
if (!((k & 1) != 0) || (k & 2) != 0 || (k & 4) != 0) {
return;
}
@@ -1632,12 +1496,12 @@ public class TTFFile {
continue;
}
- k = fontFile.readTTFUShort();
- fontFile.skip(3 * 2);
+ k = in.readTTFUShort();
+ in.skip(3 * 2);
while (k-- > 0) {
- int i = fontFile.readTTFUShort();
- int j = fontFile.readTTFUShort();
- int kpx = fontFile.readTTFShort();
+ int i = in.readTTFUShort();
+ int j = in.readTTFUShort();
+ int kpx = in.readTTFShort();
if (kpx != 0) {
// CID kerning table entry, using unicode indexes
final Integer iObj = glyphToUnicode(i);
@@ -1651,9 +1515,9 @@ public class TTFFile {
log.debug("Ignoring kerning pair because Unicode index was"
+ " found for the second glyph " + i);
} else {
- Map<Integer, Integer> adjTab = kerningTab.get(iObj);
+ Map adjTab = kerningTab.get(iObj);
if (adjTab == null) {
- adjTab = new HashMap<Integer, Integer>();
+ adjTab = new java.util.HashMap();
}
adjTab.put(u2, new Integer(convertTTFUnit2PDFUnit(kpx)));
kerningTab.put(iObj, adjTab);
@@ -1665,12 +1529,16 @@ public class TTFFile {
// Create winAnsiEncoded kerning table from kerningTab
// (could probably be simplified, for now we remap back to CID indexes and
// then to winAnsi)
- for (Integer unicodeKey1 : kerningTab.keySet()) {
+ Iterator ae = kerningTab.keySet().iterator();
+ while (ae.hasNext()) {
+ Integer unicodeKey1 = (Integer)ae.next();
Integer cidKey1 = unicodeToGlyph(unicodeKey1.intValue());
- Map<Integer, Integer> akpx = new HashMap<Integer, Integer>();
- Map<Integer, Integer> ckpx = kerningTab.get(unicodeKey1);
+ Map<Integer, Integer> akpx = new java.util.HashMap();
+ Map ckpx = kerningTab.get(unicodeKey1);
- for (Integer unicodeKey2 : ckpx.keySet()) {
+ Iterator aee = ckpx.keySet().iterator();
+ while (aee.hasNext()) {
+ Integer unicodeKey2 = (Integer)aee.next();
Integer cidKey2 = unicodeToGlyph(unicodeKey2.intValue());
Integer kern = (Integer)ckpx.get(unicodeKey2);
@@ -1699,71 +1567,10 @@ public class TTFFile {
}
/**
- * Streams a font.
- * @param ttfOut The interface for streaming TrueType tables.
- * @exception IOException file write error
- */
- public void stream(TTFOutputStream ttfOut) throws IOException {
- SortedSet<Map.Entry<TTFTableName, TTFDirTabEntry>> sortedDirTabs = sortDirTabMap(dirTabs);
- byte[] file = fontFile.getAllBytes();
- TTFTableOutputStream tableOut = ttfOut.getTableOutputStream();
- TTFGlyphOutputStream glyphOut = ttfOut.getGlyphOutputStream();
- ttfOut.startFontStream();
- for (Map.Entry<TTFTableName, TTFDirTabEntry> entry : sortedDirTabs) {
- int offset = (int) entry.getValue().getOffset();
- int paddedLength = (int) entry.getValue().getLength();
- paddedLength += getPadSize(offset + paddedLength);
- if (entry.getKey().equals(TTFTableName.GLYF)) {
- streamGlyf(glyphOut, file, offset, paddedLength);
- } else {
- tableOut.streamTable(file, offset, paddedLength);
- }
- }
- ttfOut.endFontStream();
- }
-
- private void streamGlyf(TTFGlyphOutputStream glyphOut, byte[] fontFile, int tableOffset,
- int tableLength) throws IOException {
- //Stream all but the last glyph
- int glyphStart = 0;
- int glyphEnd = 0;
- glyphOut.startGlyphStream();
- for (int i = 0; i < mtxTab.length - 1; i++) {
- glyphStart = (int) mtxTab[i].getOffset() + tableOffset;
- glyphEnd = (int) mtxTab[i + 1].getOffset() + tableOffset;
- glyphOut.streamGlyph(fontFile, glyphStart, glyphEnd - glyphStart);
- }
- glyphOut.streamGlyph(fontFile, glyphEnd, (tableOffset + tableLength) - glyphEnd);
- glyphOut.endGlyphStream();
- }
-
- /**
- * Returns the order in which the tables in a TrueType font should be written to file.
- * @param directoryTabs the map that is to be sorted.
- * @return TTFTablesNames[] an array of table names sorted in the order they should appear in
- * the TTF file.
+ * Return a List with TTFCmapEntry.
+ * @return A list of TTFCmapEntry objects
*/
- SortedSet<Map.Entry<TTFTableName, TTFDirTabEntry>>
- sortDirTabMap(Map<TTFTableName, TTFDirTabEntry> directoryTabs) {
- SortedSet<Map.Entry<TTFTableName, TTFDirTabEntry>> sortedSet
- = new TreeSet<Map.Entry<TTFTableName, TTFDirTabEntry>>(
- new Comparator<Map.Entry<TTFTableName, TTFDirTabEntry>>() {
-
- public int compare(Entry<TTFTableName, TTFDirTabEntry> o1,
- Entry<TTFTableName, TTFDirTabEntry> o2) {
- return (int) (o1.getValue().getOffset() - o2.getValue().getOffset());
- }
- });
- sortedSet.addAll(directoryTabs.entrySet());
- return sortedSet;
- }
-
- /**
- * Returns this font's character to glyph mapping.
- *
- * @return the font's cmap
- */
- public List<CMapSegment> getCMaps() {
+ public List getCMaps() {
return cmaps;
}
@@ -1772,23 +1579,24 @@ public class TTFFile {
* name exists in the collection.
* If it does, set offset in fontfile to the beginning of
* the Table Directory for that font.
+ * @param in FontFileReader to read from
* @param name The name to check
* @return True if not collection or font name present, false otherwise
* @throws IOException In case of an I/O problem
*/
- protected final boolean checkTTC(String name) throws IOException {
- String tag = fontFile.readTTFString(4);
+ protected final boolean checkTTC(FontFileReader in, String name) throws IOException {
+ String tag = in.readTTFString(4);
if ("ttcf".equals(tag)) {
// This is a TrueType Collection
- fontFile.skip(4);
+ in.skip(4);
// Read directory offsets
- int numDirectories = (int)fontFile.readTTFULong();
+ int numDirectories = (int)in.readTTFULong();
// int numDirectories=in.readTTFUShort();
long[] dirOffsets = new long[numDirectories];
for (int i = 0; i < numDirectories; i++) {
- dirOffsets[i] = fontFile.readTTFULong();
+ dirOffsets[i] = in.readTTFULong();
}
log.info("This is a TrueType collection file with "
@@ -1802,10 +1610,10 @@ public class TTFFile {
// Is found, just to show all the names
long dirTabOffset = 0;
for (int i = 0; (i < numDirectories); i++) {
- fontFile.seekSet(dirOffsets[i]);
- readDirTabs();
+ in.seekSet(dirOffsets[i]);
+ readDirTabs(in);
- readName();
+ readName(in);
if (fullName.equals(name)) {
found = true;
@@ -1823,10 +1631,10 @@ public class TTFFile {
subFamilyName = "";
}
- fontFile.seekSet(dirTabOffset);
+ in.seekSet(dirTabOffset);
return found;
} else {
- fontFile.seekSet(0);
+ in.seekSet(0);
return true;
}
}
@@ -1838,7 +1646,8 @@ public class TTFFile {
* @throws IOException In case of an I/O problem
*/
public final List<String> getTTCnames(FontFileReader in) throws IOException {
- List<String> fontNames = new ArrayList<String>();
+ List<String> fontNames = new java.util.ArrayList<String>();
+
String tag = in.readTTFString(4);
if ("ttcf".equals(tag)) {
@@ -1858,9 +1667,9 @@ public class TTFFile {
for (int i = 0; (i < numDirectories); i++) {
in.seekSet(dirOffsets[i]);
- readDirTabs();
+ readDirTabs(in);
- readName();
+ readName(in);
log.info(fullName);
fontNames.add(fullName);
@@ -1886,13 +1695,13 @@ public class TTFFile {
* doesn't matter...
*/
private Integer[] unicodeToWinAnsi(int unicode) {
- List<Integer> ret = new ArrayList<Integer>();
+ List ret = new java.util.ArrayList();
for (int i = 32; i < Glyphs.WINANSI_ENCODING.length; i++) {
if (unicode == Glyphs.WINANSI_ENCODING[i]) {
ret.add(new Integer(i));
}
}
- return ret.toArray(new Integer[0]);
+ return (Integer[])ret.toArray(new Integer[0]);
}
/**
@@ -1935,7 +1744,7 @@ public class TTFFile {
* @return unicode code point
*/
private Integer glyphToUnicode(int glyphIndex) {
- return glyphToUnicodeMap.get(new Integer(glyphIndex));
+ return (Integer) glyphToUnicodeMap.get(new Integer(glyphIndex));
}
/**
@@ -1946,7 +1755,7 @@ public class TTFFile {
*/
private Integer unicodeToGlyph(int unicodeIndex) throws IOException {
final Integer result
- = unicodeToGlyphMap.get(new Integer(unicodeIndex));
+ = (Integer) unicodeToGlyphMap.get(new Integer(unicodeIndex));
if (result == null) {
throw new IOException(
"Glyph index not found for unicode value " + unicodeIndex);
@@ -1954,10 +1763,6 @@ public class TTFFile {
return result;
}
- String getGlyphName(int glyphIndex) {
- return mtxTab[glyphIndex].getName();
- }
-
/**
* Determine if advanced (typographic) table is present.
* @return true if advanced (typographic) table is present
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java b/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java
index 1410239ee..c03f0fb6a 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java
@@ -21,14 +21,17 @@ package org.apache.fop.fonts.truetype;
import java.io.IOException;
import java.io.InputStream;
+import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.io.IOUtils;
+import org.apache.xmlgraphics.fonts.Glyphs;
+
+import org.apache.fop.fonts.BFEntry;
import org.apache.fop.fonts.CIDFontType;
-import org.apache.fop.fonts.CMapSegment;
-import org.apache.fop.fonts.EmbeddingMode;
import org.apache.fop.fonts.EncodingMode;
import org.apache.fop.fonts.FontLoader;
import org.apache.fop.fonts.FontResolver;
@@ -36,8 +39,6 @@ import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.MultiByteFont;
import org.apache.fop.fonts.NamedCharacter;
import org.apache.fop.fonts.SingleByteFont;
-import org.apache.fop.fonts.truetype.TTFFile.PostScriptVersion;
-import org.apache.fop.util.HexEncoder;
/**
* Loads a TrueType font into memory directly from the original font file.
@@ -48,7 +49,6 @@ public class TTFFontLoader extends FontLoader {
private SingleByteFont singleFont;
private final String subFontName;
private EncodingMode encodingMode;
- private EmbeddingMode embeddingMode;
/**
* Default constructor
@@ -56,7 +56,7 @@ public class TTFFontLoader extends FontLoader {
* @param resolver the FontResolver for font URI resolution
*/
public TTFFontLoader(String fontFileURI, FontResolver resolver) {
- this(fontFileURI, null, true, EmbeddingMode.AUTO, EncodingMode.AUTO, true, true, resolver);
+ this(fontFileURI, null, true, EncodingMode.AUTO, true, true, resolver);
}
/**
@@ -65,28 +65,24 @@ public class TTFFontLoader extends FontLoader {
* @param subFontName the sub-fontname of a font in a TrueType Collection (or null for normal
* TrueType fonts)
* @param embedded indicates whether the font is embedded or referenced
- * @param embeddingMode the embedding mode of the font
* @param encodingMode the requested encoding mode
* @param useKerning true to enable loading kerning info if available, false to disable
* @param useAdvanced true to enable loading advanced info if available, false to disable
* @param resolver the FontResolver for font URI resolution
*/
public TTFFontLoader(String fontFileURI, String subFontName,
- boolean embedded, EmbeddingMode embeddingMode, EncodingMode encodingMode,
- boolean useKerning, boolean useAdvanced, FontResolver resolver) {
+ boolean embedded, EncodingMode encodingMode, boolean useKerning,
+ boolean useAdvanced, FontResolver resolver) {
super(fontFileURI, embedded, useKerning, useAdvanced, resolver);
this.subFontName = subFontName;
this.encodingMode = encodingMode;
- this.embeddingMode = embeddingMode;
if (this.encodingMode == EncodingMode.AUTO) {
this.encodingMode = EncodingMode.CID; //Default to CID mode for TrueType
}
- if (this.embeddingMode == EmbeddingMode.AUTO) {
- this.embeddingMode = EmbeddingMode.SUBSET;
- }
}
/** {@inheritDoc} */
+ @Override
protected void read() throws IOException {
read(this.subFontName);
}
@@ -149,20 +145,29 @@ public class TTFFontLoader extends FontLoader {
returnFont.setItalicAngle(Integer.parseInt(ttf.getItalicAngle()));
returnFont.setMissingWidth(0);
returnFont.setWeight(ttf.getWeightClass());
- returnFont.setEmbeddingMode(this.embeddingMode);
+
if (isCid) {
multiFont.setCIDType(CIDFontType.CIDTYPE2);
int[] wx = ttf.getWidths();
multiFont.setWidthArray(wx);
+ List entries = ttf.getCMaps();
+ BFEntry[] bfentries = new BFEntry[entries.size()];
+ int pos = 0;
+ Iterator iter = ttf.getCMaps().listIterator();
+ while (iter.hasNext()) {
+ TTFCmapEntry ce = (TTFCmapEntry)iter.next();
+ bfentries[pos] = new BFEntry(ce.getUnicodeStart(), ce.getUnicodeEnd(),
+ ce.getGlyphStartIndex());
+ pos++;
+ }
+ multiFont.setBFEntries(bfentries);
} else {
singleFont.setFontType(FontType.TRUETYPE);
singleFont.setEncoding(ttf.getCharSetName());
returnFont.setFirstChar(ttf.getFirstChar());
returnFont.setLastChar(ttf.getLastChar());
- singleFont.setTrueTypePostScriptVersion(ttf.getPostScriptVersion());
copyWidthsSingleByte(ttf);
}
- returnFont.setCMap(getCMap(ttf));
if (useKerning) {
copyKerning(ttf, isCid);
@@ -181,30 +186,23 @@ public class TTFFontLoader extends FontLoader {
}
}
- private CMapSegment[] getCMap(TTFFile ttf) {
- CMapSegment[] array = new CMapSegment[ttf.getCMaps().size()];
- return ttf.getCMaps().toArray(array);
- }
-
private void copyWidthsSingleByte(TTFFile ttf) {
int[] wx = ttf.getWidths();
for (int i = singleFont.getFirstChar(); i <= singleFont.getLastChar(); i++) {
singleFont.setWidth(i, ttf.getCharWidth(i));
}
-
- for (CMapSegment segment : ttf.getCMaps()) {
- if (segment.getUnicodeStart() < 0xFFFE) {
- for (char u = (char)segment.getUnicodeStart(); u <= segment.getUnicodeEnd(); u++) {
+ Iterator iter = ttf.getCMaps().listIterator();
+ while (iter.hasNext()) {
+ TTFCmapEntry ce = (TTFCmapEntry)iter.next();
+ if (ce.getUnicodeStart() < 0xFFFE) {
+ for (char u = (char)ce.getUnicodeStart(); u <= ce.getUnicodeEnd(); u++) {
int codePoint = singleFont.getEncoding().mapChar(u);
if (codePoint <= 0) {
- int glyphIndex = segment.getGlyphStartIndex() + u - segment.getUnicodeStart();
- String glyphName = ttf.getGlyphName(glyphIndex);
- if (glyphName.length() == 0 && ttf.getPostScriptVersion() != PostScriptVersion.V2) {
- glyphName = "u" + HexEncoder.encode(u);
- }
- if (glyphName.length() > 0) {
- String unicode = Character.toString(u);
- NamedCharacter nc = new NamedCharacter(glyphName, unicode);
+ String unicode = Character.toString(u);
+ String charName = Glyphs.stringToGlyph(unicode);
+ if (charName.length() > 0) {
+ NamedCharacter nc = new NamedCharacter(charName, unicode);
+ int glyphIndex = ce.getGlyphStartIndex() + u - ce.getUnicodeStart();
singleFont.addUnencodedCharacter(nc, wx[glyphIndex]);
}
}
@@ -227,6 +225,7 @@ public class TTFFontLoader extends FontLoader {
}
for (Integer kpx1 : kerningSet) {
+
Map<Integer, Integer> h2;
if (isCid) {
h2 = ttf.getKerning().get(kpx1);
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFGlyphOutputStream.java b/src/java/org/apache/fop/fonts/truetype/TTFGlyphOutputStream.java
deleted file mode 100644
index 313d5836d..000000000
--- a/src/java/org/apache/fop/fonts/truetype/TTFGlyphOutputStream.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.truetype;
-
-import java.io.IOException;
-
-/**
- * An interface for writing individual glyphs from the glyf table of a TrueType font to an output stream.
- */
-public interface TTFGlyphOutputStream {
-
- /**
- * Begins the streaming of glyphs.
- */
- void startGlyphStream() throws IOException;
-
- /**
- * Streams an individual glyph from the given byte array.
- *
- * @param glyphData the source of the glyph data to stream from
- * @param offset the position in the glyph data where the glyph starts
- * @param size the size of the glyph data in bytes
- */
- void streamGlyph(byte[] glyphData, int offset, int size) throws IOException;
-
- /**
- * Ends the streaming of glyphs.
- */
- void endGlyphStream() throws IOException;
-
-}
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFOutputStream.java b/src/java/org/apache/fop/fonts/truetype/TTFOutputStream.java
deleted file mode 100644
index 09b5b6f50..000000000
--- a/src/java/org/apache/fop/fonts/truetype/TTFOutputStream.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.truetype;
-
-import java.io.IOException;
-
-/**
- * An interface for writing a TrueType font to an output stream.
- */
-public interface TTFOutputStream {
-
- /**
- * Starts writing the font.
- */
- void startFontStream() throws IOException;
-
- /**
- * Returns an object for streaming TrueType tables.
- */
- TTFTableOutputStream getTableOutputStream();
-
- /**
- * Returns an object for streaming TrueType glyphs in the glyf table.
- */
- TTFGlyphOutputStream getGlyphOutputStream();
-
- /**
- * Ends writing the font.
- */
- void endFontStream() throws IOException;
-
-}
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java b/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java
index 292ae191c..d400c0bfd 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java
@@ -20,9 +20,8 @@
package org.apache.fop.fonts.truetype;
import java.io.IOException;
-import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
-import java.util.SortedSet;
/**
@@ -43,18 +42,24 @@ public class TTFSubSetFile extends TTFFile {
* Offsets in name table to be filled out by table.
* The offsets are to the checkSum field
*/
- private Map<TTFTableName, Integer> offsets = new HashMap<TTFTableName, Integer>();
+ private int cvtDirOffset = 0;
+ private int fpgmDirOffset = 0;
+ private int glyfDirOffset = 0;
+ private int headDirOffset = 0;
+ private int hheaDirOffset = 0;
+ private int hmtxDirOffset = 0;
+ private int locaDirOffset = 0;
+ private int maxpDirOffset = 0;
+ private int prepDirOffset = 0;
private int checkSumAdjustmentOffset = 0;
private int locaOffset = 0;
- /** Stores the glyph offsets so that we can end strings at glyph boundaries */
- private int[] glyphOffsets;
-
/**
* Default Constructor
*/
public TTFSubSetFile() {
+ this(false, false);
}
/**
@@ -66,9 +71,16 @@ public class TTFSubSetFile extends TTFFile {
super(useKerning, useAdvanced);
}
- /** The dir tab entries in the new subset font. */
- private Map<TTFTableName, TTFDirTabEntry> newDirTabs
- = new HashMap<TTFTableName, TTFDirTabEntry>();
+ /**
+ * Initalize the output array
+ */
+ private void init(int size) {
+ output = new byte[size];
+ realSize = 0;
+ currentPos = 0;
+
+ // createDirectory()
+ }
private int determineTableCount() {
int numTables = 4; //4 req'd tables: head,hhea,hmtx,maxp
@@ -76,7 +88,7 @@ public class TTFSubSetFile extends TTFFile {
throw new UnsupportedOperationException(
"OpenType fonts with CFF glyphs are not supported");
} else {
- numTables += 5; //5 req'd tables: glyf,loca,post,name,OS/2
+ numTables += 2; //1 req'd table: glyf,loca
if (hasCvt()) {
numTables++;
}
@@ -107,7 +119,7 @@ public class TTFSubSetFile extends TTFFile {
// Create searchRange, entrySelector and rangeShift
int maxPow = maxPow2(numTables);
- int searchRange = (int) Math.pow(2, maxPow) * 16;
+ int searchRange = maxPow * 16;
writeUShort(searchRange);
realSize += 2;
@@ -116,122 +128,151 @@ public class TTFSubSetFile extends TTFFile {
writeUShort((numTables * 16) - searchRange);
realSize += 2;
- // Create space for the table entries (these must be in ASCII alphabetical order[A-Z] then[a-z])
- writeTableName(TTFTableName.OS2);
+ // Create space for the table entries
if (hasCvt()) {
- writeTableName(TTFTableName.CVT);
+ writeString("cvt ");
+ cvtDirOffset = currentPos;
+ currentPos += 12;
+ realSize += 16;
}
+
if (hasFpgm()) {
- writeTableName(TTFTableName.FPGM);
- }
- writeTableName(TTFTableName.GLYF);
- writeTableName(TTFTableName.HEAD);
- writeTableName(TTFTableName.HHEA);
- writeTableName(TTFTableName.HMTX);
- writeTableName(TTFTableName.LOCA);
- writeTableName(TTFTableName.MAXP);
- writeTableName(TTFTableName.NAME);
- writeTableName(TTFTableName.POST);
- if (hasPrep()) {
- writeTableName(TTFTableName.PREP);
+ writeString("fpgm");
+ fpgmDirOffset = currentPos;
+ currentPos += 12;
+ realSize += 16;
}
- newDirTabs.put(TTFTableName.TABLE_DIRECTORY, new TTFDirTabEntry(0, currentPos));
- }
- private void writeTableName(TTFTableName tableName) {
- writeString(tableName.getName());
- offsets.put(tableName, currentPos);
+ writeString("glyf");
+ glyfDirOffset = currentPos;
currentPos += 12;
realSize += 16;
- }
+ writeString("head");
+ headDirOffset = currentPos;
+ currentPos += 12;
+ realSize += 16;
- private boolean hasCvt() {
- return dirTabs.containsKey(TTFTableName.CVT);
- }
+ writeString("hhea");
+ hheaDirOffset = currentPos;
+ currentPos += 12;
+ realSize += 16;
- private boolean hasFpgm() {
- return dirTabs.containsKey(TTFTableName.FPGM);
- }
+ writeString("hmtx");
+ hmtxDirOffset = currentPos;
+ currentPos += 12;
+ realSize += 16;
- private boolean hasPrep() {
- return dirTabs.containsKey(TTFTableName.PREP);
+ writeString("loca");
+ locaDirOffset = currentPos;
+ currentPos += 12;
+ realSize += 16;
+
+ writeString("maxp");
+ maxpDirOffset = currentPos;
+ currentPos += 12;
+ realSize += 16;
+
+ if (hasPrep()) {
+ writeString("prep");
+ prepDirOffset = currentPos;
+ currentPos += 12;
+ realSize += 16;
+ }
}
+
/**
- * Create an empty loca table without updating checksum
+ * Copy the cvt table as is from original font to subset font
*/
- private void createLoca(int size) throws IOException {
- pad4();
- locaOffset = currentPos;
- int dirTableOffset = offsets.get(TTFTableName.LOCA);
- writeULong(dirTableOffset + 4, currentPos);
- writeULong(dirTableOffset + 8, size * 4 + 4);
- currentPos += size * 4 + 4;
- realSize += size * 4 + 4;
- }
-
- private boolean copyTable(FontFileReader in, TTFTableName tableName) throws IOException {
- TTFDirTabEntry entry = dirTabs.get(tableName);
+ private boolean createCvt(FontFileReader in) throws IOException {
+ TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("cvt ");
if (entry != null) {
pad4();
- seekTab(in, tableName, 0);
+ seekTab(in, "cvt ", 0);
System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()),
0, output, currentPos, (int)entry.getLength());
- updateCheckSum(currentPos, (int) entry.getLength(), tableName);
- currentPos += (int) entry.getLength();
- realSize += (int) entry.getLength();
+ int checksum = getCheckSum(currentPos, (int)entry.getLength());
+ writeULong(cvtDirOffset, checksum);
+ writeULong(cvtDirOffset + 4, currentPos);
+ writeULong(cvtDirOffset + 8, (int)entry.getLength());
+ currentPos += (int)entry.getLength();
+ realSize += (int)entry.getLength();
return true;
} else {
return false;
+ //throw new IOException("Can't find cvt table");
}
}
- /**
- * Copy the cvt table as is from original font to subset font
- */
- private boolean createCvt(FontFileReader in) throws IOException {
- return copyTable(in, TTFTableName.CVT);
+ private boolean hasCvt() {
+ return dirTabs.containsKey("cvt ");
+ }
+
+ private boolean hasFpgm() {
+ return dirTabs.containsKey("fpgm");
+ }
+
+ private boolean hasPrep() {
+ return dirTabs.containsKey("prep");
}
/**
* Copy the fpgm table as is from original font to subset font
*/
private boolean createFpgm(FontFileReader in) throws IOException {
- return copyTable(in, TTFTableName.FPGM);
+ TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("fpgm");
+ if (entry != null) {
+ pad4();
+ seekTab(in, "fpgm", 0);
+ System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()),
+ 0, output, currentPos, (int)entry.getLength());
+ int checksum = getCheckSum(currentPos, (int)entry.getLength());
+ writeULong(fpgmDirOffset, checksum);
+ writeULong(fpgmDirOffset + 4, currentPos);
+ writeULong(fpgmDirOffset + 8, (int)entry.getLength());
+ currentPos += (int)entry.getLength();
+ realSize += (int)entry.getLength();
+ return true;
+ } else {
+ return false;
+ }
}
- /**
- * Copy the name table as is from the original.
- */
- private boolean createName(FontFileReader in) throws IOException {
- return copyTable(in, TTFTableName.NAME);
- }
+
/**
- * Copy the OS/2 table as is from the original.
+ * Create an empty loca table without updating checksum
*/
- private boolean createOS2(FontFileReader in) throws IOException {
- return copyTable(in, TTFTableName.OS2);
+ private void createLoca(int size) throws IOException {
+ pad4();
+ locaOffset = currentPos;
+ writeULong(locaDirOffset + 4, currentPos);
+ writeULong(locaDirOffset + 8, size * 4 + 4);
+ currentPos += size * 4 + 4;
+ realSize += size * 4 + 4;
}
+
/**
* Copy the maxp table as is from original font to subset font
* and set num glyphs to size
*/
private void createMaxp(FontFileReader in, int size) throws IOException {
- TTFTableName maxp = TTFTableName.MAXP;
- TTFDirTabEntry entry = dirTabs.get(maxp);
+ TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("maxp");
if (entry != null) {
pad4();
- seekTab(in, maxp, 0);
+ seekTab(in, "maxp", 0);
System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()),
0, output, currentPos, (int)entry.getLength());
writeUShort(currentPos + 4, size);
- updateCheckSum(currentPos, (int)entry.getLength(), maxp);
+ int checksum = getCheckSum(currentPos, (int)entry.getLength());
+ writeULong(maxpDirOffset, checksum);
+ writeULong(maxpDirOffset + 4, currentPos);
+ writeULong(maxpDirOffset + 8, (int)entry.getLength());
currentPos += (int)entry.getLength();
realSize += (int)entry.getLength();
} else {
@@ -239,34 +280,28 @@ public class TTFSubSetFile extends TTFFile {
}
}
- private void createPost(FontFileReader in) throws IOException {
- TTFTableName post = TTFTableName.POST;
- TTFDirTabEntry entry = dirTabs.get(post);
- if (entry != null) {
- pad4();
- seekTab(in, post, 0);
- int newTableSize = 32; // This is the post table size with glyphs truncated
- byte[] newPostTable = new byte[newTableSize];
- // We only want the first 28 bytes (truncate the glyph names);
- System.arraycopy(in.getBytes((int) entry.getOffset(), newTableSize),
- 0, newPostTable, 0, newTableSize);
- // set the post table to Format 3.0
- newPostTable[1] = 0x03;
- System.arraycopy(newPostTable, 0, output, currentPos, newTableSize);
- updateCheckSum(currentPos, newTableSize, post);
- currentPos += newTableSize;
- realSize += newTableSize;
- } else {
- throw new IOException("Can't find post table");
- }
- }
-
/**
* Copy the prep table as is from original font to subset font
*/
private boolean createPrep(FontFileReader in) throws IOException {
- return copyTable(in, TTFTableName.PREP);
+ TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("prep");
+ if (entry != null) {
+ pad4();
+ seekTab(in, "prep", 0);
+ System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()),
+ 0, output, currentPos, (int)entry.getLength());
+
+ int checksum = getCheckSum(currentPos, (int)entry.getLength());
+ writeULong(prepDirOffset, checksum);
+ writeULong(prepDirOffset + 4, currentPos);
+ writeULong(prepDirOffset + 8, (int)entry.getLength());
+ currentPos += (int)entry.getLength();
+ realSize += (int)entry.getLength();
+ return true;
+ } else {
+ return false;
+ }
}
@@ -275,17 +310,20 @@ public class TTFSubSetFile extends TTFFile {
* and fill in size of hmtx table
*/
private void createHhea(FontFileReader in, int size) throws IOException {
- TTFDirTabEntry entry = dirTabs.get(TTFTableName.HHEA);
+ TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("hhea");
if (entry != null) {
pad4();
- seekTab(in, TTFTableName.HHEA, 0);
- System.arraycopy(in.getBytes((int) entry.getOffset(), (int) entry.getLength()), 0,
- output, currentPos, (int) entry.getLength());
- writeUShort((int) entry.getLength() + currentPos - 2, size);
-
- updateCheckSum(currentPos, (int) entry.getLength(), TTFTableName.HHEA);
- currentPos += (int) entry.getLength();
- realSize += (int) entry.getLength();
+ seekTab(in, "hhea", 0);
+ System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()),
+ 0, output, currentPos, (int)entry.getLength());
+ writeUShort((int)entry.getLength() + currentPos - 2, size);
+
+ int checksum = getCheckSum(currentPos, (int)entry.getLength());
+ writeULong(hheaDirOffset, checksum);
+ writeULong(hheaDirOffset + 4, currentPos);
+ writeULong(hheaDirOffset + 8, (int)entry.getLength());
+ currentPos += (int)entry.getLength();
+ realSize += (int)entry.getLength();
} else {
throw new IOException("Can't find hhea table");
}
@@ -299,11 +337,10 @@ public class TTFSubSetFile extends TTFFile {
* in checkSumAdjustmentOffset
*/
private void createHead(FontFileReader in) throws IOException {
- TTFTableName head = TTFTableName.HEAD;
- TTFDirTabEntry entry = dirTabs.get(head);
+ TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("head");
if (entry != null) {
pad4();
- seekTab(in, head, 0);
+ seekTab(in, "head", 0);
System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()),
0, output, currentPos, (int)entry.getLength());
@@ -315,7 +352,11 @@ public class TTFSubSetFile extends TTFFile {
output[currentPos + 50] = 0; // long locaformat
output[currentPos + 51] = 1; // long locaformat
- updateCheckSum(currentPos, (int)entry.getLength(), head);
+ int checksum = getCheckSum(currentPos, (int)entry.getLength());
+ writeULong(headDirOffset, checksum);
+ writeULong(headDirOffset + 4, currentPos);
+ writeULong(headDirOffset + 8, (int)entry.getLength());
+
currentPos += (int)entry.getLength();
realSize += (int)entry.getLength();
} else {
@@ -328,24 +369,30 @@ public class TTFSubSetFile extends TTFFile {
* Create the glyf table and fill in loca table
*/
private void createGlyf(FontFileReader in,
- Map<Integer, Integer> glyphs) throws IOException {
- TTFTableName glyf = TTFTableName.GLYF;
- TTFDirTabEntry entry = dirTabs.get(glyf);
+ Map glyphs) throws IOException {
+ TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("glyf");
int size = 0;
- int startPos = 0;
+ int start = 0;
int endOffset = 0; // Store this as the last loca
if (entry != null) {
pad4();
- startPos = currentPos;
+ start = currentPos;
/* Loca table must be in order by glyph index, so build
* an array first and then write the glyph info and
* location offset.
*/
- int[] origIndexes = buildSubsetIndexToOrigIndexMap(glyphs);
- glyphOffsets = new int[origIndexes.length];
+ int[] origIndexes = new int[glyphs.size()];
+
+ Iterator e = glyphs.keySet().iterator();
+ while (e.hasNext()) {
+ Integer origIndex = (Integer)e.next();
+ Integer subsetIndex = (Integer)glyphs.get(origIndex);
+ origIndexes[subsetIndex.intValue()] = origIndex.intValue();
+ }
for (int i = 0; i < origIndexes.length; i++) {
+ int glyphLength = 0;
int nextOffset = 0;
int origGlyphIndex = origIndexes[i];
if (origGlyphIndex >= (mtxTab.length - 1)) {
@@ -353,64 +400,46 @@ public class TTFSubSetFile extends TTFFile {
} else {
nextOffset = (int)mtxTab[origGlyphIndex + 1].getOffset();
}
- int glyphOffset = (int)mtxTab[origGlyphIndex].getOffset();
- int glyphLength = nextOffset - glyphOffset;
+ glyphLength = nextOffset - (int)mtxTab[origGlyphIndex].getOffset();
- byte[] glyphData = in.getBytes(
- (int)entry.getOffset() + glyphOffset,
- glyphLength);
- int endOffset1 = endOffset;
// Copy glyph
System.arraycopy(
- glyphData, 0,
+ in.getBytes((int)entry.getOffset() + (int)mtxTab[origGlyphIndex].getOffset(),
+ glyphLength), 0,
output, currentPos,
glyphLength);
// Update loca table
- writeULong(locaOffset + i * 4, currentPos - startPos);
- if ((currentPos - startPos + glyphLength) > endOffset1) {
- endOffset1 = (currentPos - startPos + glyphLength);
+ writeULong(locaOffset + i * 4, currentPos - start);
+ if ((currentPos - start + glyphLength) > endOffset) {
+ endOffset = (currentPos - start + glyphLength);
}
- // Store the glyph boundary positions relative to the start of the font
- glyphOffsets[i] = currentPos;
currentPos += glyphLength;
realSize += glyphLength;
-
- endOffset = endOffset1;
}
+ size = currentPos - start;
- size = currentPos - startPos;
-
+ int checksum = getCheckSum(start, size);
+ writeULong(glyfDirOffset, checksum);
+ writeULong(glyfDirOffset + 4, start);
+ writeULong(glyfDirOffset + 8, size);
currentPos += 12;
realSize += 12;
- updateCheckSum(startPos, size + 12, glyf);
// Update loca checksum and last loca index
writeULong(locaOffset + glyphs.size() * 4, endOffset);
- int locaSize = glyphs.size() * 4 + 4;
- int checksum = getCheckSum(output, locaOffset, locaSize);
- writeULong(offsets.get(TTFTableName.LOCA), checksum);
- int padSize = (locaOffset + locaSize) % 4;
- newDirTabs.put(TTFTableName.LOCA,
- new TTFDirTabEntry(locaOffset, locaSize + padSize));
+
+ checksum = getCheckSum(locaOffset, glyphs.size() * 4 + 4);
+ writeULong(locaDirOffset, checksum);
} else {
throw new IOException("Can't find glyf table");
}
}
- private int[] buildSubsetIndexToOrigIndexMap(Map<Integer, Integer> glyphs) {
- int[] origIndexes = new int[glyphs.size()];
- for (Map.Entry<Integer, Integer> glyph : glyphs.entrySet()) {
- int origIndex = glyph.getKey();
- int subsetIndex = glyph.getValue();
- origIndexes[subsetIndex] = origIndex;
- }
- return origIndexes;
- }
/**
* Create the hmtx table by copying metrics from original
@@ -419,9 +448,8 @@ public class TTFSubSetFile extends TTFFile {
* metric (key) to the subset metric (value)
*/
private void createHmtx(FontFileReader in,
- Map<Integer, Integer> glyphs) throws IOException {
- TTFTableName hmtx = TTFTableName.HMTX;
- TTFDirTabEntry entry = dirTabs.get(hmtx);
+ Map glyphs) throws IOException {
+ TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("hmtx");
int longHorMetricSize = glyphs.size() * 2;
int leftSideBearingSize = glyphs.size() * 2;
@@ -430,9 +458,10 @@ public class TTFSubSetFile extends TTFFile {
if (entry != null) {
pad4();
//int offset = (int)entry.offset;
- for (Map.Entry<Integer, Integer> glyph : glyphs.entrySet()) {
- Integer origIndex = glyph.getKey();
- Integer subsetIndex = glyph.getValue();
+ Iterator e = glyphs.keySet().iterator();
+ while (e.hasNext()) {
+ Integer origIndex = (Integer)e.next();
+ Integer subsetIndex = (Integer)glyphs.get(origIndex);
writeUShort(currentPos + subsetIndex.intValue() * 4,
mtxTab[origIndex.intValue()].getWx());
@@ -440,7 +469,10 @@ public class TTFSubSetFile extends TTFFile {
mtxTab[origIndex.intValue()].getLsb());
}
- updateCheckSum(currentPos, hmtxSize, hmtx);
+ int checksum = getCheckSum(currentPos, hmtxSize);
+ writeULong(hmtxDirOffset, checksum);
+ writeULong(hmtxDirOffset + 4, currentPos);
+ writeULong(hmtxDirOffset + 8, hmtxSize);
currentPos += hmtxSize;
realSize += hmtxSize;
} else {
@@ -449,37 +481,43 @@ public class TTFSubSetFile extends TTFFile {
}
/**
- * Reads a font and creates a subset of the font.
+ * Returns a subset of the original font.
*
* @param in FontFileReader to read from
* @param name Name to be checked for in the font file
* @param glyphs Map of glyphs (glyphs has old index as (Integer) key and
* new index as (Integer) value)
+ * @return A subset of the original font
* @throws IOException in case of an I/O problem
*/
- public void readFont(FontFileReader in, String name,
+ public byte[] readFont(FontFileReader in, String name,
Map<Integer, Integer> glyphs) throws IOException {
- fontFile = in;
+
//Check if TrueType collection, and that the name exists in the collection
- if (!checkTTC(name)) {
+ if (!checkTTC(in, name)) {
throw new IOException("Failed to read font");
}
//Copy the Map as we're going to modify it
- Map<Integer, Integer> subsetGlyphs = new HashMap<Integer, Integer>(glyphs);
+ Map<Integer, Integer> subsetGlyphs = new java.util.HashMap<Integer, Integer>(glyphs);
output = new byte[in.getFileSize()];
- readDirTabs();
- readFontHeader();
- getNumGlyphs();
- readHorizontalHeader();
- readHorizontalMetrics();
- readIndexToLocation();
+ readDirTabs(in);
+ readFontHeader(in);
+ getNumGlyphs(in);
+ readHorizontalHeader(in);
+ readHorizontalMetrics(in);
+ readIndexToLocation(in);
scanGlyphs(in, subsetGlyphs);
- createDirectory(); // Create the TrueType header and directory
+ createDirectory(); // Create the TrueType header and directory
+
+ createHead(in);
+ createHhea(in, subsetGlyphs.size()); // Create the hhea table
+ createHmtx(in, subsetGlyphs); // Create hmtx table
+ createMaxp(in, subsetGlyphs.size()); // copy the maxp table
boolean optionalTableFound;
optionalTableFound = createCvt(in); // copy the cvt table
@@ -493,16 +531,6 @@ public class TTFSubSetFile extends TTFFile {
// fpgm is optional (used in TrueType fonts only)
log.debug("TrueType: fpgm table not present. Skipped.");
}
- createLoca(subsetGlyphs.size()); // create empty loca table
- createGlyf(in, subsetGlyphs); //create glyf table and update loca table
-
- createOS2(in); // copy the OS/2 table
- createHead(in);
- createHhea(in, subsetGlyphs.size()); // Create the hhea table
- createHmtx(in, subsetGlyphs); // Create hmtx table
- createMaxp(in, subsetGlyphs.size()); // copy the maxp table
- createName(in); // copy the name table
- createPost(in); // copy the post table
optionalTableFound = createPrep(in); // copy prep table
if (!optionalTableFound) {
@@ -510,59 +538,21 @@ public class TTFSubSetFile extends TTFFile {
log.debug("TrueType: prep table not present. Skipped.");
}
+ createLoca(subsetGlyphs.size()); // create empty loca table
+ createGlyf(in, subsetGlyphs); //create glyf table and update loca table
+
pad4();
createCheckSumAdjustment();
- }
- /**
- * Returns a subset of the fonts (readFont() MUST be called first in order to create the
- * subset).
- * @return byte array
- */
- public byte[] getFontSubset() {
byte[] ret = new byte[realSize];
System.arraycopy(output, 0, ret, 0, realSize);
- return ret;
- }
- private void handleGlyphSubset(TTFGlyphOutputStream glyphOut) throws IOException {
- glyphOut.startGlyphStream();
- // Stream all but the last glyph
- for (int i = 0; i < glyphOffsets.length - 1; i++) {
- glyphOut.streamGlyph(output, glyphOffsets[i],
- glyphOffsets[i + 1] - glyphOffsets[i]);
- }
- // Stream the last glyph
- TTFDirTabEntry glyf = newDirTabs.get(TTFTableName.GLYF);
- long lastGlyphLength = glyf.getLength()
- - (glyphOffsets[glyphOffsets.length - 1] - glyf.getOffset());
- glyphOut.streamGlyph(output, glyphOffsets[glyphOffsets.length - 1],
- (int) lastGlyphLength);
- glyphOut.endGlyphStream();
- }
-
- @Override
- public void stream(TTFOutputStream ttfOut) throws IOException {
- SortedSet<Map.Entry<TTFTableName, TTFDirTabEntry>> sortedDirTabs
- = sortDirTabMap(newDirTabs);
- TTFTableOutputStream tableOut = ttfOut.getTableOutputStream();
- TTFGlyphOutputStream glyphOut = ttfOut.getGlyphOutputStream();
-
- ttfOut.startFontStream();
- for (Map.Entry<TTFTableName, TTFDirTabEntry> entry : sortedDirTabs) {
- if (entry.getKey().equals(TTFTableName.GLYF)) {
- handleGlyphSubset(glyphOut);
- } else {
- tableOut.streamTable(output, (int) entry.getValue().getOffset(),
- (int) entry.getValue().getLength());
- }
- }
- ttfOut.endFontStream();
+ return ret;
}
private void scanGlyphs(FontFileReader in, Map<Integer, Integer> subsetGlyphs)
throws IOException {
- TTFDirTabEntry glyfTableInfo = dirTabs.get(TTFTableName.GLYF);
+ TTFDirTabEntry glyfTableInfo = (TTFDirTabEntry) dirTabs.get("glyf");
if (glyfTableInfo == null) {
throw new IOException("Glyf table could not be found");
}
@@ -620,6 +610,20 @@ public class TTFSubSetFile extends TTFFile {
output[pos + 1] = b2;
}
+ /**
+ * Appends a ULONG to the output array,
+ * updates currentPos but not realSize
+ */
+ private void writeULong(int s) {
+ byte b1 = (byte)((s >> 24) & 0xff);
+ byte b2 = (byte)((s >> 16) & 0xff);
+ byte b3 = (byte)((s >> 8) & 0xff);
+ byte b4 = (byte)(s & 0xff);
+ writeByte(b1);
+ writeByte(b2);
+ writeByte(b3);
+ writeByte(b4);
+ }
/**
* Appends a ULONG to the output array,
@@ -637,16 +641,40 @@ public class TTFSubSetFile extends TTFFile {
}
/**
+ * Read a signed short value at given position
+ */
+ private short readShort(int pos) {
+ int ret = readUShort(pos);
+ return (short)ret;
+ }
+
+ /**
+ * Read a unsigned short value at given position
+ */
+ private int readUShort(int pos) {
+ int ret = output[pos];
+ if (ret < 0) {
+ ret += 256;
+ }
+ ret = ret << 8;
+ if (output[pos + 1] < 0) {
+ ret |= output[pos + 1] + 256;
+ } else {
+ ret |= output[pos + 1];
+ }
+
+ return ret;
+ }
+
+ /**
* Create a padding in the fontfile to align
* on a 4-byte boundary
*/
private void pad4() {
- int padSize = getPadSize(currentPos);
- if (padSize < 4) {
- for (int i = 0; i < padSize; i++) {
- output[currentPos++] = 0;
- realSize++;
- }
+ int padSize = currentPos % 4;
+ for (int i = 0; i < padSize; i++) {
+ output[currentPos++] = 0;
+ realSize++;
}
}
@@ -655,25 +683,23 @@ public class TTFSubSetFile extends TTFFile {
*/
private int maxPow2(int max) {
int i = 0;
- while (Math.pow(2, i) <= max) {
+ while (Math.pow(2, i) < max) {
i++;
}
return (i - 1);
}
+ private int log2(int num) {
+ return (int)(Math.log(num) / Math.log(2));
+ }
+
- private void updateCheckSum(int tableStart, int tableSize, TTFTableName tableName) {
- int checksum = getCheckSum(output, tableStart, tableSize);
- int offset = offsets.get(tableName);
- int padSize = getPadSize(tableStart + tableSize);
- newDirTabs.put(tableName, new TTFDirTabEntry(tableStart, tableSize + padSize));
- writeULong(offset, checksum);
- writeULong(offset + 4, tableStart);
- writeULong(offset + 8, tableSize);
+ private int getCheckSum(int start, int size) {
+ return (int)getLongCheckSum(start, size);
}
- private static int getCheckSum(byte[] data, int start, int size) {
+ private long getLongCheckSum(int start, int size) {
// All the tables here are aligned on four byte boundaries
// Add remainder to size if it's not a multiple of 4
int remainder = size % 4;
@@ -684,19 +710,26 @@ public class TTFSubSetFile extends TTFFile {
long sum = 0;
for (int i = 0; i < size; i += 4) {
- long l = 0;
- for (int j = 0; j < 4; j++) {
- l <<= 8;
- l |= data[start + i + j] & 0xff;
- }
+ int l = (output[start + i] << 24);
+ l += (output[start + i + 1] << 16);
+ l += (output[start + i + 2] << 16);
+ l += (output[start + i + 3] << 16);
sum += l;
+ if (sum > 0xffffffff) {
+ sum = sum - 0xffffffff;
+ }
}
- return (int) sum;
+
+ return sum;
}
private void createCheckSumAdjustment() {
- long sum = getCheckSum(output, 0, realSize);
+ long sum = getLongCheckSum(0, realSize);
int checksum = (int)(0xb1b0afba - sum);
writeULong(checkSumAdjustmentOffset, checksum);
}
+
}
+
+
+
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFTableName.java b/src/java/org/apache/fop/fonts/truetype/TTFTableName.java
deleted file mode 100644
index e5ad63128..000000000
--- a/src/java/org/apache/fop/fonts/truetype/TTFTableName.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * 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.truetype;
-
-
-/**
- * Represents table names as found in a TrueType font's Table Directory.
- * TrueType fonts may have custom tables so we cannot use an enum.
- */
-public final class TTFTableName {
-
- /** The first table in a TrueType font file containing metadata about other tables. */
- public static final TTFTableName TABLE_DIRECTORY = new TTFTableName("tableDirectory");
-
- /** Embedded bitmap data. */
- public static final TTFTableName EBDT = new TTFTableName("EBDT");
-
- /** Embedded bitmap location data. */
- public static final TTFTableName EBLC = new TTFTableName("EBLC");
-
- /** Embedded bitmap scaling data. */
- public static final TTFTableName EBSC = new TTFTableName("EBSC");
-
- /** A FontForge specific table. */
- public static final TTFTableName FFTM = new TTFTableName("FFTM");
-
- /** Divides glyphs into various classes that make using the GPOS/GSUB tables easier. */
- public static final TTFTableName GDEF = new TTFTableName("GDEF");
-
- /** Provides kerning information, mark-to-base, etc. for opentype fonts. */
- public static final TTFTableName GPOS = new TTFTableName("GPOS");
-
- /** Provides ligature information, swash, etc. for opentype fonts. */
- public static final TTFTableName GSUB = new TTFTableName("GSUB");
-
- /** Linear threshold table. */
- public static final TTFTableName LTSH = new TTFTableName("LTSH");
-
- /** OS/2 and Windows specific metrics. */
- public static final TTFTableName OS2 = new TTFTableName("OS/2");
-
- /** PCL 5 data. */
- public static final TTFTableName PCLT = new TTFTableName("PCLT");
-
- /** Vertical Device Metrics table. */
- public static final TTFTableName VDMX = new TTFTableName("VDMX");
-
- /** Character to glyph mapping. */
- public static final TTFTableName CMAP = new TTFTableName("cmap");
-
- /** Control Value Table. */
- public static final TTFTableName CVT = new TTFTableName("cvt ");
-
- /** Font program. */
- public static final TTFTableName FPGM = new TTFTableName("fpgm");
-
- /** Grid-fitting and scan conversion procedure (grayscale). */
- public static final TTFTableName GASP = new TTFTableName("gasp");
-
- /** Glyph data. */
- public static final TTFTableName GLYF = new TTFTableName("glyf");
-
- /** Horizontal device metrics. */
- public static final TTFTableName HDMX = new TTFTableName("hdmx");
-
- /** Font header. */
- public static final TTFTableName HEAD = new TTFTableName("head");
-
- /** Horizontal header. */
- public static final TTFTableName HHEA = new TTFTableName("hhea");
-
- /** Horizontal metrics. */
- public static final TTFTableName HMTX = new TTFTableName("hmtx");
-
- /** Kerning. */
- public static final TTFTableName KERN = new TTFTableName("kern");
-
- /** Index to location. */
- public static final TTFTableName LOCA = new TTFTableName("loca");
-
- /** Maximum profile. */
- public static final TTFTableName MAXP = new TTFTableName("maxp");
-
- /** Naming table. */
- public static final TTFTableName NAME = new TTFTableName("name");
-
- /** PostScript information. */
- public static final TTFTableName POST = new TTFTableName("post");
-
- /** CVT Program. */
- public static final TTFTableName PREP = new TTFTableName("prep");
-
- /** Vertical Metrics header. */
- public static final TTFTableName VHEA = new TTFTableName("vhea");
-
- /** Vertical Metrics. */
- public static final TTFTableName VMTX = new TTFTableName("vmtx");
-
- private final String name;
-
- private TTFTableName(String name) {
- this.name = name;
- }
-
- /**
- * Returns the name of the table as it should be in the Directory Table.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Returns an instance of this class corresponding to the given string representation.
- * @param tableName table name as in the Table Directory
- * @return TTFTableName
- */
- public static TTFTableName getValue(String tableName) {
- if (tableName != null) {
- return new TTFTableName(tableName);
- }
- throw new IllegalArgumentException("A TrueType font table name must not be null");
- }
-
- @Override
- public int hashCode() {
- return name.hashCode();
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if (!(o instanceof TTFTableName)) {
- return false;
- }
- TTFTableName to = (TTFTableName) o;
- return this.name.equals(to.getName());
- }
-
- @Override
- public String toString() {
- return name;
- }
-
-}
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFTableOutputStream.java b/src/java/org/apache/fop/fonts/truetype/TTFTableOutputStream.java
deleted file mode 100644
index d0d2007f5..000000000
--- a/src/java/org/apache/fop/fonts/truetype/TTFTableOutputStream.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.truetype;
-
-import java.io.IOException;
-
-/**
- * An interface for writing a TrueType table to an output stream.
- */
-public interface TTFTableOutputStream {
-
- /**
- * Streams a table from the given byte array.
- *
- * @param ttfData the source of the table to stream from
- * @param offset the position in the byte array where the table starts
- * @param size the size of the table in bytes
- */
- void streamTable(byte[] ttfData, int offset, int size) throws IOException;
-}
diff --git a/src/java/org/apache/fop/hyphenation/HyphenationTreeCache.java b/src/java/org/apache/fop/hyphenation/HyphenationTreeCache.java
index ec16810b3..c5845977f 100644
--- a/src/java/org/apache/fop/hyphenation/HyphenationTreeCache.java
+++ b/src/java/org/apache/fop/hyphenation/HyphenationTreeCache.java
@@ -79,7 +79,7 @@ public class HyphenationTreeCache {
String userKey = null;
if (hyphPatNames != null) {
String key = constructLlccKey(lang, country);
- key = key.replace('_', '-');
+ key.replace('_', '-');
userKey = (String) hyphPatNames.get(key);
}
return userKey;
@@ -96,7 +96,7 @@ public class HyphenationTreeCache {
/**
* Notes a key to a hyphenation tree as missing.
- * This is to avoid searching a second time for a hyphenation pattern file which is not
+ * This is to avoid searching a second time for a hyphneation pattern file which is not
* available.
* @param key the key (ex. "de_CH" or "en")
*/
@@ -109,7 +109,7 @@ public class HyphenationTreeCache {
/**
* Indicates whether a hyphenation file has been requested before but it wasn't available.
- * This is to avoid searching a second time for a hyphenation pattern file which is not
+ * This is to avoid searching a second time for a hyphneation pattern file which is not
* available.
* @param key the key (ex. "de_CH" or "en")
* @return true if the hyphenation tree is unavailable
diff --git a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java
index 03c159843..2bcdb6127 100644
--- a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java
+++ b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java
@@ -41,16 +41,12 @@ public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm {
* @param topLevelLM the top level layout manager
* @param pageProvider the page provider
* @param layoutListener the layout listener
- * @param alignment alignment of the paragraph/page. One of
- * {@link org.apache.fop.fo.Constants#EN_START},
- * {@link org.apache.fop.fo.Constants#EN_JUSTIFY},
- * {@link org.apache.fop.fo.Constants#EN_CENTER},
- * {@link org.apache.fop.fo.Constants#EN_END}.
- * For pages, {@link org.apache.fop.fo.Constants#EN_BEFORE} and
- * {@link org.apache.fop.fo.Constants#EN_AFTER}
- * are mapped to the corresponding inline properties,
- * {@link org.apache.fop.fo.Constants#EN_START} and
- * {@link org.apache.fop.fo.Constants#EN_END}.
+ * @param alignment alignment of the paragraph/page. One of {@link Constants#EN_START},
+ * {@link Constants#EN_JUSTIFY}, {@link Constants#EN_CENTER},
+ * {@link Constants#EN_END}.
+ * For pages, {@link Constants#EN_BEFORE} and {@link Constants#EN_AFTER}
+ * are mapped to the corresponding inline properties,
+ * {@link Constants#EN_START} and {@link Constants#EN_END}.
* @param alignmentLast alignment of the paragraph's last line
* @param footnoteSeparatorLength length of footnote separator
* @param partOverflowRecovery {@code true} if too long elements should be moved to
diff --git a/src/java/org/apache/fop/layoutmgr/BreakElement.java b/src/java/org/apache/fop/layoutmgr/BreakElement.java
index 77e7f140b..1c89c2009 100644
--- a/src/java/org/apache/fop/layoutmgr/BreakElement.java
+++ b/src/java/org/apache/fop/layoutmgr/BreakElement.java
@@ -46,11 +46,8 @@ public class BreakElement extends UnresolvedListElement {
* Create a new BreakElement for the given {@code position}, {@code penaltyValue}
* and {@code breakClass}. (Used principally to generate break-possibilities in
* ranges of content that must be kept together within the context corresponding
- * to the {@code breakClass}; expected to be one of
- * {@link org.apache.fop.fo.Constants#EN_AUTO},
- * {@link org.apache.fop.fo.Constants#EN_LINE},
- * {@link org.apache.fop.fo.Constants#EN_COLUMN} or
- * {@link org.apache.fop.fo.Constants#EN_PAGE})
+ * to the {@code breakClass}; expected to be one of {@link Constants#EN_AUTO},
+ * {@link Constants#EN_LINE}, {@link Constants#EN_COLUMN} or {@link Constants#EN_PAGE})
* @param position the corresponding {@link Position}
* @param penaltyValue the penalty value
* @param breakClass the break class
@@ -67,12 +64,9 @@ public class BreakElement extends UnresolvedListElement {
* @param position the Position instance needed by the addAreas stage of the LMs.
* @param penaltyWidth the penalty width
* @param penaltyValue the penalty value for the penalty element to be constructed
- * @param breakClass the break class of this penalty (one of
- * {@link org.apache.fop.fo.Constants#EN_AUTO},
- * {@link org.apache.fop.fo.Constants#EN_COLUMN},
- * {@link org.apache.fop.fo.Constants#EN_PAGE},
- * {@link org.apache.fop.fo.Constants#EN_EVEN_PAGE},
- * {@link org.apache.fop.fo.Constants#EN_ODD_PAGE})
+ * @param breakClass the break class of this penalty (one of {@link Constants#EN_AUTO},
+ * {@link Constants#EN_COLUMN}, {@link Constants#EN_PAGE},
+ * {@link Constants#EN_EVEN_PAGE}, {@link Constants#EN_ODD_PAGE})
* @param context the layout context which contains the pending conditional elements
*/
public BreakElement(Position position, int penaltyWidth, int penaltyValue,
@@ -126,12 +120,9 @@ public class BreakElement extends UnresolvedListElement {
/**
* Returns the break class of this penalty.
*
- * @return one of
- * {@link org.apache.fop.fo.Constants#EN_AUTO},
- * {@link org.apache.fop.fo.Constants#EN_COLUMN},
- * {@link org.apache.fop.fo.Constants#EN_PAGE},
- * {@link org.apache.fop.fo.Constants#EN_EVEN_PAGE},
- * {@link org.apache.fop.fo.Constants#EN_ODD_PAGE}.
+ * @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
+ * {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE},
+ * {@link Constants#EN_ODD_PAGE}
*/
public int getBreakClass() {
return breakClass;
@@ -140,12 +131,9 @@ public class BreakElement extends UnresolvedListElement {
/**
* Sets the break class.
*
- * @param breakClass one of
- * {@link org.apache.fop.fo.Constants#EN_AUTO},
- * {@link org.apache.fop.fo.Constants#EN_COLUMN},
- * {@link org.apache.fop.fo.Constants#EN_PAGE},
- * {@link org.apache.fop.fo.Constants#EN_EVEN_PAGE},
- * {@link org.apache.fop.fo.Constants#EN_ODD_PAGE}.
+ * @param breakClass one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
+ * {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE},
+ * {@link Constants#EN_ODD_PAGE}
*/
public void setBreakClass(int breakClass) {
this.breakClass = breakClass;
diff --git a/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java b/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java
index 220f9c35d..2d4e1f2be 100644
--- a/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java
+++ b/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java
@@ -72,11 +72,8 @@ public class KnuthPenalty extends KnuthElement {
* @param penalty the penalty value of this penalty
* @param penaltyFlagged is this penalty flagged?
* @param breakClass the break class of this penalty (one of
- * {@link org.apache.fop.fo.Constants#EN_AUTO},
- * {@link org.apache.fop.fo.Constants#EN_COLUMN},
- * {@link org.apache.fop.fo.Constants#EN_PAGE},
- * {@link org.apache.fop.fo.Constants#EN_EVEN_PAGE},
- * {@link org.apache.fop.fo.Constants#EN_ODD_PAGE}).
+ * {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN}, {@link Constants#EN_PAGE},
+ * {@link Constants#EN_EVEN_PAGE}, {@link Constants#EN_ODD_PAGE})
* @param pos the Position stored in this penalty
* @param isAuxiliary is this penalty auxiliary?
*/
diff --git a/src/java/org/apache/fop/pdf/AbstractPDFStream.java b/src/java/org/apache/fop/pdf/AbstractPDFStream.java
index 0948a7d2b..0181728b8 100644
--- a/src/java/org/apache/fop/pdf/AbstractPDFStream.java
+++ b/src/java/org/apache/fop/pdf/AbstractPDFStream.java
@@ -78,7 +78,7 @@ public abstract class AbstractPDFStream extends PDFObject {
* from outside.
*/
protected void setupFilterList() {
- if (multipleFiltersAllowed() && !getFilterList().isInitialized()) {
+ if (!getFilterList().isInitialized()) {
getFilterList().addDefaultFilters(
getDocumentSafely().getFilterMap(),
getDefaultFilterName());
@@ -273,11 +273,4 @@ public abstract class AbstractPDFStream extends PDFObject {
//nop: No default implicit filters
}
- /**
- * Whether multiple filters can be applied.
- * @return true if multiple filters allowed
- */
- protected boolean multipleFiltersAllowed() {
- return true;
- }
}
diff --git a/src/java/org/apache/fop/pdf/AlphaRasterImage.java b/src/java/org/apache/fop/pdf/AlphaRasterImage.java
index 250b5daa2..7272c5edd 100644
--- a/src/java/org/apache/fop/pdf/AlphaRasterImage.java
+++ b/src/java/org/apache/fop/pdf/AlphaRasterImage.java
@@ -212,10 +212,6 @@ public class AlphaRasterImage implements PDFImage {
return null;
}
- /** {@inheritDoc} */
- public boolean multipleFiltersAllowed() {
- return true;
- }
}
diff --git a/src/java/org/apache/fop/pdf/BitmapImage.java b/src/java/org/apache/fop/pdf/BitmapImage.java
index ac7af1dbd..186c00986 100644
--- a/src/java/org/apache/fop/pdf/BitmapImage.java
+++ b/src/java/org/apache/fop/pdf/BitmapImage.java
@@ -37,8 +37,6 @@ public class BitmapImage implements PDFImage {
private PDFColor transparent = null;
private String key;
private PDFDocument pdfDoc;
- private PDFFilter pdfFilter;
- private boolean multipleFiltersAllowed = true;
/**
* Create a bitmap image.
@@ -210,23 +208,9 @@ public class BitmapImage implements PDFImage {
* {@inheritDoc}
*/
public PDFFilter getPDFFilter() {
- return pdfFilter;
- }
-
- public void setPDFFilter(PDFFilter pdfFilter) {
- this.pdfFilter = pdfFilter;
+ return null;
}
- /** {@inheritDoc} */
- public boolean multipleFiltersAllowed() {
- return multipleFiltersAllowed;
- }
+}
- /**
- * Disallows multiple filters.
- */
- public void disallowMultipleFilters() {
- multipleFiltersAllowed = false;
- }
-}
diff --git a/src/java/org/apache/fop/pdf/PDFColor.java b/src/java/org/apache/fop/pdf/PDFColor.java
index 1fb544368..8eea7e390 100644
--- a/src/java/org/apache/fop/pdf/PDFColor.java
+++ b/src/java/org/apache/fop/pdf/PDFColor.java
@@ -30,7 +30,7 @@ import org.apache.xmlgraphics.java2d.color.DeviceCMYKColorSpace;
* image. And in this context, only RGB and Gray values are used.
* <p>
* Use of this class is discouraged. {@link PDFColorHandler} is now used for in-content color
- * selection. For masked bitmaps, it may be wiser to switch to {@link java.awt.Color} in the long run.
+ * selection. For masked bitmaps, it may be wiser to switch to {@link Color} in the long run.
*/
public class PDFColor extends PDFPathPaint {
// could be 3.0 as well.
diff --git a/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java b/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java
index ae6893944..dc0681405 100644
--- a/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java
+++ b/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java
@@ -38,10 +38,7 @@ public class PDFEmbeddedFile extends PDFStream {
put("Params", params);
}
- /**
- * Determine if should encode on the fly.
- * @return true if should encode on the fly
- */
+ /** {@inheritDoc} */
protected boolean isEncodingOnTheFly() {
//Acrobat doesn't like an indirect /Length object in this case,
//but only when the embedded file is a PDF file.
diff --git a/src/java/org/apache/fop/pdf/PDFFactory.java b/src/java/org/apache/fop/pdf/PDFFactory.java
index beb384dcf..cc1d93de0 100644
--- a/src/java/org/apache/fop/pdf/PDFFactory.java
+++ b/src/java/org/apache/fop/pdf/PDFFactory.java
@@ -45,7 +45,6 @@ import org.apache.commons.logging.LogFactory;
import org.apache.xmlgraphics.java2d.color.ColorUtil;
import org.apache.xmlgraphics.java2d.color.NamedColorSpace;
-
import org.apache.xmlgraphics.xmp.Metadata;
import org.apache.fop.fonts.CIDFont;
@@ -1675,8 +1674,8 @@ public class PDFFactory {
FontFileReader reader = new FontFileReader(in);
TTFSubSetFile subset = new TTFSubSetFile();
- subset.readFont(reader, mbfont.getTTCName(), mbfont.getUsedGlyphs());
- byte[] subsetFont = subset.getFontSubset();
+ byte[] subsetFont = subset.readFont(reader,
+ mbfont.getTTCName(), mbfont.getUsedGlyphs());
// Only TrueType CID fonts are supported now
embeddedFont = new PDFTTFStream(subsetFont.length);
diff --git a/src/java/org/apache/fop/pdf/PDFImage.java b/src/java/org/apache/fop/pdf/PDFImage.java
index 38da60e7b..e2b9e521c 100644
--- a/src/java/org/apache/fop/pdf/PDFImage.java
+++ b/src/java/org/apache/fop/pdf/PDFImage.java
@@ -151,13 +151,5 @@ public interface PDFImage {
*/
String getFilterHint();
- /**
- * Indicates whether multiple image filters are allowed; this is implemented because Adobe
- * Reader does not like multiple FlateDecode filters applied to an image even though that
- * allowed by the PDF spec; this is probable due to security concerns since many PDF malware
- * exploits, like zip bombs, make use of a chain of FlateDecode filters.
- */
- boolean multipleFiltersAllowed();
-
}
diff --git a/src/java/org/apache/fop/pdf/PDFImageXObject.java b/src/java/org/apache/fop/pdf/PDFImageXObject.java
index 1c28cb2a7..acab4c19c 100644
--- a/src/java/org/apache/fop/pdf/PDFImageXObject.java
+++ b/src/java/org/apache/fop/pdf/PDFImageXObject.java
@@ -166,9 +166,4 @@ public class PDFImageXObject extends PDFXObject {
return pdfimage.getFilterHint();
}
- /** {@inheritDoc} */
- protected boolean multipleFiltersAllowed() {
- return pdfimage.multipleFiltersAllowed();
- }
-
}
diff --git a/src/java/org/apache/fop/pdf/PDFObject.java b/src/java/org/apache/fop/pdf/PDFObject.java
index e0f950154..1b9c4eea7 100644
--- a/src/java/org/apache/fop/pdf/PDFObject.java
+++ b/src/java/org/apache/fop/pdf/PDFObject.java
@@ -22,6 +22,7 @@ package org.apache.fop.pdf;
// Java
import java.io.IOException;
import java.io.OutputStream;
+import java.io.Writer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -210,6 +211,11 @@ public abstract class PDFObject implements PDFWritable {
}
/** {@inheritDoc} */
+ public void outputInline(OutputStream out, Writer writer) throws IOException {
+ throw new UnsupportedOperationException("Don't use anymore: " + getClass().getName());
+ }
+
+ /** {@inheritDoc} */
public void outputInline(OutputStream out, StringBuilder textBuffer) throws IOException {
if (hasObjectNumber()) {
textBuffer.append(referencePDF());
diff --git a/src/java/org/apache/fop/pdf/PDFResources.java b/src/java/org/apache/fop/pdf/PDFResources.java
index cded7c00a..df8647bf4 100644
--- a/src/java/org/apache/fop/pdf/PDFResources.java
+++ b/src/java/org/apache/fop/pdf/PDFResources.java
@@ -21,8 +21,9 @@ package org.apache.fop.pdf;
import java.io.IOException;
import java.io.OutputStream;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@@ -45,33 +46,33 @@ public class PDFResources extends PDFDictionary {
/**
* /Font objects keyed by their internal name
*/
- protected Map<String, PDFFont> fonts = new LinkedHashMap<String, PDFFont>();
+ protected Map fonts = new HashMap();
/**
* Set of XObjects
*/
- protected Set<PDFXObject> xObjects = new LinkedHashSet<PDFXObject>();
+ protected Set xObjects = new HashSet();
/**
* Set of patterns
*/
- protected Set<PDFPattern> patterns = new LinkedHashSet<PDFPattern>();
+ protected Set patterns = new HashSet();
/**
* Set of shadings
*/
- protected Set<PDFShading> shadings = new LinkedHashSet<PDFShading>();
+ protected Set shadings = new HashSet();
/**
* Set of ExtGStates
*/
- protected Set<PDFGState> gstates = new LinkedHashSet<PDFGState>();
+ protected Set gstates = new HashSet();
/** Map of color spaces (key: color space name) */
- protected Map<PDFName, PDFColorSpace> colorSpaces = new LinkedHashMap<PDFName, PDFColorSpace>();
+ protected Map colorSpaces = new HashMap();
/** Map of ICC color spaces (key: ICC profile description) */
- protected Map<String, PDFICCBasedColorSpace> iccColorSpaces = new LinkedHashMap<String, PDFICCBasedColorSpace>();
+ protected Map iccColorSpaces = new HashMap();
/**
* create a /Resources object.
@@ -167,7 +168,7 @@ public class PDFResources extends PDFDictionary {
PDFICCBasedColorSpace icc = (PDFICCBasedColorSpace)colorSpace;
String desc = ColorProfileUtil.getICCProfileDescription(
icc.getICCStream().getICCProfile());
- this.iccColorSpaces.put(desc, icc);
+ this.iccColorSpaces.put(desc, colorSpace);
}
}
@@ -177,7 +178,7 @@ public class PDFResources extends PDFDictionary {
* @return the requested color space or null if it wasn't found
*/
public PDFICCBasedColorSpace getICCColorSpaceByProfileName(String desc) {
- PDFICCBasedColorSpace cs = this.iccColorSpaces.get(desc);
+ PDFICCBasedColorSpace cs = (PDFICCBasedColorSpace)this.iccColorSpaces.get(desc);
return cs;
}
@@ -187,7 +188,7 @@ public class PDFResources extends PDFDictionary {
* @return the requested color space or null if it wasn't found
*/
public PDFColorSpace getColorSpace(PDFName name) {
- PDFColorSpace cs = this.colorSpaces.get(name);
+ PDFColorSpace cs = (PDFColorSpace)this.colorSpaces.get(name);
return cs;
}
@@ -201,24 +202,28 @@ public class PDFResources extends PDFDictionary {
if (!this.fonts.isEmpty()) {
PDFDictionary dict = new PDFDictionary(this);
/* construct PDF dictionary of font object references */
- for (Map.Entry<String, PDFFont> entry : fonts.entrySet()) {
- dict.put(entry.getKey(), entry.getValue());
+ Iterator fontIterator = this.fonts.keySet().iterator();
+ while (fontIterator.hasNext()) {
+ String fontName = (String)fontIterator.next();
+ dict.put(fontName, (PDFFont)this.fonts.get(fontName));
}
put("Font", dict);
}
if (!this.shadings.isEmpty()) {
PDFDictionary dict = new PDFDictionary(this);
- for (PDFShading shading : shadings) {
- dict.put(shading.getName(), shading);
+ for (Iterator iter = shadings.iterator(); iter.hasNext();) {
+ PDFShading currentShading = (PDFShading)iter.next();
+ dict.put(currentShading.getName(), currentShading);
}
put("Shading", dict);
}
if (!this.patterns.isEmpty()) {
PDFDictionary dict = new PDFDictionary(this);
- for (PDFPattern pattern : patterns) {
- dict.put(pattern.getName(), pattern);
+ for (Iterator iter = patterns.iterator(); iter.hasNext();) {
+ PDFPattern currentPattern = (PDFPattern)iter.next();
+ dict.put(currentPattern.getName(), currentPattern);
}
put("Pattern", dict);
}
@@ -232,23 +237,26 @@ public class PDFResources extends PDFDictionary {
if (this.xObjects != null && !this.xObjects.isEmpty()) {
PDFDictionary dict = new PDFDictionary(this);
- for (PDFXObject xObject : xObjects) {
- dict.put(xObject.getName().toString(), xObject);
+ for (Iterator iter = xObjects.iterator(); iter.hasNext();) {
+ PDFXObject xobj = (PDFXObject)iter.next();
+ dict.put(xobj.getName().toString(), xobj);
}
put("XObject", dict);
}
if (!this.gstates.isEmpty()) {
PDFDictionary dict = new PDFDictionary(this);
- for (PDFGState gstate : gstates) {
- dict.put(gstate.getName(), gstate);
+ for (Iterator iter = gstates.iterator(); iter.hasNext();) {
+ PDFGState gs = (PDFGState)iter.next();
+ dict.put(gs.getName(), gs);
}
put("ExtGState", dict);
}
if (!this.colorSpaces.isEmpty()) {
PDFDictionary dict = new PDFDictionary(this);
- for (PDFColorSpace colorSpace : colorSpaces.values()) {
+ for (Iterator iter = colorSpaces.values().iterator(); iter.hasNext();) {
+ PDFColorSpace colorSpace = (PDFColorSpace)iter.next();
dict.put(colorSpace.getName(), colorSpace);
}
put("ColorSpace", dict);
diff --git a/src/java/org/apache/fop/render/ImageHandler.java b/src/java/org/apache/fop/render/ImageHandler.java
index 190d7c5d6..fe6952de1 100644
--- a/src/java/org/apache/fop/render/ImageHandler.java
+++ b/src/java/org/apache/fop/render/ImageHandler.java
@@ -33,8 +33,7 @@ public interface ImageHandler extends ImageHandlerBase {
* Indicates whether the image handler is compatible with the indicated target represented
* by the rendering context object and with the image to be processed. The image is also
* passed as a parameter because a handler might not support every subtype of image that is
- * presented. For example: in the case of
- * {@link org.apache.xmlgraphics.image.loader.impl.ImageXMLDOM}, the image might carry an SVG
+ * presented. For example: in the case of {@link ImageXMLDOM}, the image might carry an SVG
* or some other XML format. One handler might only handle SVG but no other XML format.
* @param targetContext the target rendering context
* @param image the image to be processed (or null if only to check based on the rendering
diff --git a/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java b/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
index 2ae95dd4c..7823a2ce6 100644
--- a/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
+++ b/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
@@ -58,8 +58,7 @@ import org.apache.fop.render.intermediate.IFException;
import org.apache.fop.render.intermediate.IFPainter;
/**
- * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation that
- * produces AFP (MO:DCA).
+ * {@link IFDocumentHandler} implementation that produces AFP (MO:DCA).
*/
public class AFPDocumentHandler extends AbstractBinaryWritingIFDocumentHandler
implements AFPCustomizable {
diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java
index 824ecbabb..842456f69 100644
--- a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java
+++ b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java
@@ -27,7 +27,7 @@ import org.xml.sax.helpers.AttributesImpl;
/**
* This extension allows to include an AFP form map resource. It is implemented as an extension
- * attachment ({@link org.apache.fop.fo.extensions.ExtensionAttachment}).
+ * attachment ({@link ExtensionAttachment}).
*/
public class AFPIncludeFormMap extends AFPExtensionAttachment {
diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java
index c5079b2bd..37f818f64 100644
--- a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java
+++ b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java
@@ -32,8 +32,8 @@ import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.extensions.ExtensionAttachment;
/**
- * This class extends the {@link org.apache.fop.fo.extensions.ExtensionObj} class.
- * It represents the "include-form-map" extension in the FO tree.
+ * This class extends the {@link ExtensionObj} class. It represents the "include-form-map"
+ * extension in the FO tree.
*/
public class AFPIncludeFormMapElement extends AbstractAFPExtensionObject {
diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java b/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java
index 1e6aee7d5..0900d40b4 100644
--- a/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java
+++ b/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java
@@ -25,7 +25,7 @@ import org.xml.sax.helpers.AttributesImpl;
/**
* This extension allows to include an AFP Page Overlay resource. It is implemented as an extension
- * attachment ({@link org.apache.fop.fo.extensions.ExtensionAttachment}).
+ * attachment ({@link ExtensionAttachment}).
*/
public class AFPPageOverlay extends AFPExtensionAttachment {
diff --git a/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java b/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java
index 0c6ebde56..c98c05a8e 100644
--- a/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java
+++ b/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java
@@ -47,8 +47,7 @@ import org.apache.fop.render.java2d.Java2DPainter;
import org.apache.fop.render.java2d.Java2DUtil;
/**
- * Abstract {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation
- * for producing bitmap images.
+ * Abstract {@link IFDocumentHandler} implementation for producing bitmap images.
*/
public abstract class AbstractBitmapDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
diff --git a/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java b/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java
index ed92b852f..05c44a1a6 100644
--- a/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java
+++ b/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java
@@ -23,8 +23,7 @@ import org.apache.fop.apps.MimeConstants;
import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator;
/**
- * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation
- * that produces PNG files.
+ * {@link IFDocumentHandler} implementation that produces PNG files.
*/
public class PNGDocumentHandler extends AbstractBitmapDocumentHandler {
diff --git a/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java b/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java
index 1c9a39bbe..4b7fa3c2d 100644
--- a/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java
+++ b/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java
@@ -23,8 +23,7 @@ import org.apache.fop.apps.MimeConstants;
import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator;
/**
- * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation
- * that produces TIFF files.
+ * {@link IFDocumentHandler} implementation that produces TIFF files.
*/
public class TIFFDocumentHandler extends AbstractBitmapDocumentHandler {
diff --git a/src/java/org/apache/fop/render/intermediate/IFContext.java b/src/java/org/apache/fop/render/intermediate/IFContext.java
index 681b996e4..c59a02ba8 100644
--- a/src/java/org/apache/fop/render/intermediate/IFContext.java
+++ b/src/java/org/apache/fop/render/intermediate/IFContext.java
@@ -145,7 +145,7 @@ public class IFContext {
/**
* Resets the current structure tree element.
- * @see #setStructureTreeElement(StructureTreeElement)
+ * @see #setStructureTreeElement(String)
*/
public void resetStructureTreeElement() {
setStructureTreeElement(null);
@@ -154,7 +154,7 @@ public class IFContext {
/**
* Returns the current structure tree element.
* @return the structure tree element (or null if no element is active)
- * @see #setStructureTreeElement(StructureTreeElement)
+ * @see #setStructureTreeElement(String)
*/
public StructureTreeElement getStructureTreeElement() {
return this.structureTreeElement;
diff --git a/src/java/org/apache/fop/render/intermediate/IFSerializer.java b/src/java/org/apache/fop/render/intermediate/IFSerializer.java
index 7114f51e3..f8f286cb3 100644
--- a/src/java/org/apache/fop/render/intermediate/IFSerializer.java
+++ b/src/java/org/apache/fop/render/intermediate/IFSerializer.java
@@ -64,15 +64,6 @@ import org.apache.fop.util.XMLUtil;
public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
implements IFConstants, IFPainter, IFDocumentNavigationHandler {
- /**
- * Intermediate Format (IF) version, used to express an @version attribute
- * in the root element of the IF document, the initial value of which
- * is set to '2.0' to signify that something preceded it (but didn't
- * happen to be marked as such), and that this version is not necessarily
- * backwards compatible with the unmarked (<2.0) version.
- */
- public static final String VERSION = "2.0";
-
private IFDocumentHandler mimicHandler;
private int pageSequenceIndex; // used for accessibility
@@ -176,9 +167,7 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
DocumentNavigationExtensionConstants.NAMESPACE);
handler.startPrefixMapping(InternalElementMapping.STANDARD_PREFIX,
InternalElementMapping.URI);
- AttributesImpl atts = new AttributesImpl();
- addAttribute(atts, "version", VERSION);
- handler.startElement(EL_DOCUMENT, atts);
+ handler.startElement(EL_DOCUMENT);
} catch (SAXException e) {
throw new IFException("SAX error in startDocument()", e);
}
diff --git a/src/java/org/apache/fop/render/intermediate/IFUtil.java b/src/java/org/apache/fop/render/intermediate/IFUtil.java
index c4f681936..e8651a3df 100644
--- a/src/java/org/apache/fop/render/intermediate/IFUtil.java
+++ b/src/java/org/apache/fop/render/intermediate/IFUtil.java
@@ -147,8 +147,8 @@ public final class IFUtil {
/**
* Sets up the fonts on a document handler. If the document handler provides a configurator
- * object the configuration from the {@link org.apache.fop.apps.FopFactory} will be used.
- * Otherwise, a default font configuration will be set up.
+ * object the configuration from the {@link FopFactory} will be used. Otherwise,
+ * a default font configuration will be set up.
* @param documentHandler the document handler
* @param fontInfo the font info object (may be null)
* @throws FOPException if an error occurs while setting up the fonts
@@ -175,8 +175,8 @@ public final class IFUtil {
/**
* Sets up the fonts on a document handler. If the document handler provides a configurator
- * object the configuration from the {@link org.apache.fop.apps.FopFactory} will be used.
- * Otherwise, a default font configuration will be set up.
+ * object the configuration from the {@link FopFactory} will be used. Otherwise,
+ * a default font configuration will be set up.
* @param documentHandler the document handler
* @throws FOPException if an error occurs while setting up the fonts
*/
diff --git a/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java b/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java
index 9c404be3e..7ac350d5d 100644
--- a/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java
+++ b/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java
@@ -89,8 +89,7 @@ public class ConfiguredFontCollection implements FontCollection {
font = new CustomFontMetricsMapper(fontMetrics, fontSource);
} else {
CustomFont fontMetrics = FontLoader.loadFont(
- fontFile, null, true, configFontInfo.getEmbeddingMode(),
- EncodingMode.AUTO,
+ fontFile, null, true, EncodingMode.AUTO,
configFontInfo.getKerning(),
configFontInfo.getAdvanced(), fontResolver);
font = new CustomFontMetricsMapper(fontMetrics);
diff --git a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java
index 36df00f20..5d964cbbf 100644
--- a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java
+++ b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java
@@ -36,7 +36,7 @@ import org.apache.fop.fonts.Typeface;
/**
* FontMetricsMapper that delegates most methods to an underlying
- * {@link org.apache.fop.fonts.FontMetrics} instance. This class was designed to allow
+ * {@link FontMetrics} instance. This class was designed to allow
* the underlying {@link Font} to be loaded from a
* user-configured file not registered in the current graphics environment.
*/
diff --git a/src/java/org/apache/fop/render/java2d/Java2DPainter.java b/src/java/org/apache/fop/render/java2d/Java2DPainter.java
index 575242d38..dd830a15b 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DPainter.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DPainter.java
@@ -47,8 +47,7 @@ import org.apache.fop.traits.RuleStyle;
import org.apache.fop.util.CharUtilities;
/**
- * {@link org.apache.fop.render.intermediate.IFPainter} implementation
- * that paints on a Graphics2D instance.
+ * {@link IFPainter} implementation that paints on a Graphics2D instance.
*/
public class Java2DPainter extends AbstractIFPainter {
diff --git a/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java b/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java
index 332b4a77d..52e522c7a 100644
--- a/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java
+++ b/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java
@@ -45,8 +45,7 @@ import org.apache.fop.render.java2d.Java2DUtil;
import org.apache.fop.render.pcl.extensions.PCLElementMapping;
/**
- * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation
- * that produces PCL 5.
+ * {@link IFDocumentHandler} implementation that produces PCL 5.
*/
public class PCLDocumentHandler extends AbstractBinaryWritingIFDocumentHandler
implements PCLConstants {
diff --git a/src/java/org/apache/fop/render/pcl/PCLPainter.java b/src/java/org/apache/fop/render/pcl/PCLPainter.java
index 0d630826c..9fc575456 100644
--- a/src/java/org/apache/fop/render/pcl/PCLPainter.java
+++ b/src/java/org/apache/fop/render/pcl/PCLPainter.java
@@ -58,8 +58,7 @@ import org.apache.fop.traits.RuleStyle;
import org.apache.fop.util.CharUtilities;
/**
- * {@link org.apache.fop.render.intermediate.IFPainter} implementation
- * that produces PCL 5.
+ * {@link IFPainter} implementation that produces PCL 5.
*/
public class PCLPainter extends AbstractIFPainter implements PCLConstants {
diff --git a/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java b/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java
index 46e8ebe95..59d3930f7 100644
--- a/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java
+++ b/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java
@@ -20,16 +20,13 @@
package org.apache.fop.render.pdf;
import java.awt.color.ColorSpace;
import java.awt.color.ICC_Profile;
-import java.awt.image.IndexColorModel;
-import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.xmlgraphics.image.loader.Image;
import org.apache.xmlgraphics.java2d.color.profile.ColorProfileUtil;
-import org.apache.fop.pdf.PDFArray;
import org.apache.fop.pdf.PDFColor;
import org.apache.fop.pdf.PDFConformanceException;
import org.apache.fop.pdf.PDFDeviceColorSpace;
@@ -53,11 +50,7 @@ public abstract class AbstractImageAdapter implements PDFImage {
/** the image */
protected Image image;
- private PDFICCStream pdfICCStream;
-
- private static final int MAX_HIVAL = 255;
-
- private boolean multipleFiltersAllowed = true;
+ private PDFICCStream pdfICCStream = null;
/**
* Creates a new PDFImage from an Image instance.
@@ -210,68 +203,6 @@ public abstract class AbstractImageAdapter implements PDFImage {
}
/**
- * This is to be used by populateXObjectDictionary() when the image is palette based.
- * @param dict the dictionary to fill in
- * @param icm the image color model
- */
- protected void populateXObjectDictionaryForIndexColorModel(PDFDictionary dict, IndexColorModel icm) {
- PDFArray indexed = new PDFArray(dict);
- indexed.add(new PDFName("Indexed"));
- if (icm.getColorSpace().getType() != ColorSpace.TYPE_RGB) {
- log.warn("Indexed color space is not using RGB as base color space."
- + " The image may not be handled correctly." + " Base color space: "
- + icm.getColorSpace() + " Image: " + image.getInfo());
- }
- indexed.add(new PDFName(toPDFColorSpace(icm.getColorSpace()).getName()));
- int c = icm.getMapSize();
- int hival = c - 1;
- if (hival > MAX_HIVAL) {
- throw new UnsupportedOperationException("hival must not go beyond " + MAX_HIVAL);
- }
- indexed.add(Integer.valueOf(hival));
- int[] palette = new int[c];
- icm.getRGBs(palette);
- ByteArrayOutputStream baout = new ByteArrayOutputStream();
- for (int i = 0; i < c; i++) {
- // TODO Probably doesn't work for non RGB based color spaces
- // See log warning above
- int entry = palette[i];
- baout.write((entry & 0xFF0000) >> 16);
- baout.write((entry & 0xFF00) >> 8);
- baout.write(entry & 0xFF);
- }
- indexed.add(baout.toByteArray());
-
- dict.put("ColorSpace", indexed);
- dict.put("BitsPerComponent", icm.getPixelSize());
-
- Integer index = getIndexOfFirstTransparentColorInPalette(icm);
- if (index != null) {
- PDFArray mask = new PDFArray(dict);
- mask.add(index);
- mask.add(index);
- dict.put("Mask", mask);
- }
- }
-
- private static Integer getIndexOfFirstTransparentColorInPalette(IndexColorModel icm) {
- byte[] alphas = new byte[icm.getMapSize()];
- byte[] reds = new byte[icm.getMapSize()];
- byte[] greens = new byte[icm.getMapSize()];
- byte[] blues = new byte[icm.getMapSize()];
- icm.getAlphas(alphas);
- icm.getReds(reds);
- icm.getGreens(greens);
- icm.getBlues(blues);
- for (int i = 0; i < icm.getMapSize(); i++) {
- if ((alphas[i] & 0xFF) == 0) {
- return Integer.valueOf(i);
- }
- }
- return null;
- }
-
- /**
* Converts a ColorSpace object to a PDFColorSpace object.
* @param cs ColorSpace instance
* @return PDFColorSpace new converted object
@@ -295,17 +226,5 @@ public abstract class AbstractImageAdapter implements PDFImage {
return pdfCS;
}
- /** {@inheritDoc} */
- public boolean multipleFiltersAllowed() {
- return multipleFiltersAllowed;
- }
-
- /**
- * Disallows multiple filters.
- */
- public void disallowMultipleFilters() {
- multipleFiltersAllowed = false;
- }
-
}
diff --git a/src/java/org/apache/fop/render/pdf/ImageRawPNGAdapter.java b/src/java/org/apache/fop/render/pdf/ImageRawPNGAdapter.java
deleted file mode 100644
index b9f5e1d28..000000000
--- a/src/java/org/apache/fop/render/pdf/ImageRawPNGAdapter.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * 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$ */
-
-// Original author: Matthias Reichenbacher
-
-package org.apache.fop.render.pdf;
-
-import java.awt.image.ColorModel;
-import java.awt.image.IndexColorModel;
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.zip.Deflater;
-import java.util.zip.DeflaterOutputStream;
-import java.util.zip.Inflater;
-import java.util.zip.InflaterInputStream;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.io.output.ByteArrayOutputStream;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.xmlgraphics.image.loader.impl.ImageRawPNG;
-import org.apache.xmlgraphics.image.loader.impl.ImageRawStream;
-
-import org.apache.fop.pdf.BitmapImage;
-import org.apache.fop.pdf.FlateFilter;
-import org.apache.fop.pdf.PDFColor;
-import org.apache.fop.pdf.PDFDeviceColorSpace;
-import org.apache.fop.pdf.PDFDictionary;
-import org.apache.fop.pdf.PDFDocument;
-import org.apache.fop.pdf.PDFFilter;
-import org.apache.fop.pdf.PDFFilterException;
-import org.apache.fop.pdf.PDFFilterList;
-import org.apache.fop.pdf.PDFICCStream;
-import org.apache.fop.pdf.PDFReference;
-
-public class ImageRawPNGAdapter extends AbstractImageAdapter {
-
- /** logging instance */
- private static Log log = LogFactory.getLog(ImageRawPNGAdapter.class);
-
- private PDFICCStream pdfICCStream;
- private PDFFilter pdfFilter;
- private String maskRef;
- private PDFReference softMask;
- private int numberOfInterleavedComponents;
-
- /**
- * Creates a new PDFImage from an Image instance.
- * @param image the image
- * @param key XObject key
- */
- public ImageRawPNGAdapter(ImageRawPNG image, String key) {
- super(image, key);
- }
-
- /** {@inheritDoc} */
- public void setup(PDFDocument doc) {
- super.setup(doc);
- ColorModel cm = ((ImageRawPNG) this.image).getColorModel();
- if (cm instanceof IndexColorModel) {
- numberOfInterleavedComponents = 1;
- } else {
- // this can be 1 (gray), 2 (gray + alpha), 3 (rgb) or 4 (rgb + alpha)
- // numberOfInterleavedComponents = (cm.hasAlpha() ? 1 : 0) + cm.getNumColorComponents();
- numberOfInterleavedComponents = cm.getNumComponents();
- }
-
- // set up image compression for non-alpha channel
- FlateFilter flate;
- try {
- flate = new FlateFilter();
- flate.setApplied(true);
- flate.setPredictor(FlateFilter.PREDICTION_PNG_OPT);
- if (numberOfInterleavedComponents < 3) {
- // means palette (1) or gray (1) or gray + alpha (2)
- flate.setColors(1);
- } else {
- // means rgb (3) or rgb + alpha (4)
- flate.setColors(3);
- }
- flate.setColumns(image.getSize().getWidthPx());
- flate.setBitsPerComponent(this.getBitsPerComponent());
- } catch (PDFFilterException e) {
- throw new RuntimeException("FlateFilter configuration error", e);
- }
- this.pdfFilter = flate;
- this.disallowMultipleFilters();
-
- // Handle transparency channel if applicable; note that for palette images the transparency is
- // not TRANSLUCENT
- if (cm.hasAlpha() && cm.getTransparency() == ColorModel.TRANSLUCENT) {
- doc.getProfile().verifyTransparencyAllowed(image.getInfo().getOriginalURI());
- // TODO: Implement code to combine image with background color if transparency is not allowed
- // here we need to inflate the PNG pixel data, which includes alpha, separate the alpha channel
- // and then deflate it back again
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- DeflaterOutputStream dos = new DeflaterOutputStream(baos, new Deflater());
- InputStream in = ((ImageRawStream) image).createInputStream();
- try {
- InflaterInputStream infStream = new InflaterInputStream(in, new Inflater());
- DataInputStream dataStream = new DataInputStream(infStream);
- // offset is the byte offset of the alpha component
- int offset = numberOfInterleavedComponents - 1; // 1 for GA, 3 for RGBA
- int numColumns = image.getSize().getWidthPx();
- int bytesPerRow = numberOfInterleavedComponents * numColumns;
- int filter;
- // read line by line; the first byte holds the filter
- while ((filter = dataStream.read()) != -1) {
- byte[] bytes = new byte[bytesPerRow];
- dataStream.readFully(bytes, 0, bytesPerRow);
- dos.write((byte) filter);
- for (int j = 0; j < numColumns; j++) {
- dos.write(bytes, offset, 1);
- offset += numberOfInterleavedComponents;
- }
- offset = numberOfInterleavedComponents - 1;
- }
- dos.close();
- } catch (IOException e) {
- throw new RuntimeException("Error processing transparency channel:", e);
- } finally {
- IOUtils.closeQuietly(in);
- }
- // set up alpha channel compression
- FlateFilter transFlate;
- try {
- transFlate = new FlateFilter();
- transFlate.setApplied(true);
- transFlate.setPredictor(FlateFilter.PREDICTION_PNG_OPT);
- transFlate.setColors(1);
- transFlate.setColumns(image.getSize().getWidthPx());
- transFlate.setBitsPerComponent(this.getBitsPerComponent());
- } catch (PDFFilterException e) {
- throw new RuntimeException("FlateFilter configuration error", e);
- }
- BitmapImage alphaMask = new BitmapImage("Mask:" + this.getKey(), image.getSize().getWidthPx(),
- image.getSize().getHeightPx(), baos.toByteArray(), null);
- alphaMask.setPDFFilter(transFlate);
- alphaMask.disallowMultipleFilters();
- alphaMask.setColorSpace(new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_GRAY));
- softMask = doc.addImage(null, alphaMask).makeReference();
- }
- }
-
- /** {@inheritDoc} */
- public PDFDeviceColorSpace getColorSpace() {
- // DeviceGray, DeviceRGB, or DeviceCMYK
- return toPDFColorSpace(image.getColorSpace());
- }
-
- /** {@inheritDoc} */
- public int getBitsPerComponent() {
- return ((ImageRawPNG) this.image).getBitDepth();
- }
-
- /** {@inheritDoc} */
- public boolean isTransparent() {
- return ((ImageRawPNG) this.image).isTransparent();
- }
-
- /** {@inheritDoc} */
- public PDFColor getTransparentColor() {
- return new PDFColor(((ImageRawPNG) this.image).getTransparentColor());
- }
-
- /** {@inheritDoc} */
- public String getMask() {
- return maskRef;
- }
-
- /** {@inheritDoc} */
- public String getSoftMask() {
- return softMask.toString();
- }
-
- /** {@inheritDoc} */
- public PDFReference getSoftMaskReference() {
- return softMask;
- }
-
- /** {@inheritDoc} */
- public PDFFilter getPDFFilter() {
- return pdfFilter;
- }
-
- /** {@inheritDoc} */
- public void outputContents(OutputStream out) throws IOException {
- InputStream in = ((ImageRawStream) image).createInputStream();
-
- try {
- if (numberOfInterleavedComponents == 1 || numberOfInterleavedComponents == 3) {
- // means we have Gray, RGB, or Palette
- IOUtils.copy(in, out);
- } else {
- // means we have Gray + alpha or RGB + alpha
- // TODO: since we have alpha here do this when the alpha channel is extracted
- int numBytes = numberOfInterleavedComponents - 1; // 1 for Gray, 3 for RGB
- int numColumns = image.getSize().getWidthPx();
- InflaterInputStream infStream = new InflaterInputStream(in, new Inflater());
- DataInputStream dataStream = new DataInputStream(infStream);
- int offset = 0;
- int bytesPerRow = numberOfInterleavedComponents * numColumns;
- int filter;
- // here we need to inflate the PNG pixel data, which includes alpha, separate the alpha
- // channel and then deflate the RGB channels back again
- DeflaterOutputStream dos = new DeflaterOutputStream(out, new Deflater());
- while ((filter = dataStream.read()) != -1) {
- byte[] bytes = new byte[bytesPerRow];
- dataStream.readFully(bytes, 0, bytesPerRow);
- dos.write((byte) filter);
- for (int j = 0; j < numColumns; j++) {
- dos.write(bytes, offset, numBytes);
- offset += numberOfInterleavedComponents;
- }
- offset = 0;
- }
- dos.close();
- }
- } finally {
- IOUtils.closeQuietly(in);
- }
- }
-
- /** {@inheritDoc} */
- public PDFICCStream getICCStream() {
- return pdfICCStream;
- }
-
- /** {@inheritDoc} */
- public String getFilterHint() {
- return PDFFilterList.PRECOMPRESSED_FILTER;
- }
-
- public void populateXObjectDictionary(PDFDictionary dict) {
- ColorModel cm = ((ImageRawPNG) image).getColorModel();
- if (cm instanceof IndexColorModel) {
- IndexColorModel icm = (IndexColorModel) cm;
- super.populateXObjectDictionaryForIndexColorModel(dict, icm);
- }
- }
-}
diff --git a/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java b/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java
index b0b7b79d1..c38a2edaf 100644
--- a/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java
+++ b/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java
@@ -27,6 +27,8 @@ import java.awt.image.RenderedImage;
import java.io.IOException;
import java.io.OutputStream;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -34,12 +36,14 @@ import org.apache.xmlgraphics.image.loader.impl.ImageRendered;
import org.apache.xmlgraphics.ps.ImageEncodingHelper;
import org.apache.fop.pdf.AlphaRasterImage;
+import org.apache.fop.pdf.PDFArray;
import org.apache.fop.pdf.PDFColor;
import org.apache.fop.pdf.PDFDeviceColorSpace;
import org.apache.fop.pdf.PDFDictionary;
import org.apache.fop.pdf.PDFDocument;
import org.apache.fop.pdf.PDFFilter;
import org.apache.fop.pdf.PDFFilterList;
+import org.apache.fop.pdf.PDFName;
import org.apache.fop.pdf.PDFReference;
/**
@@ -158,6 +162,30 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
return (getImage().getTransparentColor() != null);
}
+ private static Integer getIndexOfFirstTransparentColorInPalette(RenderedImage image) {
+ ColorModel cm = image.getColorModel();
+ if (cm instanceof IndexColorModel) {
+ IndexColorModel icm = (IndexColorModel)cm;
+ //Identify the transparent color in the palette
+ byte[] alphas = new byte[icm.getMapSize()];
+ byte[] reds = new byte[icm.getMapSize()];
+ byte[] greens = new byte[icm.getMapSize()];
+ byte[] blues = new byte[icm.getMapSize()];
+ icm.getAlphas(alphas);
+ icm.getReds(reds);
+ icm.getGreens(greens);
+ icm.getBlues(blues);
+ for (int i = 0;
+ i < ((IndexColorModel) cm).getMapSize();
+ i++) {
+ if ((alphas[i] & 0xFF) == 0) {
+ return Integer.valueOf(i);
+ }
+ }
+ }
+ return null;
+ }
+
/** {@inheritDoc} */
@Override
public PDFColor getTransparentColor() {
@@ -202,13 +230,54 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
}
}
+ private static final int MAX_HIVAL = 255;
+
/** {@inheritDoc} */
@Override
public void populateXObjectDictionary(PDFDictionary dict) {
ColorModel cm = getEffectiveColorModel();
if (cm instanceof IndexColorModel) {
- IndexColorModel icm = (IndexColorModel) cm;
- super.populateXObjectDictionaryForIndexColorModel(dict, icm);
+ IndexColorModel icm = (IndexColorModel)cm;
+ PDFArray indexed = new PDFArray(dict);
+ indexed.add(new PDFName("Indexed"));
+
+ if (icm.getColorSpace().getType() != ColorSpace.TYPE_RGB) {
+ log.warn("Indexed color space is not using RGB as base color space."
+ + " The image may not be handled correctly."
+ + " Base color space: " + icm.getColorSpace()
+ + " Image: " + image.getInfo());
+ }
+ indexed.add(new PDFName(toPDFColorSpace(icm.getColorSpace()).getName()));
+ int c = icm.getMapSize();
+ int hival = c - 1;
+ if (hival > MAX_HIVAL) {
+ throw new UnsupportedOperationException("hival must not go beyond " + MAX_HIVAL);
+ }
+ indexed.add(Integer.valueOf(hival));
+ int[] palette = new int[c];
+ icm.getRGBs(palette);
+ ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ for (int i = 0; i < c; i++) {
+ //TODO Probably doesn't work for non RGB based color spaces
+ //See log warning above
+ int entry = palette[i];
+ baout.write((entry & 0xFF0000) >> 16);
+ baout.write((entry & 0xFF00) >> 8);
+ baout.write(entry & 0xFF);
+ }
+ indexed.add(baout.toByteArray());
+ IOUtils.closeQuietly(baout);
+
+ dict.put("ColorSpace", indexed);
+ dict.put("BitsPerComponent", icm.getPixelSize());
+
+ Integer index = getIndexOfFirstTransparentColorInPalette(getImage().getRenderedImage());
+ if (index != null) {
+ PDFArray mask = new PDFArray(dict);
+ mask.add(index);
+ mask.add(index);
+ dict.put("Mask", mask);
+ }
}
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawPNG.java b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawPNG.java
deleted file mode 100644
index 3475954a8..000000000
--- a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawPNG.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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$ */
-
-// Original author: Matthias Reichenbacher
-
-package org.apache.fop.render.pdf;
-
-import org.apache.xmlgraphics.image.loader.Image;
-import org.apache.xmlgraphics.image.loader.ImageFlavor;
-import org.apache.xmlgraphics.image.loader.impl.ImageRawPNG;
-
-import org.apache.fop.pdf.PDFImage;
-import org.apache.fop.render.RenderingContext;
-
-/**
- * Image handler implementation which handles CCITT encoded images (CCITT fax group 3/4)
- * for PDF output.
- */
-public class PDFImageHandlerRawPNG extends AbstractPDFImageHandler {
-
- private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {ImageFlavor.RAW_PNG};
-
- @Override
- PDFImage createPDFImage(Image image, String xobjectKey) {
- return new ImageRawPNGAdapter((ImageRawPNG) image, xobjectKey);
- }
-
- /** {@inheritDoc} */
- public int getPriority() {
- return 100;
- }
-
- /** {@inheritDoc} */
- public Class<ImageRawPNG> getSupportedImageClass() {
- return ImageRawPNG.class;
- }
-
- /** {@inheritDoc} */
- public ImageFlavor[] getSupportedImageFlavors() {
- return FLAVORS;
- }
-
- /** {@inheritDoc} */
- public boolean isCompatible(RenderingContext targetContext, Image image) {
- return (image == null || image instanceof ImageRawPNG)
- && targetContext instanceof PDFRenderingContext;
- }
-
-}
diff --git a/src/java/org/apache/fop/render/ps/FontResourceCache.java b/src/java/org/apache/fop/render/ps/FontResourceCache.java
index 1514d201e..9d4090eed 100644
--- a/src/java/org/apache/fop/render/ps/FontResourceCache.java
+++ b/src/java/org/apache/fop/render/ps/FontResourceCache.java
@@ -42,20 +42,19 @@ class FontResourceCache {
}
/**
- * Returns the PSFontResource for the given font key.
+ * Returns the PSResource for the given font key.
* @param key the font key ("F*")
- * @return the matching PSFontResource instance
+ * @return the matching PSResource
*/
- public PSFontResource getFontResourceForFontKey(String key) {
- PSFontResource res = null;
+ public PSResource getPSResourceForFontKey(String key) {
+ PSResource res = null;
if (this.fontResources != null) {
- res = (PSFontResource)this.fontResources.get(key);
+ res = (PSResource)this.fontResources.get(key);
} else {
this.fontResources = new java.util.HashMap();
}
if (res == null) {
- res = PSFontResource.createFontResource(
- new PSResource(PSResource.TYPE_FONT, getPostScriptNameForFontKey(key)));
+ res = new PSResource(PSResource.TYPE_FONT, getPostScriptNameForFontKey(key));
this.fontResources.put(key, res);
}
return res;
@@ -77,9 +76,9 @@ class FontResourceCache {
throw new IllegalStateException("Font not available: " + key);
}
if (postFix == null) {
- return tf.getEmbedFontName();
+ return tf.getFontName();
} else {
- return tf.getEmbedFontName() + postFix;
+ return tf.getFontName() + postFix;
}
}
diff --git a/src/java/org/apache/fop/render/ps/ImageEncoderPNG.java b/src/java/org/apache/fop/render/ps/ImageEncoderPNG.java
deleted file mode 100644
index bcda90bda..000000000
--- a/src/java/org/apache/fop/render/ps/ImageEncoderPNG.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * 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;
-
-import java.awt.image.ColorModel;
-import java.awt.image.IndexColorModel;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.zip.Deflater;
-import java.util.zip.DeflaterOutputStream;
-import java.util.zip.Inflater;
-import java.util.zip.InflaterInputStream;
-
-import org.apache.commons.io.IOUtils;
-
-import org.apache.xmlgraphics.image.loader.impl.ImageRawPNG;
-import org.apache.xmlgraphics.image.loader.impl.ImageRawStream;
-import org.apache.xmlgraphics.ps.ImageEncoder;
-
-/**
- * ImageEncoder implementation for PNG images.
- */
-public class ImageEncoderPNG implements ImageEncoder {
- private final ImageRawPNG image;
- private int numberOfInterleavedComponents;
-
- /**
- * Main constructor
- * @param image the PNG image
- */
- public ImageEncoderPNG(ImageRawPNG image) {
- this.image = image;
- ColorModel cm = ((ImageRawPNG) this.image).getColorModel();
- if (cm instanceof IndexColorModel) {
- numberOfInterleavedComponents = 1;
- } else {
- // this can be 1 (gray), 2 (gray + alpha), 3 (rgb) or 4 (rgb + alpha)
- // numberOfInterleavedComponents = (cm.hasAlpha() ? 1 : 0) + cm.getNumColorComponents();
- numberOfInterleavedComponents = cm.getNumComponents();
- }
- }
-
- /** {@inheritDoc} */
- public void writeTo(OutputStream out) throws IOException {
- // TODO: refactor this code with equivalent PDF code
- InputStream in = ((ImageRawStream) image).createInputStream();
- try {
- if (numberOfInterleavedComponents == 1 || numberOfInterleavedComponents == 3) {
- // means we have Gray, RGB, or Palette
- IOUtils.copy(in, out);
- } else {
- // means we have Gray + alpha or RGB + alpha
- int numBytes = numberOfInterleavedComponents - 1; // 1 for Gray, 3 for RGB
- int numColumns = image.getSize().getWidthPx();
- InflaterInputStream infStream = new InflaterInputStream(in, new Inflater());
- DataInputStream dataStream = new DataInputStream(infStream);
- int offset = 0;
- int bytesPerRow = numberOfInterleavedComponents * numColumns;
- int filter;
- // here we need to inflate the PNG pixel data, which includes alpha, separate the alpha
- // channel and then deflate the RGB channels back again
- // TODO: not using the baos below and using the original out instead (as happens in PDF)
- // would be preferable but that does not work with the rest of the postscript code; this
- // needs to be revisited
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- DeflaterOutputStream dos = new DeflaterOutputStream(/* out */baos, new Deflater());
- while ((filter = dataStream.read()) != -1) {
- byte[] bytes = new byte[bytesPerRow];
- dataStream.readFully(bytes, 0, bytesPerRow);
- dos.write((byte) filter);
- for (int j = 0; j < numColumns; j++) {
- dos.write(bytes, offset, numBytes);
- offset += numberOfInterleavedComponents;
- }
- offset = 0;
- }
- dos.close();
- IOUtils.copy(new ByteArrayInputStream(baos.toByteArray()), out);
- }
- } finally {
- IOUtils.closeQuietly(in);
- }
- }
-
- /** {@inheritDoc} */
- public String getImplicitFilter() {
- String filter = "<< /Predictor 15 /Columns " + image.getSize().getWidthPx();
- filter += " /Colors " + (numberOfInterleavedComponents > 2 ? 3 : 1);
- filter += " /BitsPerComponent " + image.getBitDepth() + " >> /FlateDecode";
- return filter;
- }
-}
diff --git a/src/java/org/apache/fop/render/ps/NativeTextHandler.java b/src/java/org/apache/fop/render/ps/NativeTextHandler.java
index e8f123dc5..33adcb8d7 100644
--- a/src/java/org/apache/fop/render/ps/NativeTextHandler.java
+++ b/src/java/org/apache/fop/render/ps/NativeTextHandler.java
@@ -100,6 +100,12 @@ public class NativeTextHandler implements PSTextHandler {
//nop
}
+ /** {@inheritDoc} */
+ public void drawString(String text, float x, float y) throws IOException {
+ // TODO Remove me after removing the deprecated method in TextHandler.
+ throw new UnsupportedOperationException("Deprecated method!");
+ }
+
/**
* Draw a string to the PostScript document. The text is painted using
* text operations.
diff --git a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java
index 0fe564827..490e42b2d 100644
--- a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java
+++ b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java
@@ -26,7 +26,6 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -50,7 +49,6 @@ import org.apache.xmlgraphics.ps.dsc.ResourceTracker;
import org.apache.xmlgraphics.ps.dsc.events.DSCCommentBoundingBox;
import org.apache.xmlgraphics.ps.dsc.events.DSCCommentHiResBoundingBox;
-import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.render.intermediate.AbstractBinaryWritingIFDocumentHandler;
import org.apache.fop.render.intermediate.IFContext;
@@ -59,13 +57,11 @@ import org.apache.fop.render.intermediate.IFException;
import org.apache.fop.render.intermediate.IFPainter;
import org.apache.fop.render.ps.extensions.PSCommentAfter;
import org.apache.fop.render.ps.extensions.PSCommentBefore;
-import org.apache.fop.render.ps.extensions.PSPageTrailerCodeBefore;
import org.apache.fop.render.ps.extensions.PSSetPageDevice;
import org.apache.fop.render.ps.extensions.PSSetupCode;
/**
- * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation
- * that produces PostScript.
+ * {@link IFDocumentHandler} implementation that produces PostScript.
*/
public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
@@ -102,13 +98,10 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
private PSPageDeviceDictionary pageDeviceDictionary;
/** This is a collection holding all document header comments */
- private Collection[] comments = new Collection[4];
+ private Collection[] comments = new Collection[3];
private static final int COMMENT_DOCUMENT_HEADER = 0;
private static final int COMMENT_DOCUMENT_TRAILER = 1;
private static final int COMMENT_PAGE_TRAILER = 2;
- private static final int PAGE_TRAILER_CODE_BEFORE = 3;
-
- private PSEventProducer eventProducer;
/**
* Default constructor.
@@ -129,9 +122,7 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
/** {@inheritDoc} */
public void setContext(IFContext context) {
super.setContext(context);
- FOUserAgent userAgent = context.getUserAgent();
- this.psUtil = new PSRenderingUtil(userAgent);
- eventProducer = PSEventProducer.Provider.get(userAgent.getEventBroadcaster());
+ this.psUtil = new PSRenderingUtil(context.getUserAgent());
}
/** {@inheritDoc} */
@@ -150,7 +141,7 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
try {
OutputStream out;
if (psUtil.isOptimizeResources()) {
- this.tempFile = File.createTempFile("fop", ".ps");
+ this.tempFile = File.createTempFile("fop", null);
out = new java.io.FileOutputStream(this.tempFile);
out = new java.io.BufferedOutputStream(out);
} else {
@@ -208,7 +199,7 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
gen.writeDSCComment(DSCConstants.BEGIN_SETUP);
PSRenderingUtil.writeSetupCodeList(gen, setupCodeList, "SetupCode");
if (!psUtil.isOptimizeResources()) {
- this.fontResources.addAll(PSFontUtils.writeFontDict(gen, fontInfo, eventProducer));
+ this.fontResources.addAll(PSFontUtils.writeFontDict(gen, fontInfo));
} else {
gen.commentln("%FOPFontSetup"); //Place-holder, will be replaced in the second pass
}
@@ -263,8 +254,8 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
in = new java.io.BufferedInputStream(in);
try {
try {
- ResourceHandler handler = new ResourceHandler(getUserAgent(), eventProducer,
- this.fontInfo, resTracker, this.formResources);
+ ResourceHandler handler = new ResourceHandler(getUserAgent(), this.fontInfo,
+ resTracker, this.formResources);
handler.process(in, this.outputStream,
this.currentPageNumber, this.documentBoundingBox);
this.outputStream.flush();
@@ -452,9 +443,8 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
/** {@inheritDoc} */
public void startPageTrailer() throws IFException {
+ super.startPageTrailer();
try {
- writeExtensions(PAGE_TRAILER_CODE_BEFORE);
- super.startPageTrailer();
gen.writeDSCComment(DSCConstants.PAGE_TRAILER);
} catch (IOException ioe) {
throw new IFException("I/O error in startPageTrailer()", ioe);
@@ -536,11 +526,6 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
comments[targetCollection] = new java.util.ArrayList();
}
comments[targetCollection].add(extension);
- } else if (extension instanceof PSPageTrailerCodeBefore) {
- if (comments[PAGE_TRAILER_CODE_BEFORE] == null) {
- comments[PAGE_TRAILER_CODE_BEFORE] = new ArrayList();
- }
- comments[PAGE_TRAILER_CODE_BEFORE].add(extension);
}
} catch (IOException ioe) {
throw new IFException("I/O error in handleExtensionObject()", ioe);
@@ -552,8 +537,8 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
* @param key the font key ("F*")
* @return the matching PSResource
*/
- protected PSFontResource getPSResourceForFontKey(String key) {
- return this.fontResources.getFontResourceForFontKey(key);
+ protected PSResource getPSResourceForFontKey(String key) {
+ return this.fontResources.getPSResourceForFontKey(key);
}
/**
diff --git a/src/java/org/apache/fop/render/ps/PSEventProducer.java b/src/java/org/apache/fop/render/ps/PSEventProducer.java
index bffdf2236..702380a4d 100644
--- a/src/java/org/apache/fop/render/ps/PSEventProducer.java
+++ b/src/java/org/apache/fop/render/ps/PSEventProducer.java
@@ -53,11 +53,4 @@ public interface PSEventProducer extends EventProducer {
*/
void postscriptDictionaryParseError(Object source, String content, Exception e);
- /**
- * PostScript Level 3 features are necessary.
- *
- * @param source the event source
- * @event.severity FATAL
- */
- void postscriptLevel3Needed(Object source);
}
diff --git a/src/java/org/apache/fop/render/ps/PSEventProducer.xml b/src/java/org/apache/fop/render/ps/PSEventProducer.xml
index 64b22d1a4..bcd89ed07 100644
--- a/src/java/org/apache/fop/render/ps/PSEventProducer.xml
+++ b/src/java/org/apache/fop/render/ps/PSEventProducer.xml
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<catalogue xml:lang="en">
<message key="postscriptDictionaryParseError">Failed to parse dictionary string. Reason: {e}, content = "{content}"</message>
- <message key="postscriptLevel3Needed">PostScript Level 3 features are needed to handle this document.</message>
</catalogue>
diff --git a/src/java/org/apache/fop/render/ps/PSFontResource.java b/src/java/org/apache/fop/render/ps/PSFontResource.java
deleted file mode 100644
index 8b7b835ed..000000000
--- a/src/java/org/apache/fop/render/ps/PSFontResource.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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;
-
-import org.apache.xmlgraphics.ps.PSResource;
-import org.apache.xmlgraphics.ps.dsc.ResourceTracker;
-
-/**
- * A DSC resource corresponding to a font. This class handles the possible other resources
- * that a font may depend on. For example, a CID-keyed font depends on a CIDFont resource, a
- * CMap resource, and the ProcSet CIDInit resource.
- */
-abstract class PSFontResource {
-
- static PSFontResource createFontResource(final PSResource fontResource) {
- return new PSFontResource() {
-
- String getName() {
- return fontResource.getName();
- }
-
- void notifyResourceUsageOnPage(ResourceTracker resourceTracker) {
- resourceTracker.notifyResourceUsageOnPage(fontResource);
- }
- };
- }
-
- static PSFontResource createFontResource(final PSResource fontResource,
- final PSResource procsetCIDInitResource, final PSResource cmapResource,
- final PSResource cidFontResource) {
- return new PSFontResource() {
-
- String getName() {
- return fontResource.getName();
- }
-
- void notifyResourceUsageOnPage(ResourceTracker resourceTracker) {
- resourceTracker.notifyResourceUsageOnPage(fontResource);
- resourceTracker.notifyResourceUsageOnPage(procsetCIDInitResource);
- resourceTracker.notifyResourceUsageOnPage(cmapResource);
- resourceTracker.notifyResourceUsageOnPage(cidFontResource);
- }
- };
- }
-
- /**
- * Returns the name of the font resource.
- *
- * @return the name of the font
- */
- abstract String getName();
-
- /**
- * Notifies the given resource tracker of all the resources needed by this font.
- *
- * @param resourceTracker
- */
- abstract void notifyResourceUsageOnPage(ResourceTracker resourceTracker);
-
-}
diff --git a/src/java/org/apache/fop/render/ps/PSFontUtils.java b/src/java/org/apache/fop/render/ps/PSFontUtils.java
index d0d75744f..5e95b5ded 100644
--- a/src/java/org/apache/fop/render/ps/PSFontUtils.java
+++ b/src/java/org/apache/fop/render/ps/PSFontUtils.java
@@ -23,11 +23,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Locale;
import java.util.Map;
-import java.util.Set;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
@@ -42,26 +38,14 @@ import org.apache.xmlgraphics.ps.PSResource;
import org.apache.xmlgraphics.ps.dsc.ResourceTracker;
import org.apache.fop.fonts.Base14Font;
-import org.apache.fop.fonts.CIDFontType;
-import org.apache.fop.fonts.CIDSubset;
-import org.apache.fop.fonts.CMapSegment;
import org.apache.fop.fonts.CustomFont;
-import org.apache.fop.fonts.EmbeddingMode;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.LazyFont;
-import org.apache.fop.fonts.MultiByteFont;
import org.apache.fop.fonts.SingleByteEncoding;
import org.apache.fop.fonts.SingleByteFont;
import org.apache.fop.fonts.Typeface;
-import org.apache.fop.fonts.truetype.FontFileReader;
-import org.apache.fop.fonts.truetype.TTFFile;
-import org.apache.fop.fonts.truetype.TTFFile.PostScriptVersion;
-import org.apache.fop.fonts.truetype.TTFOutputStream;
-import org.apache.fop.fonts.truetype.TTFSubSetFile;
-import org.apache.fop.render.ps.fonts.PSTTFOutputStream;
-import org.apache.fop.util.HexEncoder;
/**
* Utility code for font handling in PostScript.
@@ -70,6 +54,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
/** logging instance */
protected static final Log log = LogFactory.getLog(PSFontUtils.class);
+
/**
* Generates the PostScript code for the font dictionary. This method should only be
* used if no "resource optimization" is performed, i.e. when the fonts are not embedded
@@ -81,22 +66,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
*/
public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo)
throws IOException {
- return writeFontDict(gen, fontInfo, null);
- }
-
- /**
- * Generates the PostScript code for the font dictionary. This method should only be
- * used if no "resource optimization" is performed, i.e. when the fonts are not embedded
- * in a second pass.
- * @param gen PostScript generator to use for output
- * @param fontInfo available fonts
- * @param eventProducer to report events
- * @return a Map of PSResource instances representing all defined fonts (key: font key)
- * @throws IOException in case of an I/O problem
- */
- public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo,
- PSEventProducer eventProducer) throws IOException {
- return writeFontDict(gen, fontInfo, fontInfo.getFonts(), true, eventProducer);
+ return writeFontDict(gen, fontInfo, fontInfo.getFonts(), true);
}
/**
@@ -106,13 +76,13 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
* @param gen PostScript generator to use for output
* @param fontInfo available fonts
* @param fonts the set of fonts to work with
- * @param eventProducer the event producer
* @return a Map of PSResource instances representing all defined fonts (key: font key)
* @throws IOException in case of an I/O problem
*/
- public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo, Map<String, Typeface> fonts,
- PSEventProducer eventProducer) throws IOException {
- return writeFontDict(gen, fontInfo, fonts, false, eventProducer);
+ public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo,
+ Map<String, Typeface> fonts)
+ throws IOException {
+ return writeFontDict(gen, fontInfo, fonts, false);
}
/**
@@ -126,16 +96,15 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
* @throws IOException in case of an I/O problem
*/
private static Map writeFontDict(PSGenerator gen, FontInfo fontInfo,
- Map<String, Typeface> fonts, boolean encodeAllCharacters, PSEventProducer eventProducer)
- throws IOException {
+ Map<String, Typeface> fonts, boolean encodeAllCharacters) throws IOException {
gen.commentln("%FOPBeginFontDict");
- Map fontResources = new HashMap();
+ Map fontResources = new java.util.HashMap();
for (String key : fonts.keySet()) {
Typeface tf = getTypeFace(fontInfo, fonts, key);
- PSResource fontRes = new PSResource(PSResource.TYPE_FONT, tf.getEmbedFontName());
- PSFontResource fontResource = embedFont(gen, tf, fontRes, eventProducer);
- fontResources.put(key, fontResource);
+ PSResource fontRes = new PSResource(PSResource.TYPE_FONT, tf.getFontName());
+ fontResources.put(key, fontRes);
+ embedFont(gen, tf, fontRes);
if (tf instanceof SingleByteFont) {
SingleByteFont sbf = (SingleByteFont)tf;
@@ -148,18 +117,9 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
SingleByteEncoding encoding = sbf.getAdditionalEncoding(i);
defineEncoding(gen, encoding);
String postFix = "_" + (i + 1);
- PSResource derivedFontRes;
- if (tf.getFontType() == FontType.TRUETYPE
- && sbf.getTrueTypePostScriptVersion() != PostScriptVersion.V2) {
- derivedFontRes = defineDerivedTrueTypeFont(gen, eventProducer,
- tf.getEmbedFontName(), tf.getEmbedFontName() + postFix, encoding,
- sbf.getCMap());
- } else {
- derivedFontRes = defineDerivedFont(gen, tf.getEmbedFontName(),
- tf.getEmbedFontName() + postFix, encoding.getName());
- }
- fontResources.put(key + postFix,
- PSFontResource.createFontResource(derivedFontRes));
+ PSResource derivedFontRes = defineDerivedFont(gen, tf.getFontName(),
+ tf.getFontName() + postFix, encoding.getName());
+ fontResources.put(key + postFix, derivedFontRes);
}
}
}
@@ -196,12 +156,12 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
} else {
if (tf instanceof Base14Font) {
//Our Base 14 fonts don't use the default encoding
- redefineFontEncoding(gen, tf.getEmbedFontName(), tf.getEncodingName());
+ redefineFontEncoding(gen, tf.getFontName(), tf.getEncodingName());
} else if (tf instanceof SingleByteFont) {
SingleByteFont sbf = (SingleByteFont)tf;
if (!sbf.isUsingNativeEncoding()) {
//Font has been configured to use an encoding other than the default one
- redefineFontEncoding(gen, tf.getEmbedFontName(), tf.getEncodingName());
+ redefineFontEncoding(gen, tf.getFontName(), tf.getEncodingName());
}
}
}
@@ -224,299 +184,39 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
return tf;
}
- private static PSFontResource embedFont(PSGenerator gen, Typeface tf, PSResource fontRes,
- PSEventProducer eventProducer) throws IOException {
- FontType fontType = tf.getFontType();
- PSFontResource fontResource = null;
- if (!(fontType == FontType.TYPE1 || fontType == FontType.TRUETYPE
- || fontType == FontType.TYPE0) || !(tf instanceof CustomFont)) {
- gen.writeDSCComment(DSCConstants.INCLUDE_RESOURCE, fontRes);
- fontResource = PSFontResource.createFontResource(fontRes);
- return fontResource;
- }
- CustomFont cf = (CustomFont)tf;
- if (isEmbeddable(cf)) {
- InputStream in = getInputStreamOnFont(gen, cf);
- if (in == null) {
- gen.commentln("%WARNING: Could not embed font: " + cf.getEmbedFontName());
- log.warn("Font " + cf.getEmbedFontName() + " is marked as supplied in the"
- + " PostScript file but could not be embedded!");
- gen.writeDSCComment(DSCConstants.INCLUDE_RESOURCE, fontRes);
- fontResource = PSFontResource.createFontResource(fontRes);
- return fontResource;
- }
- if (fontType == FontType.TYPE0) {
- if (gen.embedIdentityH()) {
- checkPostScriptLevel3(gen, eventProducer);
- /*
- * First CID-keyed font to be embedded; add
- * %%IncludeResource: comment for ProcSet CIDInit.
- */
- gen.includeProcsetCIDInitResource();
- }
- PSResource cidFontResource = embedType2CIDFont(gen,
- (MultiByteFont) tf, in);
- fontResource = PSFontResource.createFontResource(fontRes,
- gen.getProcsetCIDInitResource(), gen.getIdentityHCMapResource(),
- cidFontResource);
- }
- gen.writeDSCComment(DSCConstants.BEGIN_RESOURCE, fontRes);
- if (fontType == FontType.TYPE1) {
- embedType1Font(gen, in);
- fontResource = PSFontResource.createFontResource(fontRes);
- } else if (fontType == FontType.TRUETYPE) {
- embedTrueTypeFont(gen, (SingleByteFont) tf, in);
- fontResource = PSFontResource.createFontResource(fontRes);
- } else {
- composeType0Font(gen, (MultiByteFont) tf, in);
- }
- gen.writeDSCComment(DSCConstants.END_RESOURCE);
- gen.getResourceTracker().registerSuppliedResource(fontRes);
- }
- return fontResource;
- }
-
- private static void checkPostScriptLevel3(PSGenerator gen, PSEventProducer eventProducer) {
- if (gen.getPSLevel() < 3) {
- if (eventProducer != null) {
- eventProducer.postscriptLevel3Needed(gen);
- } else {
- throw new IllegalStateException("PostScript Level 3 is"
- + " required to use TrueType fonts,"
- + " configured level is "
- + gen.getPSLevel());
- }
- }
- }
-
- private static void embedTrueTypeFont(PSGenerator gen,
- SingleByteFont font, InputStream fontStream) throws IOException {
- /* See Adobe Technical Note #5012, "The Type 42 Font Format Specification" */
- gen.commentln("%!PS-TrueTypeFont-65536-65536-1"); // TODO TrueType & font versions
- gen.writeln("11 dict begin");
- if (font.getEmbeddingMode() == EmbeddingMode.AUTO) {
- font.setEmbeddingMode(EmbeddingMode.SUBSET);
- }
- FontFileReader reader = new FontFileReader(fontStream);
- TTFFile ttfFile = new TTFFile();
- ttfFile.readFont(reader, font.getFullName());
- createType42DictionaryEntries(gen, font, font.getCMap(), ttfFile);
- gen.writeln("FontName currentdict end definefont pop");
- }
-
- private static void createType42DictionaryEntries(PSGenerator gen, CustomFont font,
- CMapSegment[] cmap, TTFFile ttfFile) throws IOException {
- gen.write("/FontName /");
- gen.write(font.getEmbedFontName());
- gen.writeln(" def");
- gen.writeln("/PaintType 0 def");
- gen.writeln("/FontMatrix [1 0 0 1 0 0] def");
- writeFontBBox(gen, font);
- gen.writeln("/FontType 42 def");
- gen.writeln("/Encoding 256 array");
- gen.writeln("0 1 255{1 index exch/.notdef put}for");
- boolean buildCharStrings;
- Set<String> glyphNames = new HashSet<String>();
- if (font.getFontType() == FontType.TYPE0 && font.getEmbeddingMode() != EmbeddingMode.FULL) {
- //"/Encoding" is required but ignored for CID fonts
- //so we keep it minimal to save space
- buildCharStrings = false;
- } else {
- buildCharStrings = true;
- for (int i = 0; i < Glyphs.WINANSI_ENCODING.length; i++) {
- gen.write("dup ");
- gen.write(i);
- gen.write(" /");
- String glyphName = Glyphs.charToGlyphName(Glyphs.WINANSI_ENCODING[i]);
- if (glyphName.equals("")) {
- gen.write(Glyphs.NOTDEF);
- } else {
- gen.write(glyphName);
- glyphNames.add(glyphName);
- }
- gen.writeln(" put");
- }
- }
- gen.writeln("readonly def");
- TTFOutputStream ttfOut = new PSTTFOutputStream(gen);
- ttfFile.stream(ttfOut);
-
- buildCharStrings(gen, buildCharStrings, cmap, glyphNames, font);
- }
-
- private static void buildCharStrings(PSGenerator gen, boolean buildCharStrings,
- CMapSegment[] cmap, Set<String> glyphNames, CustomFont font) throws IOException {
- gen.write("/CharStrings ");
- if (!buildCharStrings) {
- gen.write(1);
- } else if (font.getEmbeddingMode() != EmbeddingMode.FULL) {
- int charCount = 1; //1 for .notdef
- for (CMapSegment segment : cmap) {
- charCount += segment.getUnicodeEnd() - segment.getUnicodeStart() + 1;
- }
- gen.write(charCount);
- } else {
- gen.write(font.getCMap().length);
- }
- gen.writeln(" dict dup begin");
- gen.write("/");
- gen.write(Glyphs.NOTDEF);
- gen.writeln(" 0 def"); // .notdef always has to be at index 0
- if (!buildCharStrings) {
- // If we're not building the full CharStrings we can end here
- gen.writeln("end readonly def");
- return;
- }
- if (font.getEmbeddingMode() != EmbeddingMode.FULL) {
- //Only performed in singly-byte mode, ignored for CID fonts
- for (CMapSegment segment : cmap) {
- int glyphIndex = segment.getGlyphStartIndex();
- for (int ch = segment.getUnicodeStart(); ch <= segment.getUnicodeEnd(); ch++) {
- char ch16 = (char)ch; //TODO Handle Unicode characters beyond 16bit
- String glyphName = Glyphs.charToGlyphName(ch16);
- if ("".equals(glyphName)) {
- glyphName = "u" + Integer.toHexString(ch).toUpperCase(Locale.ENGLISH);
- }
- writeGlyphDefs(gen, glyphName, glyphIndex);
-
- glyphIndex++;
- }
- }
- } else {
- for (String name : glyphNames) {
- writeGlyphDefs(gen, name,
- getGlyphIndex(Glyphs.getUnicodeSequenceForGlyphName(name).charAt(0),
- font.getCMap()));
- }
- }
- gen.writeln("end readonly def");
- }
-
- private static void writeGlyphDefs(PSGenerator gen, String glyphName, int glyphIndex)
+ /**
+ * Embeds a font in the PostScript file.
+ * @param gen the PostScript generator
+ * @param tf the font
+ * @param fontRes the PSResource associated with the font
+ * @throws IOException In case of an I/O error
+ */
+ public static void embedFont(PSGenerator gen, Typeface tf, PSResource fontRes)
throws IOException {
- gen.write("/");
- gen.write(glyphName);
- gen.write(" ");
- gen.write(glyphIndex);
- gen.writeln(" def");
- }
-
- private static int getGlyphIndex(char c, CMapSegment[] cmap) {
- for (CMapSegment segment : cmap) {
- if (segment.getUnicodeStart() <= c && c <= segment.getUnicodeEnd()) {
- return segment.getGlyphStartIndex() + c - segment.getUnicodeStart();
- }
- }
- return 0;
- }
-
- private static void composeType0Font(PSGenerator gen, MultiByteFont font,
- InputStream fontStream) throws IOException {
- String psName = font.getEmbedFontName();
- gen.write("/");
- gen.write(psName);
- gen.write(" /Identity-H [/");
- gen.write(psName);
- gen.writeln("] composefont pop");
- }
-
- private static PSResource embedType2CIDFont(PSGenerator gen,
- MultiByteFont font, InputStream fontStream) throws IOException {
- assert font.getCIDType() == CIDFontType.CIDTYPE2;
-
- String psName = font.getEmbedFontName();
- gen.write("%%BeginResource: CIDFont ");
- gen.writeln(psName);
-
- gen.write("%%Title: (");
- gen.write(psName);
- gen.writeln(" Adobe Identity 0)");
-
- gen.writeln("%%Version: 1"); // TODO use font revision?
- gen.writeln("/CIDInit /ProcSet findresource begin");
- gen.writeln("20 dict begin");
-
- gen.write("/CIDFontName /");
- gen.write(psName);
- gen.writeln(" def");
-
- gen.writeln("/CIDFontVersion 1 def"); // TODO same as %%Version above
-
- gen.write("/CIDFontType ");
- gen.write(font.getCIDType().getValue());
- gen.writeln(" def");
-
- gen.writeln("/CIDSystemInfo 3 dict dup begin");
- gen.writeln(" /Registry (Adobe) def");
- gen.writeln(" /Ordering (Identity) def");
- gen.writeln(" /Supplement 0 def");
- gen.writeln("end def");
-
- // TODO UIDBase (and UIDOffset in CMap) necessary if PostScript Level 1 & 2
- // interpreters are to be supported
- // (Level 1: with composite font extensions; Level 2: those that do not offer
- // native mode support for CID-keyed fonts)
-
- // TODO XUID (optional but strongly recommended)
-
- // TODO /FontInfo
-
- gen.write("/CIDCount ");
- CIDSubset cidSubset = font.getCIDSubset();
- int subsetSize = cidSubset.getSubsetSize();
- gen.write(subsetSize);
- gen.writeln(" def");
- gen.writeln("/GDBytes 2 def"); // TODO always 2?
- gen.writeln("/CIDMap [<");
- int colCount = 0;
- int lineCount = 1;
- for (int cid = 0; cid < subsetSize; cid++) {
- if (colCount++ == 20) {
- gen.newLine();
- colCount = 1;
- if (lineCount++ == 800) {
- gen.writeln("> <");
- lineCount = 1;
+ boolean embeddedFont = false;
+ if (FontType.TYPE1 == tf.getFontType()) {
+ if (tf instanceof CustomFont) {
+ CustomFont cf = (CustomFont)tf;
+ if (isEmbeddable(cf)) {
+ InputStream in = getInputStreamOnFont(gen, cf);
+ if (in != null) {
+ gen.writeDSCComment(DSCConstants.BEGIN_RESOURCE,
+ fontRes);
+ embedType1Font(gen, in);
+ gen.writeDSCComment(DSCConstants.END_RESOURCE);
+ gen.getResourceTracker().registerSuppliedResource(fontRes);
+ embeddedFont = true;
+ } else {
+ gen.commentln("%WARNING: Could not embed font: " + cf.getFontName());
+ log.warn("Font " + cf.getFontName() + " is marked as supplied in the"
+ + " PostScript file but could not be embedded!");
+ }
}
}
- String gid;
- if (font.getEmbeddingMode() != EmbeddingMode.FULL) {
- gid = HexEncoder.encode(cid, 4);
- } else {
- gid = HexEncoder.encode(cidSubset.getGlyphIndexForSubsetIndex(cid), 4);
- }
- gen.write(gid);
}
- gen.writeln(">] def");
- FontFileReader reader = new FontFileReader(fontStream);
-
- TTFFile ttfFile;
- if (font.getEmbeddingMode() != EmbeddingMode.FULL) {
- ttfFile = new TTFSubSetFile();
- ttfFile.readFont(reader, font.getTTCName(), font.getUsedGlyphs());
- } else {
- ttfFile = new TTFFile();
- ttfFile.readFont(reader, font.getTTCName());
- }
-
-
- createType42DictionaryEntries(gen, font, new CMapSegment[0], ttfFile);
- gen.writeln("CIDFontName currentdict end /CIDFont defineresource pop");
- gen.writeln("end");
- gen.writeln("%%EndResource");
- PSResource cidFontResource = new PSResource(PSResource.TYPE_CIDFONT, psName);
- gen.getResourceTracker().registerSuppliedResource(cidFontResource);
- return cidFontResource;
- }
-
- private static void writeFontBBox(PSGenerator gen, CustomFont font) throws IOException {
- int[] bbox = font.getFontBBox();
- gen.write("/FontBBox[");
- for (int i = 0; i < 4; i++) {
- gen.write(" ");
- gen.write(bbox[i]);
+ if (!embeddedFont) {
+ gen.writeDSCComment(DSCConstants.INCLUDE_RESOURCE, fontRes);
}
- gen.writeln(" ] def");
}
private static boolean isEmbeddable(CustomFont font) {
@@ -573,20 +273,12 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
Map fontResources = new java.util.HashMap();
for (String key : fonts.keySet()) {
Typeface tf = getTypeFace(fontInfo, fonts, key);
- PSResource fontRes = new PSResource("font", tf.getEmbedFontName());
+ PSResource fontRes = new PSResource("font", tf.getFontName());
fontResources.put(key, fontRes);
- FontType fontType = tf.getFontType();
- if (fontType == FontType.TYPE1 || fontType == FontType.TRUETYPE
- || fontType == FontType.TYPE0) {
+ if (FontType.TYPE1 == tf.getFontType()) {
if (tf instanceof CustomFont) {
CustomFont cf = (CustomFont)tf;
if (isEmbeddable(cf)) {
- if (fontType == FontType.TYPE0) {
- resTracker.registerSuppliedResource(
- new PSResource(PSResource.TYPE_CIDFONT, tf.getEmbedFontName()));
- resTracker.registerSuppliedResource(
- new PSResource(PSResource.TYPE_CMAP, "Identity-H"));
- }
resTracker.registerSuppliedResource(fontRes);
}
if (tf instanceof SingleByteFont) {
@@ -597,7 +289,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
PSResource.TYPE_ENCODING, encoding.getName());
resTracker.registerSuppliedResource(encodingRes);
PSResource derivedFontRes = new PSResource(
- PSResource.TYPE_FONT, tf.getEmbedFontName() + "_" + (i + 1));
+ PSResource.TYPE_FONT, tf.getFontName() + "_" + (i + 1));
resTracker.registerSuppliedResource(derivedFontRes);
}
}
@@ -674,42 +366,4 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
return res;
}
- private static PSResource defineDerivedTrueTypeFont(PSGenerator gen,
- PSEventProducer eventProducer, String baseFontName, String fontName,
- SingleByteEncoding encoding, CMapSegment[] cmap) throws IOException {
- checkPostScriptLevel3(gen, eventProducer);
- PSResource res = new PSResource(PSResource.TYPE_FONT, fontName);
- gen.writeDSCComment(DSCConstants.BEGIN_RESOURCE, res);
- gen.commentln("%XGCDependencies: font " + baseFontName);
- gen.commentln("%XGC+ encoding " + encoding.getName());
- gen.writeln("/" + baseFontName + " findfont");
- gen.writeln("dup length dict begin");
- gen.writeln(" {1 index /FID ne {def} {pop pop} ifelse} forall");
- gen.writeln(" /Encoding " + encoding.getName() + " def");
-
- gen.writeln(" /CharStrings 256 dict dup begin");
- String[] charNameMap = encoding.getCharNameMap();
- char[] unicodeCharMap = encoding.getUnicodeCharMap();
- assert charNameMap.length == unicodeCharMap.length;
- for (int i = 0; i < charNameMap.length; i++) {
- String glyphName = charNameMap[i];
- gen.write(" /");
- gen.write(glyphName);
- gen.write(" ");
- if (glyphName.equals(".notdef")) {
- gen.write(0);
- } else {
- gen.write(getGlyphIndex(unicodeCharMap[i], cmap));
- }
- gen.writeln(" def");
- }
- gen.writeln(" end readonly def");
-
- gen.writeln(" currentdict");
- gen.writeln("end");
- gen.writeln("/" + fontName + " exch definefont pop");
- gen.writeDSCComment(DSCConstants.END_RESOURCE);
- gen.getResourceTracker().registerSuppliedResource(res);
- return res;
- }
}
diff --git a/src/java/org/apache/fop/render/ps/PSImageHandlerRawPNG.java b/src/java/org/apache/fop/render/ps/PSImageHandlerRawPNG.java
deleted file mode 100644
index 2a283e913..000000000
--- a/src/java/org/apache/fop/render/ps/PSImageHandlerRawPNG.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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;
-
-import java.awt.Dimension;
-import java.awt.Rectangle;
-import java.awt.geom.Rectangle2D;
-import java.awt.image.ColorModel;
-import java.io.IOException;
-
-import org.apache.xmlgraphics.image.loader.Image;
-import org.apache.xmlgraphics.image.loader.ImageFlavor;
-import org.apache.xmlgraphics.image.loader.ImageInfo;
-import org.apache.xmlgraphics.image.loader.impl.ImageRawPNG;
-import org.apache.xmlgraphics.ps.FormGenerator;
-import org.apache.xmlgraphics.ps.ImageEncoder;
-import org.apache.xmlgraphics.ps.ImageFormGenerator;
-import org.apache.xmlgraphics.ps.PSGenerator;
-import org.apache.xmlgraphics.ps.PSImageUtils;
-
-import org.apache.fop.render.RenderingContext;
-
-/**
- * Image handler implementation which handles raw (not decoded) PNG images for PostScript output.
- */
-public class PSImageHandlerRawPNG implements PSImageHandler {
-
- private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {ImageFlavor.RAW_PNG};
-
- /** {@inheritDoc} */
- public void handleImage(RenderingContext context, Image image, Rectangle pos) throws IOException {
- PSRenderingContext psContext = (PSRenderingContext) context;
- PSGenerator gen = psContext.getGenerator();
- ImageRawPNG png = (ImageRawPNG) image;
-
- float x = (float) pos.getX() / 1000f;
- float y = (float) pos.getY() / 1000f;
- float w = (float) pos.getWidth() / 1000f;
- float h = (float) pos.getHeight() / 1000f;
- Rectangle2D targetRect = new Rectangle2D.Float(x, y, w, h);
-
- ImageEncoder encoder = new ImageEncoderPNG(png);
- ImageInfo info = image.getInfo();
- Dimension imgDim = info.getSize().getDimensionPx();
- String imgDescription = image.getClass().getName();
- ColorModel cm = png.getColorModel();
-
- PSImageUtils.writeImage(encoder, imgDim, imgDescription, targetRect, cm, gen);
- }
-
- /** {@inheritDoc} */
- public void generateForm(RenderingContext context, Image image, PSImageFormResource form)
- throws IOException {
- PSRenderingContext psContext = (PSRenderingContext) context;
- PSGenerator gen = psContext.getGenerator();
- ImageRawPNG png = (ImageRawPNG) image;
- ImageInfo info = image.getInfo();
- String imageDescription = info.getMimeType() + " " + info.getOriginalURI();
-
- ImageEncoder encoder = new ImageEncoderPNG(png);
- FormGenerator formGen = new ImageFormGenerator(form.getName(), imageDescription, info.getSize()
- .getDimensionPt(), info.getSize().getDimensionPx(), encoder, png.getColorSpace(),
- false);
- formGen.generate(gen);
- }
-
- /** {@inheritDoc} */
- public int getPriority() {
- return 200;
- }
-
- /** {@inheritDoc} */
- public Class<ImageRawPNG> getSupportedImageClass() {
- return ImageRawPNG.class;
- }
-
- /** {@inheritDoc} */
- public ImageFlavor[] getSupportedImageFlavors() {
- return FLAVORS;
- }
-
- /** {@inheritDoc} */
- public boolean isCompatible(RenderingContext targetContext, Image image) {
- if (targetContext instanceof PSRenderingContext) {
- PSRenderingContext psContext = (PSRenderingContext) targetContext;
- // The filters required for this implementation need PS level 2 or higher
- if (psContext.getGenerator().getPSLevel() >= 2) {
- return (image == null || image instanceof ImageRawPNG);
- }
- }
- return false;
- }
-
-}
diff --git a/src/java/org/apache/fop/render/ps/PSImageHandlerRenderedImage.java b/src/java/org/apache/fop/render/ps/PSImageHandlerRenderedImage.java
index 46597e46d..5a13c1c8e 100644
--- a/src/java/org/apache/fop/render/ps/PSImageHandlerRenderedImage.java
+++ b/src/java/org/apache/fop/render/ps/PSImageHandlerRenderedImage.java
@@ -19,10 +19,7 @@
package org.apache.fop.render.ps;
-import java.awt.Dimension;
import java.awt.Rectangle;
-import java.awt.geom.Rectangle2D;
-import java.awt.image.ColorModel;
import java.awt.image.RenderedImage;
import java.io.IOException;
@@ -31,8 +28,6 @@ import org.apache.xmlgraphics.image.loader.ImageFlavor;
import org.apache.xmlgraphics.image.loader.ImageInfo;
import org.apache.xmlgraphics.image.loader.impl.ImageRendered;
import org.apache.xmlgraphics.ps.FormGenerator;
-import org.apache.xmlgraphics.ps.ImageEncoder;
-import org.apache.xmlgraphics.ps.ImageEncodingHelper;
import org.apache.xmlgraphics.ps.ImageFormGenerator;
import org.apache.xmlgraphics.ps.PSGenerator;
import org.apache.xmlgraphics.ps.PSImageUtils;
@@ -52,24 +47,17 @@ public class PSImageHandlerRenderedImage implements PSImageHandler {
/** {@inheritDoc} */
public void handleImage(RenderingContext context, Image image, Rectangle pos)
throws IOException {
- PSRenderingContext psContext = (PSRenderingContext) context;
+ PSRenderingContext psContext = (PSRenderingContext)context;
PSGenerator gen = psContext.getGenerator();
- ImageRendered imageRend = (ImageRendered) image;
+ ImageRendered imageRend = (ImageRendered)image;
- float x = (float) pos.getX() / 1000f;
- float y = (float) pos.getY() / 1000f;
- float w = (float) pos.getWidth() / 1000f;
- float h = (float) pos.getHeight() / 1000f;
- Rectangle2D targetRect = new Rectangle2D.Double(x, y, w, h);
+ float x = (float)pos.getX() / 1000f;
+ float y = (float)pos.getY() / 1000f;
+ float w = (float)pos.getWidth() / 1000f;
+ float h = (float)pos.getHeight() / 1000f;
RenderedImage ri = imageRend.getRenderedImage();
- ImageEncoder encoder = ImageEncodingHelper.createRenderedImageEncoder(ri);
- Dimension imgDim = new Dimension(ri.getWidth(), ri.getHeight());
- String imgDescription = ri.getClass().getName();
- ImageEncodingHelper helper = new ImageEncodingHelper(ri);
- ColorModel cm = helper.getEncodedColorModel();
-
- PSImageUtils.writeImage(encoder, imgDim, imgDescription, targetRect, cm, gen);
+ PSImageUtils.renderBitmapImage(ri, x, y, w, h, gen);
}
/** {@inheritDoc} */
diff --git a/src/java/org/apache/fop/render/ps/PSPainter.java b/src/java/org/apache/fop/render/ps/PSPainter.java
index c2288019a..9bed2a432 100644
--- a/src/java/org/apache/fop/render/ps/PSPainter.java
+++ b/src/java/org/apache/fop/render/ps/PSPainter.java
@@ -44,7 +44,6 @@ import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.fonts.FontTriplet;
import org.apache.fop.fonts.LazyFont;
-import org.apache.fop.fonts.MultiByteFont;
import org.apache.fop.fonts.SingleByteFont;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.render.RenderingContext;
@@ -56,7 +55,6 @@ import org.apache.fop.render.intermediate.IFUtil;
import org.apache.fop.traits.BorderProps;
import org.apache.fop.traits.RuleStyle;
import org.apache.fop.util.CharUtilities;
-import org.apache.fop.util.HexEncoder;
/**
* IFPainter implementation that produces PostScript.
@@ -394,7 +392,7 @@ public class PSPainter extends AbstractIFPainter {
if (currentEncoding != encoding) {
if (i > 0) {
writeText(text, start, i - start,
- letterSpacing, wordSpacing, dp, font, tf, false);
+ letterSpacing, wordSpacing, dp, font, tf);
}
if (encoding == 0) {
useFont(fontKey, sizeMillipoints);
@@ -406,18 +404,19 @@ public class PSPainter extends AbstractIFPainter {
}
}
} else {
+ //Simple single-font painting
useFont(fontKey, sizeMillipoints);
}
- writeText(text, start, textLen - start, letterSpacing, wordSpacing, dp, font, tf,
- tf instanceof MultiByteFont);
+ writeText(text, start, textLen - start, letterSpacing, wordSpacing, dp, font, tf);
} catch (IOException ioe) {
throw new IFException("I/O error in drawText()", ioe);
}
}
- private void writeText(String text, int start, int len,
+ private void writeText( // CSOK: ParameterNumber
+ String text, int start, int len,
int letterSpacing, int wordSpacing, int[][] dp,
- Font font, Typeface tf, boolean multiByte) throws IOException {
+ Font font, Typeface tf) throws IOException {
PSGenerator generator = getGenerator();
int end = start + len;
int initialSize = len;
@@ -452,12 +451,8 @@ public class PSPainter extends AbstractIFPainter {
if (dx != null && i < dxl - 1) {
glyphAdjust -= dx[i + 1];
}
- if (multiByte) {
- accText.append(HexEncoder.encode(ch));
- } else {
- char codepoint = (char)(ch % 256);
- PSGenerator.escapeChar(codepoint, accText); //add character to accumulated text
- }
+ char codepoint = (char)(ch % 256);
+ PSGenerator.escapeChar(codepoint, accText); //add character to accumulated text
if (glyphAdjust != 0) {
needTJ = true;
if (sb.length() == 0) {
@@ -468,8 +463,9 @@ public class PSPainter extends AbstractIFPainter {
sb.append(PSGenerator.LF);
lineStart = sb.length();
}
- lineStart = writePostScriptString(sb, accText, multiByte, lineStart);
- sb.append(' ');
+ sb.append('(');
+ sb.append(accText);
+ sb.append(") ");
accText.setLength(0); //reset accumulated text
}
sb.append(Integer.toString(glyphAdjust)).append(' ');
@@ -477,10 +473,9 @@ public class PSPainter extends AbstractIFPainter {
}
if (needTJ) {
if (accText.length() > 0) {
- if ((sb.length() - lineStart + accText.length()) > 200) {
- sb.append(PSGenerator.LF);
- }
- writePostScriptString(sb, accText, multiByte);
+ sb.append('(');
+ sb.append(accText);
+ sb.append(')');
}
if (hasLetterSpacing) {
sb.append("] " + formatMptAsPt(generator, letterSpacing) + " ATJ");
@@ -488,7 +483,7 @@ public class PSPainter extends AbstractIFPainter {
sb.append("] TJ");
}
} else {
- writePostScriptString(sb, accText, multiByte);
+ sb.append('(').append(accText).append(")");
if (hasLetterSpacing) {
StringBuffer spb = new StringBuffer();
spb.append(formatMptAsPt(generator, letterSpacing))
@@ -502,37 +497,12 @@ public class PSPainter extends AbstractIFPainter {
generator.writeln(sb.toString());
}
- private void writePostScriptString(StringBuffer buffer, StringBuffer string,
- boolean multiByte) {
- writePostScriptString(buffer, string, multiByte, 0);
- }
-
- private int writePostScriptString(StringBuffer buffer, StringBuffer string, boolean multiByte,
- int lineStart) {
- buffer.append(multiByte ? '<' : '(');
- int l = string.length();
- int index = 0;
- int maxCol = 200;
- buffer.append(string.substring(index, Math.min(index + maxCol, l)));
- index += maxCol;
- while (index < l) {
- if (!multiByte) {
- buffer.append('\\');
- }
- buffer.append(PSGenerator.LF);
- lineStart = buffer.length();
- buffer.append(string.substring(index, Math.min(index + maxCol, l)));
- index += maxCol;
- }
- buffer.append(multiByte ? '>' : ')');
- return lineStart;
- }
-
private void useFont(String key, int size) throws IOException {
- PSFontResource res = this.documentHandler.getPSResourceForFontKey(key);
+ PSResource res = this.documentHandler.getPSResourceForFontKey(key);
PSGenerator generator = getGenerator();
generator.useFont("/" + res.getName(), size / 1000f);
- res.notifyResourceUsageOnPage(generator.getResourceTracker());
+ generator.getResourceTracker().notifyResourceUsageOnPage(res);
}
+
}
diff --git a/src/java/org/apache/fop/render/ps/PSTextPainter.java b/src/java/org/apache/fop/render/ps/PSTextPainter.java
index 2b3afaec7..acc673491 100644
--- a/src/java/org/apache/fop/render/ps/PSTextPainter.java
+++ b/src/java/org/apache/fop/render/ps/PSTextPainter.java
@@ -41,15 +41,12 @@ import org.apache.batik.gvt.text.TextSpanLayout;
import org.apache.xmlgraphics.java2d.ps.PSGraphics2D;
import org.apache.xmlgraphics.ps.PSGenerator;
+import org.apache.xmlgraphics.ps.PSResource;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.FontInfo;
-import org.apache.fop.fonts.FontMetrics;
-import org.apache.fop.fonts.LazyFont;
-import org.apache.fop.fonts.MultiByteFont;
import org.apache.fop.svg.NativeTextPainter;
import org.apache.fop.util.CharUtilities;
-import org.apache.fop.util.HexEncoder;
/**
* Renders the attributed character iterator of a text node.
@@ -243,9 +240,9 @@ public class PSTextPainter extends NativeTextPainter {
}
}
- private PSFontResource getResourceForFont(Font f, String postfix) {
+ private PSResource getResourceForFont(Font f, String postfix) {
String key = (postfix != null ? f.getFontName() + '_' + postfix : f.getFontName());
- return this.fontResources.getFontResourceForFontKey(key);
+ return this.fontResources.getPSResourceForFontKey(key);
}
private void clip(PSGraphics2D ps, Shape shape) throws IOException {
@@ -302,9 +299,9 @@ public class PSTextPainter extends NativeTextPainter {
public void selectFont(Font f, char mapped) throws IOException {
int encoding = mapped / 256;
String postfix = (encoding == 0 ? null : Integer.toString(encoding));
- PSFontResource res = getResourceForFont(f, postfix);
+ PSResource res = getResourceForFont(f, postfix);
gen.useFont("/" + res.getName(), f.getFontSize() / 1000f);
- res.notifyResourceUsageOnPage(gen.getResourceTracker());
+ gen.getResourceTracker().notifyResourceUsageOnPage(res);
}
public Font getCurrentFont() {
@@ -430,23 +427,15 @@ public class PSTextPainter extends NativeTextPainter {
textUtil.setCurrentFont(f, mapped);
applyColor(paint, gen);
- FontMetrics metrics = f.getFontMetrics();
- boolean multiByte = metrics instanceof MultiByteFont
- || metrics instanceof LazyFont
- && ((LazyFont) metrics).getRealFont() instanceof MultiByteFont;
StringBuffer sb = new StringBuffer();
- sb.append(multiByte ? '<' : '(');
+ sb.append('(');
for (int i = 0, c = this.currentChars.length(); i < c; i++) {
char ch = this.currentChars.charAt(i);
mapped = f.mapChar(ch);
- if (multiByte) {
- sb.append(HexEncoder.encode(mapped));
- } else {
- char codepoint = (char) (mapped % 256);
- PSGenerator.escapeChar(codepoint, sb);
- }
+ char codepoint = (char) (mapped % 256);
+ PSGenerator.escapeChar(codepoint, sb);
}
- sb.append(multiByte ? '>' : ')');
+ sb.append(')');
if (x || y) {
sb.append("\n[");
int idx = 0;
@@ -524,20 +513,10 @@ public class PSTextPainter extends NativeTextPainter {
textUtil.selectFont(f, mapped);
textUtil.setCurrentFont(f, mapped);
}
- //add glyph outlines to current path
mapped = f.mapChar(this.currentChars.charAt(i));
- FontMetrics metrics = f.getFontMetrics();
- boolean multiByte = metrics instanceof MultiByteFont
- || metrics instanceof LazyFont
- && ((LazyFont) metrics).getRealFont() instanceof MultiByteFont;
- if (multiByte) {
- gen.write('<');
- gen.write(HexEncoder.encode(mapped));
- gen.write('>');
- } else {
- char codepoint = (char)(mapped % 256);
- gen.write("(" + codepoint + ")");
- }
+ //add glyph outlines to current path
+ char codepoint = (char)(mapped % 256);
+ gen.write("(" + codepoint + ")");
gen.writeln(" false charpath");
if (iter.hasNext()) {
diff --git a/src/java/org/apache/fop/render/ps/ResourceHandler.java b/src/java/org/apache/fop/render/ps/ResourceHandler.java
index 5594897ba..502242c17 100644
--- a/src/java/org/apache/fop/render/ps/ResourceHandler.java
+++ b/src/java/org/apache/fop/render/ps/ResourceHandler.java
@@ -83,8 +83,6 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
private FOUserAgent userAgent;
private FontInfo fontInfo;
- private PSEventProducer eventProducer;
-
private ResourceTracker resTracker;
//key: URI, values PSImageFormResource
@@ -95,15 +93,13 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
/**
* Main constructor.
* @param userAgent the FO user agent
- * @param eventProducer the event producer
* @param fontInfo the font information
* @param resTracker the resource tracker to use
* @param formResources Contains all forms used by this document (maintained by PSRenderer)
*/
- public ResourceHandler(FOUserAgent userAgent, PSEventProducer eventProducer,
- FontInfo fontInfo, ResourceTracker resTracker, Map formResources) {
+ public ResourceHandler(FOUserAgent userAgent, FontInfo fontInfo,
+ ResourceTracker resTracker, Map formResources) {
this.userAgent = userAgent;
- this.eventProducer = eventProducer;
this.fontInfo = fontInfo;
this.resTracker = resTracker;
determineInlineForms(formResources);
@@ -226,7 +222,7 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
if (fontSetupPlaceholder == null) {
throw new DSCException("Didn't find %FOPFontSetup comment in stream");
}
- PSFontUtils.writeFontDict(gen, fontInfo, fontInfo.getUsedFonts(), eventProducer);
+ PSFontUtils.writeFontDict(gen, fontInfo, fontInfo.getUsedFonts());
generateForms(globalFormResources, gen);
//Skip the prolog and to the first page
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java b/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
index 5721afaf6..00d0594f2 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
@@ -41,7 +41,6 @@ public class PSExtensionElementMapping extends ElementMapping {
foObjs = new java.util.HashMap<String, Maker>();
foObjs.put(PSSetupCodeElement.ELEMENT, new PSSetupCodeMaker());
foObjs.put(PSPageSetupCodeElement.ELEMENT, new PSPageSetupCodeMaker());
- foObjs.put(PSPageTrailerCodeBefore.ELEMENT, new PSPageTrailerCodeBeforeMaker());
foObjs.put(PSSetPageDeviceElement.ELEMENT, new PSSetPageDeviceMaker());
foObjs.put(PSCommentBefore.ELEMENT, new PSCommentBeforeMaker());
foObjs.put(PSCommentAfter.ELEMENT, new PSCommentAfterMaker());
@@ -60,12 +59,6 @@ public class PSExtensionElementMapping extends ElementMapping {
}
}
- static class PSPageTrailerCodeBeforeMaker extends ElementMapping.Maker {
- public FONode make(FONode parent) {
- return new PSPageTrailerCodeBeforeElement(parent);
- }
- }
-
static class PSSetPageDeviceMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new PSSetPageDeviceElement(parent);
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java b/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java
index b520d8736..d499ef6ab 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java
@@ -53,7 +53,6 @@ public class PSExtensionHandler extends DefaultHandler
lastAttributes = new AttributesImpl(attributes);
handled = false;
if (localName.equals(PSSetupCode.ELEMENT)
- || localName.equals(PSPageTrailerCodeBefore.ELEMENT)
|| localName.equals(PSSetPageDevice.ELEMENT)
|| localName.equals(PSCommentBefore.ELEMENT)
|| localName.equals(PSCommentAfter.ELEMENT)) {
@@ -85,8 +84,6 @@ public class PSExtensionHandler extends DefaultHandler
this.returnedObject = new PSCommentBefore(content.toString());
} else if (PSCommentAfter.ELEMENT.equals(localName)) {
this.returnedObject = new PSCommentAfter(content.toString());
- } else if (PSPageTrailerCodeBefore.ELEMENT.equals(localName)) {
- this.returnedObject = new PSPageTrailerCodeBefore(content.toString());
}
}
content.setLength(0); //Reset text buffer (see characters())
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBefore.java b/src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBefore.java
deleted file mode 100644
index f28f0003e..000000000
--- a/src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBefore.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.extensions;
-
-
-public class PSPageTrailerCodeBefore extends PSExtensionAttachment {
-
- /** The element name */
- protected static final String ELEMENT = "ps-page-trailer-code-before";
-
- /**
- * Default constructor
- * @param content the actual comment
- */
- public PSPageTrailerCodeBefore(String content) {
- super(content);
- }
-
- /**
- * Constructor
- */
- public PSPageTrailerCodeBefore() {
- super();
- }
-
- /**
- * @return element name
- */
- protected String getElement() {
- return ELEMENT;
- }
-
-}
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBeforeElement.java b/src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBeforeElement.java
deleted file mode 100644
index 65a22eadd..000000000
--- a/src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBeforeElement.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.extensions;
-
-import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.extensions.ExtensionAttachment;
-
-/**
- * Comment before element
- */
-public class PSPageTrailerCodeBeforeElement extends AbstractPSCommentElement {
-
- /** the element name */
- protected static final String ELEMENT = "ps-page-trailer-code-before";
-
- /**
- * Main constructor
- * @param parent parent node
- */
- public PSPageTrailerCodeBeforeElement(FONode parent) {
- super(parent);
- }
-
- /**
- * @return local name
- * @see org.apache.fop.fo.FONode#getLocalName()
- */
- public String getLocalName() {
- return PSPageTrailerCodeBefore.ELEMENT;
- }
-
- /**
- * @return instance of its extension attachment object
- */
- protected ExtensionAttachment instantiateExtensionAttachment() {
- return new PSPageTrailerCodeBefore();
- }
-}
diff --git a/src/java/org/apache/fop/render/ps/fonts/PSTTFGenerator.java b/src/java/org/apache/fop/render/ps/fonts/PSTTFGenerator.java
deleted file mode 100644
index 556b62457..000000000
--- a/src/java/org/apache/fop/render/ps/fonts/PSTTFGenerator.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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.fonts;
-
-import java.io.IOException;
-
-import org.apache.xmlgraphics.ps.PSGenerator;
-import org.apache.xmlgraphics.util.io.ASCIIHexOutputStream;
-
-/**
- * This is a wrapper for {@link PSGenerator} that contains some members specific for streaming
- * TrueType fonts to a PostScript document.
- */
-public class PSTTFGenerator {
- private PSGenerator gen;
- private ASCIIHexOutputStream hexOut;
-
- /**
- * The buffer is used to store the font file in an array of hex-encoded strings. Strings are
- * limited to 65535 characters, string will start with a newline, 2 characters are needed to
- * hex-encode each byte.
- */
- public static final int MAX_BUFFER_SIZE = 32764;
-
- /**
- * Creates a new instance wrapping the given generator.
- * @param gen the PSGenerator to wrap
- */
- public PSTTFGenerator(PSGenerator gen) {
- this.gen = gen;
- hexOut = new ASCIIHexOutputStream(gen.getOutputStream());
- }
-
- /**
- * Writes the '&lt;' character that starts a string.
- */
- public void startString() throws IOException {
- // We need to reset the streamer so that it starts a new line in the PS document
- hexOut = new ASCIIHexOutputStream(gen.getOutputStream());
- gen.writeln("<");
- }
-
- /**
- * Writes the given string to the output.
- * @param cmd a string
- */
- public void write(String cmd) throws IOException {
- gen.write(cmd);
- }
-
- /**
- * Writes the given string to the output, followed by a newline.
- * @param cmd a string
- */
- public void writeln(String cmd) throws IOException {
- gen.writeln(cmd);
- }
-
- /**
- * Writes bytes from the given byte array to the output.
- *
- * @param byteArray byte[] a byte array
- * @param offset the position in the byte array where the streaming must start
- * @param length the number of bytes to stream. This MUST be less than
- * {@link #MAX_BUFFER_SIZE} - 1 since strings are suffixed by '00' (see Section 4.2 of
- * Adobe Technical Note #5012, <em>The Type 42 Font Format Specification</em>.).
- */
- public void streamBytes(byte[] byteArray, int offset, int length) throws IOException {
- if (length > MAX_BUFFER_SIZE) {
- throw new UnsupportedOperationException("Attempting to write a string to a PostScript"
- + " file that is greater than the buffer size.");
- }
- hexOut.write(byteArray, offset, length);
- }
-
- /**
- * Finishes writing a string by appending '00' and '>' to the end.
- */
- public void endString() throws IOException {
- /* Appends a '00' to the end of the string as specified in the spec */
- gen.write("00\n> ");
- }
-
-}
diff --git a/src/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStream.java b/src/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStream.java
deleted file mode 100644
index cc2ae3e82..000000000
--- a/src/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStream.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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.fonts;
-
-import java.io.IOException;
-
-import org.apache.fop.fonts.truetype.TTFGlyphOutputStream;
-
-/**
- * Streams glyphs in accordance with the constraints of the PostScript file format.
- * Mainly, PostScript strings have a limited capacity and the font data may have to be
- * broken down into several strings; however, this must occur at well-defined places like
- * table or glyph boundaries. See also Adobe Technical Note #5012, <em>The Type 42 Font
- * Format Specification</em>.
- */
-public class PSTTFGlyphOutputStream implements TTFGlyphOutputStream {
-
- /** Total number of bytes written so far. */
- private int byteCounter;
-
- private int lastStringBoundary;
-
- private PSTTFGenerator ttfGen;
-
- /**
- * Constructor
- * @param ttfGen PSTTFGenerator
- */
- public PSTTFGlyphOutputStream(PSTTFGenerator ttfGen) {
- this.ttfGen = ttfGen;
- }
-
- public void startGlyphStream() throws IOException {
- ttfGen.startString();
- }
-
- public void streamGlyph(byte[] glyphData, int offset, int size) throws IOException {
- if (size > PSTTFGenerator.MAX_BUFFER_SIZE) {
- throw new UnsupportedOperationException("The glyph is " + size
- + " bytes. There may be an error in the font file.");
- }
-
- if (size + (byteCounter - lastStringBoundary) < PSTTFGenerator.MAX_BUFFER_SIZE) {
- ttfGen.streamBytes(glyphData, offset, size);
- } else {
- ttfGen.endString();
- lastStringBoundary = byteCounter;
- ttfGen.startString();
- ttfGen.streamBytes(glyphData, offset, size);
- }
- byteCounter += size;
- }
-
- public void endGlyphStream() throws IOException {
- ttfGen.endString();
- }
-
-}
diff --git a/src/java/org/apache/fop/render/ps/fonts/PSTTFOutputStream.java b/src/java/org/apache/fop/render/ps/fonts/PSTTFOutputStream.java
deleted file mode 100644
index 271d87d1b..000000000
--- a/src/java/org/apache/fop/render/ps/fonts/PSTTFOutputStream.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.fonts;
-
-import java.io.IOException;
-
-import org.apache.xmlgraphics.ps.PSGenerator;
-
-import org.apache.fop.fonts.truetype.TTFGlyphOutputStream;
-import org.apache.fop.fonts.truetype.TTFOutputStream;
-import org.apache.fop.fonts.truetype.TTFTableOutputStream;
-
-/**
- * Streams a TrueType font according to the PostScript format.
- */
-public class PSTTFOutputStream implements TTFOutputStream {
-
- private final PSTTFGenerator ttfGen;
-
- /**
- * Creates a new instance wrapping the given generator.
- *
- * @param gen the generator to wrap
- */
- public PSTTFOutputStream(PSGenerator gen) {
- this.ttfGen = new PSTTFGenerator(gen);
- }
-
- public void startFontStream() throws IOException {
- ttfGen.write("/sfnts[");
- }
-
- public TTFTableOutputStream getTableOutputStream() {
- return new PSTTFTableOutputStream(ttfGen);
- }
-
- public TTFGlyphOutputStream getGlyphOutputStream() {
- return new PSTTFGlyphOutputStream(ttfGen);
- }
-
- public void endFontStream() throws IOException {
- ttfGen.writeln("] def");
- }
-
-}
diff --git a/src/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStream.java b/src/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStream.java
deleted file mode 100644
index 2226e11e8..000000000
--- a/src/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStream.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.fonts;
-
-import java.io.IOException;
-
-import org.apache.fop.fonts.truetype.TTFTableOutputStream;
-
-/**
- * Streams a TrueType table according to the PostScript format.
- */
-public class PSTTFTableOutputStream implements TTFTableOutputStream {
-
- private PSTTFGenerator ttfGen;
-
- /**
- * Constructor.
- * @param ttfGen the helper object to stream TrueType data
- */
- public PSTTFTableOutputStream(PSTTFGenerator ttfGen) {
- this.ttfGen = ttfGen;
- }
-
- public void streamTable(byte[] ttfData, int offset, int size) throws IOException {
- int offsetPosition = offset;
- // Need to split the table into MAX_BUFFER_SIZE chunks
- for (int i = 0; i < size / PSTTFGenerator.MAX_BUFFER_SIZE; i++) {
- streamString(ttfData, offsetPosition, PSTTFGenerator.MAX_BUFFER_SIZE);
- offsetPosition += PSTTFGenerator.MAX_BUFFER_SIZE;
- }
- if (size % PSTTFGenerator.MAX_BUFFER_SIZE > 0) {
- streamString(ttfData, offsetPosition, size % PSTTFGenerator.MAX_BUFFER_SIZE);
- }
- }
-
- private void streamString(byte[] byteArray, int offset, int length) throws IOException {
- ttfGen.startString();
- ttfGen.streamBytes(byteArray, offset, length);
- ttfGen.endString();
- }
-
-}
diff --git a/src/java/org/apache/fop/render/xml/XMLRenderer.java b/src/java/org/apache/fop/render/xml/XMLRenderer.java
index cf3cbe5a2..4ac650269 100644
--- a/src/java/org/apache/fop/render/xml/XMLRenderer.java
+++ b/src/java/org/apache/fop/render/xml/XMLRenderer.java
@@ -97,15 +97,6 @@ import org.apache.fop.util.XMLUtil;
*/
public class XMLRenderer extends AbstractXMLRenderer {
- /**
- * Area Tree (AT) version, used to express an @version attribute
- * in the root element of the AT document, the initial value of which
- * is set to '2.0' to signify that something preceded it (but didn't
- * happen to be marked as such), and that this version is not necessarily
- * backwards compatible with the unmarked (<2.0) version.
- */
- public static final String VERSION = "2.0";
-
/** XML MIME type */
public static final String XML_MIME_TYPE = MimeConstants.MIME_FOP_AREA_TREE;
@@ -374,9 +365,7 @@ public class XMLRenderer extends AbstractXMLRenderer {
if (userAgent.getProducer() != null) {
comment("Produced by " + userAgent.getProducer());
}
- atts.clear();
- addAttribute("version", VERSION);
- startElement("areaTree", atts);
+ startElement("areaTree");
}
/** {@inheritDoc} */
@@ -836,10 +825,11 @@ public class XMLRenderer extends AbstractXMLRenderer {
}
maybeAddLevelAttribute(word);
maybeAddPositionAdjustAttribute(word);
- String text = word.getWord();
- maybeAddReversedAttribute(word, text);
+ if ( word.isReversed() ) {
+ addAttribute("reversed", "true");
+ }
startElement("word", atts);
- characters(text);
+ characters(word.getWord());
endElement("word");
super.renderWord(word);
}
@@ -927,11 +917,5 @@ public class XMLRenderer extends AbstractXMLRenderer {
}
}
- private void maybeAddReversedAttribute ( WordArea w, String text ) {
- if ( w.isReversed() && ( text.length() > 1 ) ) {
- addAttribute("reversed", "true");
- }
- }
-
}
diff --git a/src/java/org/apache/fop/svg/PDFAElementBridge.java b/src/java/org/apache/fop/svg/PDFAElementBridge.java
index c2a481af9..cd70bed34 100644
--- a/src/java/org/apache/fop/svg/PDFAElementBridge.java
+++ b/src/java/org/apache/fop/svg/PDFAElementBridge.java
@@ -64,7 +64,7 @@ public class PDFAElementBridge extends AbstractGraphicsNodeBridge {
}
/**
- * Creates a {@link org.apache.batik.gvt.CompositeGraphicsNode}.
+ * Creates a {@link CompositeGraphicsNode}.
* @return a new PDFANode
*/
protected GraphicsNode instantiateGraphicsNode() {
diff --git a/src/java/org/apache/fop/svg/PDFGraphics2D.java b/src/java/org/apache/fop/svg/PDFGraphics2D.java
index 87c12d869..67fc5d860 100644
--- a/src/java/org/apache/fop/svg/PDFGraphics2D.java
+++ b/src/java/org/apache/fop/svg/PDFGraphics2D.java
@@ -1201,8 +1201,6 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand
currentStream.write("] ");
float offset = bs.getDashPhase();
currentStream.write(PDFNumber.doubleOut(offset) + " d\n");
- } else {
- currentStream.write("[] 0 d\n");
}
int ec = bs.getEndCap();
switch (ec) {
diff --git a/src/java/org/apache/fop/traits/MinOptMax.java b/src/java/org/apache/fop/traits/MinOptMax.java
index 84fb0156a..022f3c214 100644
--- a/src/java/org/apache/fop/traits/MinOptMax.java
+++ b/src/java/org/apache/fop/traits/MinOptMax.java
@@ -22,9 +22,8 @@ package org.apache.fop.traits;
import java.io.Serializable;
/**
- * This class holds the resolved (as mpoints) form of a
- * {@link org.apache.fop.fo.properties.LengthRangeProperty} or
- * {@link org.apache.fop.fo.properties.SpaceProperty} type property value.
+ * This class holds the resolved (as mpoints) form of a {@link LengthRangeProperty LengthRange} or
+ * {@link SpaceProperty Space} type property value.
* <p/>
* Instances of this class are immutable. All arithmetic methods like {@link #plus(MinOptMax) plus},
* {@link #minus(MinOptMax) minus} or {@link #mult(int) mult} return a different instance. So it is
diff --git a/src/java/org/apache/fop/traits/TraitEnum.java b/src/java/org/apache/fop/traits/TraitEnum.java
index 0d664a6df..18fdffaab 100644
--- a/src/java/org/apache/fop/traits/TraitEnum.java
+++ b/src/java/org/apache/fop/traits/TraitEnum.java
@@ -30,7 +30,7 @@ public abstract class TraitEnum implements Serializable {
/**
* Constructor to add a new named item.
* @param name Name of the item.
- * @param enumValue the {@link org.apache.fop.fo.Constants}.EN_* value
+ * @param enumValue the {@link Constants}.EN_* value
*/
protected TraitEnum(String name, int enumValue) {
this.name = name;
@@ -46,7 +46,7 @@ public abstract class TraitEnum implements Serializable {
}
/**
- * Returns the enumeration value (one of {@link org.apache.fop.fo.Constants}.EN_*).
+ * Returns the enumeration value (one of {@link Constants}.EN_*).
* @return the enumeration value
*/
public int getEnumValue() {
diff --git a/src/java/org/apache/fop/util/ColorExt.java b/src/java/org/apache/fop/util/ColorExt.java
index f92e7c2a6..d0ac6767c 100644
--- a/src/java/org/apache/fop/util/ColorExt.java
+++ b/src/java/org/apache/fop/util/ColorExt.java
@@ -28,7 +28,7 @@ import java.util.Arrays;
* <p>
* This class extends java.awt.Color class keeping track of the original color
* property values specified by the fo user in a rgb-icc call.
- * @deprecated Replaced by {@link org.apache.xmlgraphics.java2d.color.ColorWithAlternatives}
+ * @deprecated Replaced by {@link ColorWithAlternatives}
*/
@Deprecated
public final class ColorExt extends Color {
diff --git a/src/java/org/apache/fop/util/HexEncoder.java b/src/java/org/apache/fop/util/HexEncoder.java
deleted file mode 100644
index 9ca91f2d2..000000000
--- a/src/java/org/apache/fop/util/HexEncoder.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.util;
-
-/**
- * A helper class to create hex-encoded representations of numbers.
- */
-public final class HexEncoder {
-
- private HexEncoder() { }
-
- /**
- * Returns an hex encoding of the given number as a string of the given length,
- * left-padded with zeros if necessary.
- *
- * @param n a number
- * @param width required length of the string
- * @return an hex-encoded representation of the number
- */
- public static String encode(int n, int width) {
- char[] digits = new char[width];
- for (int i = width - 1; i >= 0; i--) {
- int digit = n & 0xF;
- digits[i] = (char) (digit < 10 ? '0' + digit : 'A' + digit - 10);
- n >>= 4;
- }
- return new String(digits);
- }
-
- /**
- * Returns an hex encoding of the given character as a four-character string.
- *
- * @param c a character
- * @return an hex-encoded representation of the character
- */
- public static String encode(char c) {
- return encode(c, 4);
- }
-
-}
diff --git a/src/sandbox/org/apache/fop/render/mif/MIFHandler.java b/src/sandbox/org/apache/fop/render/mif/MIFHandler.java
index 5ef4c0940..cfc86edc7 100644
--- a/src/sandbox/org/apache/fop/render/mif/MIFHandler.java
+++ b/src/sandbox/org/apache/fop/render/mif/MIFHandler.java
@@ -29,10 +29,8 @@ import org.apache.commons.logging.LogFactory;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.fo.FOEventHandler;
-import org.apache.fop.fo.FOText;
import org.apache.fop.fo.flow.BasicLink;
import org.apache.fop.fo.flow.Block;
-import org.apache.fop.fo.flow.Character;
import org.apache.fop.fo.flow.ExternalGraphic;
import org.apache.fop.fo.flow.Footnote;
import org.apache.fop.fo.flow.FootnoteBody;
@@ -41,8 +39,6 @@ import org.apache.fop.fo.flow.InstreamForeignObject;
import org.apache.fop.fo.flow.Leader;
import org.apache.fop.fo.flow.ListBlock;
import org.apache.fop.fo.flow.ListItem;
-import org.apache.fop.fo.flow.ListItemBody;
-import org.apache.fop.fo.flow.ListItemLabel;
import org.apache.fop.fo.flow.PageNumber;
import org.apache.fop.fo.flow.table.Table;
import org.apache.fop.fo.flow.table.TableBody;
@@ -55,7 +51,6 @@ import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.pagination.PageSequence;
import org.apache.fop.fo.pagination.PageSequenceMaster;
import org.apache.fop.fo.pagination.SimplePageMaster;
-import org.apache.fop.fo.pagination.StaticContent;
import org.apache.fop.fonts.FontSetup;
import org.apache.fop.render.DefaultFontResolver;
@@ -272,27 +267,27 @@ public class MIFHandler extends FOEventHandler {
}
/** {@inheritDoc} */
- public void startListLabel(ListItemLabel listItemLabel) {
+ public void startListLabel() {
}
/** {@inheritDoc} */
- public void endListLabel(ListItemLabel listItemLabel) {
+ public void endListLabel() {
}
/** {@inheritDoc} */
- public void startListBody(ListItemBody listItemBody) {
+ public void startListBody() {
}
/** {@inheritDoc} */
- public void endListBody(ListItemBody listItemBody) {
+ public void endListBody() {
}
/** {@inheritDoc} */
- public void startStatic(StaticContent staticContent) {
+ public void startStatic() {
}
/** {@inheritDoc} */
- public void endStatic(StaticContent staticContent) {
+ public void endStatic() {
}
/** {@inheritDoc} */
@@ -308,7 +303,7 @@ public class MIFHandler extends FOEventHandler {
}
/** {@inheritDoc} */
- public void endLink(BasicLink basicLink) {
+ public void endLink() {
}
/** {@inheritDoc} */
@@ -320,11 +315,7 @@ public class MIFHandler extends FOEventHandler {
}
/** {@inheritDoc} */
- public void startInstreamForeignObject(InstreamForeignObject ifo) {
- }
-
- /** {@inheritDoc} */
- public void endInstreamForeignObject(InstreamForeignObject ifo) {
+ public void foreignObject(InstreamForeignObject ifo) {
}
/** {@inheritDoc} */
@@ -344,37 +335,19 @@ public class MIFHandler extends FOEventHandler {
}
/** {@inheritDoc} */
- public void startLeader(Leader l) {
- }
-
- /** {@inheritDoc} */
- public void endLeader(Leader l) {
- }
-
- public void character(Character c) {
- appendCharacters ( new String ( new char[] {c.getCharacter()} ) );
- }
-
- /** {@inheritDoc} */
- public void characters(FOText foText) {
- appendCharacters ( foText.getCharSequence().toString() );
- }
-
- /** {@inheritDoc} */
- public void startPageNumber(PageNumber pagenum) {
+ public void leader(Leader l) {
}
/** {@inheritDoc} */
- public void endPageNumber(PageNumber pagenum) {
- }
-
- private void appendCharacters ( String str ) {
+ public void characters(char[] data, int start, int length) {
if (para != null) {
+ String str = new String(data, start, length);
str = str.trim();
// break into nice length chunks
if (str.length() == 0) {
return;
}
+
MIFElement line = new MIFElement("ParaLine");
MIFElement prop = new MIFElement("TextRectID");
prop.setValue("2");
@@ -382,8 +355,17 @@ public class MIFHandler extends FOEventHandler {
prop = new MIFElement("String");
prop.setValue("\"" + str + "\"");
line.addElement(prop);
+
para.addElement(line);
}
}
+
+ /** {@inheritDoc} */
+ public void startPageNumber(PageNumber pagenum) {
+ }
+
+ /** {@inheritDoc} */
+ public void endPageNumber(PageNumber pagenum) {
+ }
}
diff --git a/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java b/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java
index 6fd4d3618..ef0d9f301 100644
--- a/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java
+++ b/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java
@@ -54,8 +54,7 @@ import org.apache.fop.util.GenerationHelperContentHandler;
import org.apache.fop.util.XMLUtil;
/**
- * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation
- * that writes SVG 1.1.
+ * {@link IFDocumentHandler} implementation that writes SVG 1.1.
*/
public class SVGDocumentHandler extends AbstractSVGDocumentHandler {
diff --git a/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java b/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java
index 8ec374731..10be9588e 100644
--- a/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java
+++ b/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java
@@ -32,8 +32,7 @@ import org.apache.fop.render.intermediate.IFPainter;
import org.apache.fop.util.XMLUtil;
/**
- * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation
- * that writes SVG Print.
+ * {@link IFDocumentHandler} implementation that writes SVG Print.
*/
public class SVGPrintDocumentHandler extends AbstractSVGDocumentHandler {
diff --git a/status.xml b/status.xml
index e53dbc8eb..22654f61c 100644
--- a/status.xml
+++ b/status.xml
@@ -16,7 +16,8 @@
limitations under the License.
-->
<!-- $Id$ -->
-<!DOCTYPE status PUBLIC "-//APACHE//DTD Status V1.3//EN" "http://forrest.apache.org/dtd/status-v13.dtd">
+<!DOCTYPE status PUBLIC "-//APACHE//DTD Status V1.3//EN"
+ "http://forrest.apache.org/dtd/status-v13.dtd">
<status>
<developers>
@@ -61,52 +62,7 @@
users, i.e. when the behaviour changes and could affect the layout of existing
documents. Example: the fix of marks layering will be such a case when it's done.
-->
- <release version="1.1rc1" date="02 July 2012">
- <action context="Test" dev="GA" type="fix">
- Fix errors and warnings in example files. Add build.xml for documentation examples.
- </action>
- <action context="Code" dev="GA" type="fix" fixes-bug="53458" due-to="Dieter von Holten">
- Fix incorrect language and country code key generation in hyphenation tree cache.
- </action>
- <action context="Images" dev="GA" type="fix" fixes-bug="53431" due-to="Luis Bernardo">
- Fix incorrect SVG line dash pattern with PDF output format.
- </action>
- <action context="Images" dev="GA" type="update" fixes-bug="40676" due-to="Luis Bernardo">
- Fix interoperability issue with Adobe reader regarding use of multiple filters.
- </action>
- <action context="Code" dev="GA" type="fix">
- Eliminate javadocs warnings.
- </action>
- <action context="Renderers" dev="VH" type="add" fixes-bug="52338" importance="high">
- Added possibility to embed TrueType fonts in PostScript.
- </action>
- <action context="Images" dev="GA" type="update" fixes-bug="40676" due-to="Luis Bernardo">
- Update site documentation about PNG image loading configuration and support.
- </action>
- <action context="Images" dev="GA" type="update" fixes-bug="40676" due-to="Luis Bernardo">
- Fix newly introduced findbugs warnings.
- </action>
- <action context="Images" dev="GA" type="fix" fixes-bug="40676" due-to="Luis Bernardo, Matthias Reischenbacher" importance="high">
- Support use of ImageLoaderRawPNG decoder in order to prevent re-encoding of PNG images (and unnecssary output file bloat).
- </action>
- <action context="Code" dev="GA" type="fix" fixes-bug="53412" due-to="Alexios Giotis">
- Eliminate incorrect use of object identity which produces excessive property cache collisions.
- </action>
- <action context="Code" dev="GA" type="fix">
- Eliminate javadocs warnings.
- </action>
- <action context="Code" dev="GA" type="update" fixes-bug="53055">
- Update xmlgraphics common jar to reflect recent fixes in XGC.
- </action>
- <action context="Code" dev="GA" type="update" fixes-bug="43940" due-to="Julien Aymé">
- Fix handling of NaN, {+,-}Infinity, and other edge cases. Submitted by Julien Aymé.
- </action>
- <action context="Renderers" dev="GA" type="fix" fixes-bug="53304,53306">
- Add version attribute to AT and IF intermediate formats. Also eliminate redundant use of reversed attribute in AT format.
- </action>
- <action context="Renderers" dev="GA" type="fix" fixes-bug="53295" due-to="Luis Bernardo" importance="high">
- Add extension to place code just before PostScript %PageTrailer.
- </action>
+ <release version="FOP Trunk" date="TBD">
<action context="Renderers" dev="GA" type="fix" fixes-bug="53294" due-to="Robert Meyer">
Fix invalid PostScript file being created when font-size is 0.
</action>
@@ -140,14 +96,13 @@
<action context="Layout" dev="GA" type="fix" fixes-bug="53185" due-to="Robert Meyer">
Unify date formatting between FOP and XGC as well as tidying the date format code.
</action>
- <action context="Layout" dev="GA" type="fix" fixes-bug="45715" due-to="Luis Bernardo" importance="high">
- Fix for break before (break-before) not respected on blocks nested in inlines.
+ <action context="Layout" dev="GA" type="fix" fixes-bug="45715" due-to="Luis Bernardo">
+ Break before (break-before) not respected on blocks nested in inlines.
</action>
<action context="Renderers" dev="GA" type="fix" fixes-bug="48723" due-to="Robert Meyer">
Fix for XGC when rendering PostScript using SVG being drawn upside down when using a custom affine transform.
</action>
- <!-- the following is also due to Julien Aymé, but due to a bug in forrest is not included here to prevent duplicate listing in contributors list -->
- <action context="Code" dev="GA" type="fix" fixes-bug="43940" due-to="Ognjen Blagojevic">
+ <action context="Code" dev="GA" type="fix" fixes-bug="43940" due-to="Julien Aymé, Ognjen Blagojevic">
Use new double format utility to improve thread safety and performance.
</action>
<action context="Fonts" dev="GA" type="fix" fixes-bug="53148" due-to="Tassos Charoulis">
@@ -188,16 +143,16 @@
<action context="Code" dev="GA" type="update" fixes-bug="51617">
Add run target for embedded examples. Add increased JVM memory heap flag for example8 in case font cache is rebuilt.
</action>
- <action context="Code" dev="GA" type="fix" fixes-bug="53083" importance="high">
- Update to use of checkstyle-5.5 as default configuration. Remove checkstyle-4.0 configuration. Also, import environment build properties before local properties, so that latter can refer to former.
+ <action context="Code" dev="GA" type="fix" fixes-bug="53083">
+ Update to use of checkstyle-5.5 as default configuration. Remove checkstyle-4.0 configuration. Also, import environment build properties before local properties, so that latter can refer to former.'
</action>
<action context="Code" dev="GA" type="fix" fixes-bug="52572" due-to="Pascal Sancho">
Prevent NPE on use of unsupported collapse-with-precedence; fall back to collapse. Fix checkstyle errors from prior commit.
</action>
- <action context="Layout" dev="GA" type="fix" fixes-bug="52514" due-to="Luis Bernardo" importance="high">
+ <action context="Layout" dev="GA" type="fix" fixes-bug="52514" due-to="Luis Bernardo">
Ensure square image is appropriately scaled.
</action>
- <action context="Code" dev="GA" type="fix" fixes-bug="50062" importance="high">
+ <action context="Code" dev="GA" type="fix" fixes-bug="50062">
Invoke JVM in headless mode from FOP command scripts and JS shell to prevent stealing focus from GUI applications.
</action>
<action context="Renderers" dev="GA" type="fix" fixes-bug="52114">
@@ -206,7 +161,7 @@
<action context="Code" dev="PH" type="add" fixes-bug="49893">
A global setting to wrap F11 images in page segments.
</action>
- <action context="Code" dev="GA" type="fix" fixes-bug="52763" importance="high">
+ <action context="Code" dev="GA" type="fix" fixes-bug="52763">
Support list-block in marker, thus preventing NPE.
</action>
<action context="Code" dev="GA" type="fix">
@@ -226,7 +181,7 @@
<action context="Code" dev="GA" type="fix" fixes-bug="52966" due-to="Luis Bernardo">
How to use native text with EPSDocumentGraphics2D.
</action>
- <action context="Code" dev="GA" type="fix" fixes-bug="51599" due-to="Paul Huemer" importance="high">
+ <action context="Code" dev="GA" type="fix" fixes-bug="51599" due-to="Paul Huemer">
Allow https scheme URI for PDF external action target.
</action>
<action context="Code" dev="GA" type="fix" fixes-bug="50901" due-to="Carsten Pfeiffer">
@@ -247,10 +202,10 @@
<action context="Code" dev="GA" type="fix" fixes-bug="47380" due-to="Georg Datterl">
Specified rule-thickness applies only when leader-pattern is rule, otherwise should use default thickness.
</action>
- <action context="Code" dev="GA" type="fix" fixes-bug="49302" due-to="Julien Aym&#x00E9;">
+ <action context="Code" dev="GA" type="fix" fixes-bug="49302" due-to="Julien Aymé">
Eliminate duplicate code.
</action>
- <action context="Code" dev="GA" type="fix" fixes-bug="49350" due-to="Julien Aym&#x00E9;">
+ <action context="Code" dev="GA" type="fix" fixes-bug="49350" due-to="Julien Aymé">
Correct coding error in AFPResourceLevel#equals.
</action>
<action context="Code" dev="GA" type="fix" fixes-bug="51836" due-to="Melanie Drake">
@@ -262,11 +217,10 @@
<action context="Code" dev="GA" type="fix" fixes-bug="51807" due-to="Sergey Vladimirov">
Fixed small memory waste in rowCells array construction.
</action>
- <action context="Code" dev="GA" type="fix" fixes-bug="53005" due-to="Alberto Simões" importance="high">
+ <action context="Code" dev="GA" type="fix" fixes-bug="53005" due-to="Alberto Simões">
Fixed incorrect rejection of fo:wrapper inside fo:inline inside fo:footnote-body.
</action>
- <!-- the following is also due to Vincent Hennebert, but due to a bug in forrest is not included here to prevent duplicate listing in contributors list -->
- <action context="Code" dev="VH" type="add" importance="high" due-to="Peter Hancock">
+ <action context="Code" dev="PH,VH" type="add">
Added support for PDF Object Streams. When accessibility is enabled and PDF version 1.5
selected, the structure tree will be stored in object streams in order to reduce the size of
the final PDF.
@@ -274,32 +228,31 @@
<action context="Code" dev="VH" type="fix" fixes-bug="46962" due-to="Alexios Giotis">
Fixed deadlock in PropertyCache.
</action>
- <action context="Config" dev="VH" type="add" fixes-bug="51385" due-to="Mehdi Houshmand" importance="high">
+ <action context="Code" dev="VH" type="add" fixes-bug="51385" due-to="Mehdi Houshmand">
Added configuration option to set the version of the output PDF document.
</action>
- <action context="Code" dev="MH" type="fix" fixes-bug="52849" due-to="Luis Bernardo" importance="high">
- Fixed bug that caused a configured and installed SVG font to be stroked,
+ <action context="Code" dev="MH" type="fix" fixes-bug="52849" due-to="Luis Bernardo">
+ Fixed bug that caused a configured and installed SVG font to stroked,
also added an event indicating when fonts are stroked.
</action>
<action context="Code" dev="PH" type="fix">
Fix of a bug introduced when merging ImproveAccessibility.
</action>
- <action context="Code" dev="PH" type="add" fixes-bug="50391" importance="high">
- Improved support for empty flow-name mapping.
+ <action context="Code" dev="PH" type="add">
+ Improved support for empty flow-name mapping (see bugzilla#50391).
</action>
- <action context="Layout" dev="GA" type="add" fixes-bug="32789, 49008, 49687" importance="high">
+ <action context="Code" dev="GA" type="add" fixes-bug="32789, 49008, 49687" importance="high">
Add support for complex scripts, including: full bidi support, support for advanced
typographic tables, advanced support for number conversion.
</action>
- <action context="Fonts" dev="GA" type="add" importance="high">
+ <action context="Fonts" dev="GA" type="add">
Add support for OpenType advanced typographic tables (GDEF, GSUB, GPOS).
</action>
<action context="Code" dev="VH" type="fix" fixes-bug="52655" due-to="Luis Bernardo">
Fixed rendering of special glyphs when using single-byte encoding mode.
</action>
- <!-- the following is also due to Peter Hancock, but due to a bug in forrest is not included here to prevent duplicate listing in contributors list -->
- <action context="Code" dev="PH" type="add" due-to="Vincent Hennebert">
- Improvements of the Accessibility features.
+ <action context="Code" dev="PH" type="add" due-to="VH and PH">
+ Improvements of the Accessibility feature
</action>
<action context="Code" dev="CB" type="add" fixes-bug="52416" due-to="Luis Bernardo">
Suppress unnecessary "font not found warnings" when generating AFP with raster fonts
@@ -307,7 +260,7 @@
<action context="Code" dev="CB" type="add" fixes-bug="51209" due-to="Luis Bernardo">
SVG text in AFP creates miscoded GOCA text
</action>
- <action context="Code" dev="CB" type="add" fixes-bug="50391" due-to="Peter Hancock" importance="high">
+ <action context="Code" dev="CB" type="add" fixes-bug="50391" due-to="Peter Hancock">
Add support for different flow-name of fo:region-body in FOP
</action>
<action context="Code" dev="CB" type="add" fixes-bug="51664" due-to="Mehdi Houshmand">
@@ -323,7 +276,7 @@
Added to build file JUnit target that uses a regex to run all of the test cases. This
reduces the risk that some of them are omitted when building FOP.
</action>
- <action context="Code" dev="PH" type="add" fixes-bug="52089" due-to="Mehdi Houshmand" importance="high">
+ <action context="Code" dev="PH" type="add" fixes-bug="52089" due-to="JM, Mehdi Houshmand">
Allow JPEG images to be embedded in an AFP document as is, without being decoded and
encoded.
</action>
@@ -333,18 +286,18 @@
<action context="Renderers" dev="JM" type="add">
Various bugfixes to make PDFDocumentGraphics2D operational again.
</action>
- <action context="Code" dev="PH" type="add" fixes-bug="51962" due-to="Mehdi Houshmand" importance="high">
- Fix for when the last simple-page-master referenced in a page-sequence-master is not
+ <action context="Code" dev="PH" type="add" fixes-bug="51962" due-to="Mehdi Houshmand">
+ Bugfix for when the last simple-page-master referenced in a page-sequence-master is not
chosen when force-page-count=odd.
</action>
- <action context="Code" dev="VH" type="add" fixes-bug="51928" due-to="Mehdi Houshmand" importance="high">
+ <action context="Code" dev="VH" type="add" fixes-bug="51928" due-to="Mehdi Houshmand">
Upgraded all tests to JUnit 4.
</action>
<action context="Fonts" dev="PH" type="fix" fixes-bug="48696">
Bugfix for color model in IOCA IDE structure parameter for 4- and 8-bit grayscale images.
Revision 4.
</action>
- <action context="Fonts" dev="PH" type="fix" fixes-bug="51760" due-to="Mehdi Houshmand" importance="high">
+ <action context="Fonts" dev="PH" type="fix" fixes-bug="51760" due-to="Mehdi Houshmand">
Changes the way PostScript handles Graphics2D images such that if the language is set to
level 3, the image is stored as an embedded file which has no length limit. Previously it
was stored as an array which has a implementation limit of 65535 elements.
@@ -352,7 +305,7 @@
<action context="Fonts" dev="PH" type="fix" fixes-bug="51759" due-to="Mehdi Houshmand">
PDFFactory responsible for asdigning name to a subset font.
</action>
- <action context="Fonts" dev="PH" type="fix" fixes-bug="51530" due-to="Mehdi Houshmand" importance="high">
+ <action context="Fonts" dev="PH" type="fix" fixes-bug="51530" due-to="Mehdi Houshmand">
Improved support for EBCDIC encoded double byte fonts fo AFP.
</action>
<action context="Fonts" dev="PH" type="fix" fixes-bug="51205" due-to="Mehdi Houshmand">
@@ -367,8 +320,8 @@
Fixed a bug in AFP where an ArrayOutofBoundsException is throwqn when embedding a Page
Segment.
</action>
- <action context="Renderers" dev="VH" type="add" due-to="Michael Rubin" importance="high">
- Added support for 128bit encryption in PDF output.
+ <action context="Renderers" dev="VH" type="add">
+ Added support for 128bit encryption in PDF output. Based on work by Michael Rubin.
</action>
<action context="Renderers" dev="PH" type="fix">
Fixed a bug in AFP where the object area axes of an Include Object was incorrectly set when
@@ -384,12 +337,12 @@
<action context="Renderers" dev="JM" type="fix">
Fixed a multi-threading bug for SVG images included through svg:image inside SVG documents.
</action>
- <action context="Renderers" dev="PH" type="add" importance="high">
+ <action context="Renderers" dev="PH" type="add">
Added an IFDocumentHandler filter for triggering rendering events. Created an Event that
captures an end page event with the page number.
</action>
<action context="Renderers" dev="VH" type="fix">
- Fix for alternative text not working in tagged PDF for TIFF images.
+ Bugfix: alternative text not working in tagged PDF for TIFF images.
</action>
<action context="Renderers" dev="PH" type="fix" fixes-bug="50909">
Fixed io exception in MODCAParser caused by the improper use of mark() and reset() on the
@@ -403,18 +356,18 @@
<action context="Renderers" dev="JM" type="fix">
AFP GOCA: fonts were not embedded from within AFPGraphics2D.
</action>
- <action context="Renderers" dev="JM" type="fix" importance="high">
+ <action context="Renderers" dev="JM" type="fix">
AFP GOCA: Changed the way FOP fonts are selected based on Batik's GVT fonts to match
the behaviour of PDF/PS output.
</action>
- <action context="Renderers" dev="JM" type="add" importance="high">
+ <action context="Renderers" dev="JM" type="add">
Added option to place AFP NOPs right before the end of a named page group (page-sequence),
rather than after the start.
</action>
- <action context="Renderers" dev="JM" type="add" importance="high">
+ <action context="Renderers" dev="JM" type="add">
Added option for PostScript output to optimize for file size rather than quality.
</action>
- <action context="Renderers" dev="JM" type="add" importance="high">
+ <action context="Renderers" dev="JM" type="add">
AFP GOCA: Added option to disable GOCA and to control text painting inside GOCA graphics.
</action>
<action context="Renderers" dev="JM" type="fix">
@@ -454,26 +407,26 @@
Bugzilla 50965: Fixed a regression in BlockContainerLayoutManager where margins were
no longer reset after forced breaks.
</action>
- <action context="Layout" dev="VH" type="fix" fixex-bug="50763" importance="high">
+ <action context="Layout" dev="VH" type="fix" fixex-bug="50763">
Implemented non-standard behavior for basic-link areas, such that they take into account the
heights of their descendants areas.
</action>
- <action context="Layout" dev="VH" type="fix" importance="high">
- Fix for keep-together does not apply to fo:table-cell.
+ <action context="Layout" dev="VH" type="fix">
+ Bugfix: keep-together does not apply to fo:table-cell.
</action>
- <action context="Layout" dev="VH" type="fix" importance="high">
- Fix for keep-together on a table containing row-spanning cells that was not honored.
+ <action context="Layout" dev="VH" type="fix">
+ Bugfix: keep-together on a table containing row-spanning cells was not honored.
</action>
- <action context="Layout" dev="VH" type="fix" fixes-bug="50196" due-to="Matthias Reischenbacher" importance="high">
- Fix forpadding-start ignored when table-header/footer is repeated.
+ <action context="Layout" dev="VH" type="fix" fixes-bug="50196" due-to="Matthias Reischenbacher">
+ Bugzilla #50196: padding-start ignored when table-header/footer is repeated.
</action>
- <action context="Renderers" dev="JM" type="fix" importance="high">
+ <action context="Renderers" dev="JM" type="fix">
Increased maximum possible PDF size from 2GB to around 9GB (hard maximum imposed by the PDF specification).
</action>
- <action context="Renderers" dev="JM" type="add" importance="high">
+ <action context="Renderers" dev="JM" type="add">
Added support for CIE Lab colors (from XSL-FO 2.0 WD).
</action>
- <action context="Renderers" dev="JM" type="add" fixes-bug="49403" due-to="Patrick Jaromin" importance="high">
+ <action context="Renderers" dev="JM" type="add" fixes-bug="49403" due-to="Patrick Jaromin">
Initial work on spot colors (aka named colors) for PDF output.
</action>
<action context="Renderers" dev="JM" type="fix" fixes-bug="50705" due-to="Mehdi Houshmand">
@@ -483,39 +436,39 @@
Added support for lookup of alternative glyphs when additional single-byte encodings are
used, ex. replacing "Omegagreek" by "Omega" and vice versa.
</action>
- <action context="Code" dev="AD" type="add" fixes-bug="48334" importance="high">
+ <action context="Code" dev="AD" type="add" fixes-bug="48334">
Added support for resolution of relative URIs against a specified xml:base during
property refinement.
</action>
<action context="Renderers" dev="JM" type="add">
Allow afp:no-operation to also appear under fo:page-sequence and fo:declarations.
</action>
- <action context="Code" dev="AD" type="fix" fixes-bug="50635" due-to="Martin Koegler">
- Fix for issue in RenderPagesModel.checkPreparedPages() where the same page-sequence
+ <action context="Code" dev="AD" type="fix" fixes-bug="50635" due-to="mkoegler.AT.auto.tuwien.ac.at">
+ Bugfix: fix issue in RenderPagesModel.checkPreparedPages() where the same page-sequence
is potentially started multiple times.
</action>
- <action context="Code" dev="AD" type="fix" fixes-bug="50636" due-to="Martin Koegler">
- Fix for performance issue when adding pages, if the total number of pages
+ <action context="Code" dev="AD" type="fix" fixes-bug="50636" due-to="mkoegler.AT.auto.tuwien.ac.at">
+ Bugfix: fix performance issue when adding pages, if the total number of pages
is significantly large.
</action>
- <action context="Code" dev="AD" type="fix" fixes-bug="50626" due-to="Martin Koegler">
- Fix for performance issue when adding nodes, if the number of children
+ <action context="Code" dev="AD" type="fix" fixes-bug="50626" due-to="mkoegler.AT.auto.tuwien.ac.at">
+ Bugfix: fix performance issue when adding nodes, if the number of children
is significantly large.
</action>
<action context="Config" dev="SP" type="fix">
- Fix for relative URIs in the configuration file (base, font-base, hyphenation-base) are evaluated relative to the base URI of the configuration file.
+ Bugfix: relative URIs in the configuration file (base, font-base, hyphenation-base) are evaluated relative to the base URI of the configuration file.
</action>
- <action context="Layout" dev="AD" type="fix" fixes-bug="49848" importance="high">
- Fix for correct behavior of keep-together.within-line in case there are nested inlines
+ <action context="Layout" dev="AD" type="fix" fixes-bug="49848">
+ Bugfix: correct behavior of keep-together.within-line in case there are nested inlines
</action>
<action context="Code" dev="AD" type="fix" fixes-bug="50471">
- Fix for avoid ArrayIndexOutOfBoundsException for codepoints without a linebreak class
+ Bugfix: avoid ArrayIndexOutOfBoundsException for codepoints without a linebreak class
</action>
<action context="Layout" dev="AD" type="fix" fixes-bug="48380">
- Fix for avoid ClassCastException when using fox:widow-content-limit
+ Bugfix: avoid ClassCastException when using fox:widow-content-limit
</action>
<action context="Layout" dev="VH" type="fix" fixes-bug="50089">
- Fix for content after forced break in block-container is not rendered.
+ Bugfix: content after forced break in block-container is not rendered.
</action>
<action context="Layout" dev="JM" type="fix" fixes-bug="42034">
Fixed adjustment of inline parent area for justified text containing a forward page reference.
@@ -526,13 +479,13 @@
<action context="Code" dev="VH" type="fix" fixes-bug="49695" due-to="Joshua Marquart">
Replaced magic numbers with constants from UnitConv and GraphicsConstants.
</action>
- <action context="Renderers" dev="JM" type="add" fixes-bug="42600" due-to="Max Aster">
+ <action context="Renderers" dev="JM" type="add" fixes-bug="42600" due-to="Maximilian Aster">
Added some support for break-before/-after for RTF output.
</action>
- <action context="Renderers" dev="JM" type="add" fixes-bug="49379" due-to="Peter Hancock" importance="high">
+ <action context="Renderers" dev="JM" type="add" fixes-bug="49379" due-to="Peter Hancock">
Added ability to embed an external AFP page segment resource file (AFP output only).
</action>
- <action context="Renderers" dev="JM" type="fix" fixes-bug="46360" due-to="Alexios Giotis">
+ <action context="Renderers" dev="JM" type="fix" fixes-bug="46360" due-to="Alexis Giotis">
Fixed a multi-threading issue when rendering SVG.
</action>
<action context="Layout" dev="JM" type="fix" fixes-bug="49885">
@@ -542,10 +495,10 @@
Removed old Renderer implementations for those output formats that have a version based on
the new DocumentHandler architecture available (AFP, PCL, PDF, PS).
</action>
- <action context="Fonts" dev="AC" type="fix" importance="high">
+ <action context="Fonts" dev="AC" type="fix">
Reinstated support for being able to specify a font cache filepath in the fop user configuration.
</action>
- <action context="Fonts" dev="AC" type="add" importance="high">
+ <action context="Fonts" dev="AC" type="add">
Added convenience support for the flushing of the Fop font cache file from the command line.
</action>
<action context="Renderers" dev="JM" type="add" fixes-bug="44460" due-to="Andrejus Chaliapinas">
@@ -1885,7 +1838,7 @@
Bugfix: NullPointerException in RTF output when a table does not contain
table-columns.
</action>
- <action context="Code" dev="JM" type="fix" fixes-bug="39607" due-to="Julien Aym&#x00E9;">
+ <action context="Code" dev="JM" type="fix" fixes-bug="39607" due-to="Julien Aymé">
Bugfix: NullPointerException in RTF library when there are no borders on
the parent table.
</action>
diff --git a/test/java/org/apache/fop/UtilityCodeTestSuite.java b/test/java/org/apache/fop/UtilityCodeTestSuite.java
index 762b86b14..cf6b8875d 100644
--- a/test/java/org/apache/fop/UtilityCodeTestSuite.java
+++ b/test/java/org/apache/fop/UtilityCodeTestSuite.java
@@ -28,13 +28,10 @@ import org.apache.fop.pdf.FileIDGeneratorTestCase;
import org.apache.fop.pdf.PDFDocumentGraphics2DTestCase;
import org.apache.fop.pdf.PDFEncryptionJCETestCase;
import org.apache.fop.pdf.PDFFactoryTestCase;
-import org.apache.fop.pdf.PDFNumberTestCase;
-import org.apache.fop.pdf.PDFObjectTestCase;
import org.apache.fop.traits.BorderPropsTestCase;
import org.apache.fop.util.BitmapImageUtilTestCase;
import org.apache.fop.util.ColorUtilTestCase;
import org.apache.fop.util.ElementListUtilsTestCase;
-import org.apache.fop.util.HexEncoderTestCase;
import org.apache.fop.util.XMLResourceBundleTestCase;
/**
@@ -52,10 +49,7 @@ import org.apache.fop.util.XMLResourceBundleTestCase;
PDFFactoryTestCase.class,
PDFEncryptionJCETestCase.class,
BitmapImageUtilTestCase.class,
- PDFDocumentGraphics2DTestCase.class,
- PDFNumberTestCase.class,
- PDFObjectTestCase.class,
- HexEncoderTestCase.class
+ PDFDocumentGraphics2DTestCase.class
})
public class UtilityCodeTestSuite {
}
diff --git a/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java b/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java
index 863bfe797..9c53bdde3 100644
--- a/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java
+++ b/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java
@@ -19,6 +19,8 @@
package org.apache.fop.accessibility.fo;
+import static org.junit.Assert.assertTrue;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -43,8 +45,6 @@ import org.w3c.dom.Document;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
-import static org.junit.Assert.assertTrue;
-
import org.apache.fop.accessibility.StructureTree2SAXEventAdapter;
import org.apache.fop.accessibility.StructureTreeEventHandler;
import org.apache.fop.apps.FOPException;
@@ -102,17 +102,6 @@ public class FO2StructureTreeConverterTestCase {
testConverter();
}
- @Test
- public void testArtifact() throws Exception {
- foLoader = new FOLoader() {
-
- public InputStream getFoInputStream() {
- return getResource("artifact.fo");
- }
- };
- testConverter();
- }
-
private Transformer createTransformer(Source xslt) throws TransformerFactoryConfigurationError,
TransformerConfigurationException {
TransformerFactory transformerFactory = TransformerFactory.newInstance();
diff --git a/test/java/org/apache/fop/accessibility/fo/artifact.fo b/test/java/org/apache/fop/accessibility/fo/artifact.fo
deleted file mode 100644
index c3d5fadf3..000000000
--- a/test/java/org/apache/fop/accessibility/fo/artifact.fo
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
- <fo:layout-master-set>
- <fo:simple-page-master master-name="page"
- page-height="500pt" page-width="300pt" margin="20pt">
- <fo:region-body/>
- </fo:simple-page-master>
- </fo:layout-master-set>
-
- <fo:page-sequence master-reference="page">
- <fo:flow flow-name="xsl-region-body" text-align="justify">
-
- <fo:block>This piece of text is normal content that should be read out loud by a screen
- reader.</fo:block>
-
- <fo:block space-before="10pt">The following content will be treated as artifact:</fo:block>
-
- <fo:wrapper role="artifact">
- <fo:block-container border="1pt solid black" padding="5pt" background-color="#F0F0F0"
- space-before="10pt" start-indent="6pt" end-indent="6pt" color="#606060">
- <fo:block start-indent="0" end-indent="0">
- <fo:block>A block as artifact.</fo:block>
- <fo:table space-before="5pt" width="100%" table-layout="fixed">
- <fo:table-column column-width="proportional-column-width(1)"/>
- <fo:table-column column-width="proportional-column-width(2)"/>
- <fo:table-header>
- <fo:table-cell border="1pt solid #606060"><fo:block>Header 1.1</fo:block></fo:table-cell>
- <fo:table-cell border="1pt solid #606060"><fo:block>Header 1.2</fo:block></fo:table-cell>
- </fo:table-header>
- <fo:table-footer>
- <fo:table-cell border="1pt solid #606060"><fo:block>Footer 1.1</fo:block></fo:table-cell>
- <fo:table-cell border="1pt solid #606060"><fo:block>Footer 1.2</fo:block></fo:table-cell>
- </fo:table-footer>
- <fo:table-body>
- <fo:table-row>
- <fo:table-cell border="1pt solid #606060"><fo:block>Cell 1.1</fo:block></fo:table-cell>
- <fo:table-cell border="1pt solid #606060"><fo:block>Cell 1.2</fo:block></fo:table-cell>
- </fo:table-row>
- <fo:table-row>
- <fo:table-cell border="1pt solid #606060"><fo:block>Cell 2.1</fo:block></fo:table-cell>
- <fo:table-cell border="1pt solid #606060"><fo:block>Cell 2.2</fo:block></fo:table-cell>
- </fo:table-row>
- </fo:table-body>
- </fo:table>
- <fo:list-block space-before="7pt" provisional-distance-between-starts="8pt"
- provisional-label-separation="5pt">
- <fo:list-item>
- <fo:list-item-label end-indent="label-end()">
- <fo:block>•</fo:block>
- </fo:list-item-label>
- <fo:list-item-body start-indent="body-start()">
- <fo:block>Item 1.</fo:block>
- </fo:list-item-body>
- </fo:list-item>
- <fo:list-item>
- <fo:list-item-label end-indent="label-end()">
- <fo:block>•</fo:block>
- </fo:list-item-label>
- <fo:list-item-body start-indent="body-start()">
- <fo:block>Item 2.</fo:block>
- </fo:list-item-body>
- </fo:list-item>
- <fo:list-item>
- <fo:list-item-label end-indent="label-end()">
- <fo:block>•</fo:block>
- </fo:list-item-label>
- <fo:list-item-body start-indent="body-start()">
- <fo:block>Item 3.</fo:block>
- </fo:list-item-body>
- </fo:list-item>
- </fo:list-block>
- <fo:wrapper>
- <fo:block>A block in a nested wrapper.</fo:block>
- </fo:wrapper>
- <fo:wrapper role="artifact">
- <fo:block>A block in a nested artifact wrapper.</fo:block>
- </fo:wrapper>
- <fo:wrapper>
- <fo:block>Inside a nested wrapper.
- <fo:wrapper role="artifact">An artifact wrapper inside the nested wrapper.
- <fo:inline><fo:wrapper>Inside a wrapper inside the artifact wrapper that is inside
- the nested wrapper.</fo:wrapper> Outside the wrapper inside the artifact
- wrapper that is inside the nested wrapper.</fo:inline>
- </fo:wrapper> Outside the artifact wrapper.</fo:block>
- </fo:wrapper>
- </fo:block>
- </fo:block-container>
- </fo:wrapper>
-
- <fo:block space-before="10pt">Now we are back to normal content that is part of the logical
- structure, should appear in the structure tree and should be read out loud by the screen
- reader.</fo:block>
-
- </fo:flow>
- </fo:page-sequence>
-
-</fo:root>
diff --git a/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl b/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl
index db0dffb14..ce326f3b1 100644
--- a/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl
+++ b/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl
@@ -105,8 +105,6 @@
<xsl:call-template name="copy"/>
</xsl:template>
- <xsl:template match="fo:wrapper[translate(normalize-space(@role), 'ARTIFCT', 'artifct') = 'artifact']"/>
-
<!-- Discard descendants of fo:leader -->
<xsl:template match="fo:leader"/>
diff --git a/test/java/org/apache/fop/fonts/DejaVuLGCSerifTestCase.java b/test/java/org/apache/fop/fonts/DejaVuLGCSerifTestCase.java
index 49c447583..4ac61d893 100644
--- a/test/java/org/apache/fop/fonts/DejaVuLGCSerifTestCase.java
+++ b/test/java/org/apache/fop/fonts/DejaVuLGCSerifTestCase.java
@@ -43,8 +43,7 @@ public class DejaVuLGCSerifTestCase {
@Before
public void setUp() throws Exception {
File file = new File("test/resources/fonts/ttf/DejaVuLGCSerif.ttf");
- font = FontLoader.loadFont(file, "", true, EmbeddingMode.AUTO, EncodingMode.AUTO,
- fontResolver);
+ font = FontLoader.loadFont(file, "", true, EncodingMode.AUTO, fontResolver);
}
/**
diff --git a/test/java/org/apache/fop/fonts/EncodingModeTestCase.java b/test/java/org/apache/fop/fonts/EncodingModeTestCase.java
index 8cab9eb8b..1ec22e1ef 100644
--- a/test/java/org/apache/fop/fonts/EncodingModeTestCase.java
+++ b/test/java/org/apache/fop/fonts/EncodingModeTestCase.java
@@ -19,13 +19,10 @@
package org.apache.fop.fonts;
-import org.junit.Test;
-
import static org.junit.Assert.assertEquals;
-/**
- * Tests {@link EncodingMode}.
- */
+import org.junit.Test;
+
public class EncodingModeTestCase {
@Test
@@ -37,13 +34,8 @@ public class EncodingModeTestCase {
@Test
public void testGetValue() {
- assertEquals(EncodingMode.AUTO, EncodingMode.getValue("auto"));
- assertEquals(EncodingMode.SINGLE_BYTE, EncodingMode.getValue("single-byte"));
- assertEquals(EncodingMode.CID, EncodingMode.getValue("cid"));
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void getValueMustCheckForIllegalArguments() {
- EncodingMode.getValue("fail");
+ assertEquals(EncodingMode.AUTO, EncodingMode.getEncodingMode("auto"));
+ assertEquals(EncodingMode.SINGLE_BYTE, EncodingMode.getEncodingMode("single-byte"));
+ assertEquals(EncodingMode.CID, EncodingMode.getEncodingMode("cid"));
}
}
diff --git a/test/java/org/apache/fop/fonts/FOPFontsTestSuite.java b/test/java/org/apache/fop/fonts/FOPFontsTestSuite.java
deleted file mode 100644
index 8e1a0040d..000000000
--- a/test/java/org/apache/fop/fonts/FOPFontsTestSuite.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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 org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-import org.apache.fop.fonts.truetype.FontFileReaderTestCase;
-import org.apache.fop.fonts.truetype.TTFFileTestCase;
-import org.apache.fop.fonts.truetype.TTFSubSetFileTestCase;
-import org.apache.fop.fonts.truetype.TTFTableNameTestCase;
-
-/**
- * A test suite designed for org.apache.fop.fonts.*
- */
-@RunWith(Suite.class)
-@SuiteClasses({
- EncodingModeTestCase.class,
- FontFileReaderTestCase.class,
- TTFFileTestCase.class,
- TTFSubSetFileTestCase.class,
- TTFTableNameTestCase.class })
-public final class FOPFontsTestSuite {
-}
diff --git a/test/java/org/apache/fop/fonts/truetype/FontFileReaderTestCase.java b/test/java/org/apache/fop/fonts/truetype/FontFileReaderTestCase.java
deleted file mode 100644
index 5c1fec175..000000000
--- a/test/java/org/apache/fop/fonts/truetype/FontFileReaderTestCase.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * 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.truetype;
-
-import java.io.ByteArrayInputStream;
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Arrays;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-/**
- * A test class for org.apache.fop.truetype.FontFileReader
- */
-public class FontFileReaderTestCase {
- private FontFileReader fontReader;
- private final InputStream in;
- private final byte[] byteArray;
-
- /**
- * Constructor - initialises an array that only needs to be created once. It creates a byte[]
- * of form { 0x00, 0x01, 0x02, 0x03..., 0xff};
- */
- public FontFileReaderTestCase() {
- byteArray = new byte[256];
- for (int i = 0; i < 256; i++) {
- byteArray[i] = (byte) i;
- }
- in = new ByteArrayInputStream(byteArray);
- }
-
- /**
- * sets up the test subject object for testing.
- */
- @Before
- public void setUp() {
- try {
- fontReader = new FontFileReader(in);
- } catch (Exception e) {
- fail("Error: " + e.getMessage());
- }
- }
-
- /**
- * the "destructor" method.
- *
- */
- public void tearDown() {
- fontReader = null;
- }
-
- /**
- * Test readTTFByte()
- * @throws IOException exception
- */
- @Test
- public void testReadTTFByte() throws IOException {
- for (int i = 0; i < 256; i++) {
- assertEquals((byte) i, fontReader.readTTFByte());
- }
- }
-
- /**
- * Test seekSet() - check that it moves to the correct position and enforce a failure case.
- * @throws IOException exception
- */
- @Test
- public void testSeekSet() throws IOException {
- fontReader.seekSet(10);
- assertEquals(10, fontReader.readTTFByte());
- try {
- fontReader.seekSet(257);
- fail("FileFontReaderTest Failed testSeekSet");
- } catch (IOException e) {
- // Passed
- }
- }
-
- /**
- * Test skip() - check that it moves to the correct position and enforce a failure case.
- * @throws IOException exception
- */
- @Test
- public void testSkip() throws IOException {
- fontReader.skip(100);
- assertEquals(100, fontReader.readTTFByte());
- try {
- // 100 (seekAdd) + 1 (read() = 1 byte) + 156 = 257
- fontReader.skip(156);
- fail("FileFontReaderTest Failed testSkip");
- } catch (IOException e) {
- // Passed
- }
- }
-
- /**
- * Test getCurrentPos() - 3 checks:
- * 1) test with seekSet(int)
- * 2) test with skip(int)
- * 3) test with a readTTFByte() (this moves the position by the size of the data being read)
- * @throws IOException exception
- */
- @Test
- public void testGetCurrentPos() throws IOException {
- fontReader.seekSet(10);
- fontReader.skip(100);
- assertEquals(110, fontReader.getCurrentPos());
- fontReader.readTTFByte();
- assertEquals(111, fontReader.getCurrentPos());
- }
-
- /**
- * Test getFileSize()
- */
- @Test
- public void testGetFileSize() {
- assertEquals(256, fontReader.getFileSize());
- }
-
- /**
- * Test readTTFUByte()
- * @throws IOException exception
- */
- @Test
- public void testReadTTFUByte() throws IOException {
- for (int i = 0; i < 256; i++) {
- assertEquals(i, fontReader.readTTFUByte());
- }
- }
-
- /**
- * Test readTTFShort() - Test positive and negative numbers (two's compliment).
- * @throws IOException exception
- */
- @Test
- public void testReadTTFShort() throws IOException {
- // 0x0001 = 1
- assertEquals("Should have been 1 (0x0001)", 1, fontReader.readTTFShort());
- // 0x0203 = 515
- assertEquals(515, fontReader.readTTFShort());
- // now test negative numbers
- fontReader.seekSet(250);
- // 0xfafb
- assertEquals(-1285, fontReader.readTTFShort());
- }
-
- /**
- * Test readTTFUShort() - Test positive and potentially negative numbers (two's compliment).
- * @throws IOException exception
- */
- @Test
- public void testReadTTFUShort() throws IOException {
- // 0x0001
- assertEquals(1, fontReader.readTTFUShort());
- // 0x0203
- assertEquals(515, fontReader.readTTFUShort());
- // test potential negatives
- fontReader.seekSet(250);
- // 0xfafb
- assertEquals((250 << 8) + 251, fontReader.readTTFUShort());
- }
-
- /**
- * Test readTTFShort(int) - test reading ahead of current position and behind current position
- * and in both cases ensure that our current position isn't changed.
- * @throws IOException exception
- */
- @Test
- public void testReadTTFShortWithArg() throws IOException {
- // 0x6465
- assertEquals(25701, fontReader.readTTFShort(100));
- assertEquals(0, fontReader.getCurrentPos());
- // read behind current position (and negative)
- fontReader.seekSet(255);
- // 0xfafb
- assertEquals(-1285, fontReader.readTTFShort(250));
- assertEquals(255, fontReader.getCurrentPos());
- }
-
- /**
- * Test readTTFUShort(int arg) - test reading ahead of current position and behind current
- * position and in both cases ensure that our current position isn't changed.
- * @throws IOException exception
- */
- @Test
- public void testReadTTFUShortWithArg() throws IOException {
- // 0x6465
- assertEquals(25701, fontReader.readTTFUShort(100));
- assertEquals(0, fontReader.getCurrentPos());
- // read behind current position (and potential negative)
- fontReader.seekSet(255);
- // 0xfafb
- assertEquals(64251, fontReader.readTTFUShort(250));
- assertEquals(255, fontReader.getCurrentPos());
- }
-
- /**
- * Test readTTFLong()
- * @throws IOException exception
- */
- @Test
- public void testReadTTFLong() throws IOException {
- // 0x00010203
- assertEquals(66051, fontReader.readTTFLong());
- // test negative numbers
- fontReader.seekSet(250);
- // 0xf0f1f2f3
- assertEquals(-84148995, fontReader.readTTFLong());
- }
-
- /**
- * Test readTTFULong()
- * @throws IOException exception
- */
- @Test
- public void testReadTTFULong() throws IOException {
- // 0x00010203
- assertEquals(66051, fontReader.readTTFULong());
- // test negative numbers
- fontReader.seekSet(250);
- // 0xfafbfcfd
- assertEquals(4210818301L, fontReader.readTTFULong());
- }
-
- /**
- * Test readTTFString() - there are two paths to test here:
- * 1) A null terminated string
- * 2) A string not terminated with a null (we expect this to throw an EOFException)
- * @throws IOException exception
- */
- @Test
- public void testReadTTFString() throws IOException {
- byte[] strByte = {(byte)'t', (byte)'e', (byte)'s', (byte)'t', 0x00};
- fontReader = new FontFileReader(new ByteArrayInputStream(strByte));
- assertEquals("test", fontReader.readTTFString());
- try {
- // not NUL terminated
- byte[] strByteNoNull = {(byte)'t', (byte)'e', (byte)'s', (byte)'t'};
- fontReader = new FontFileReader(new ByteArrayInputStream(strByteNoNull));
- assertEquals("test", fontReader.readTTFString());
- fail("FontFileReaderTest testReadTTFString Fails.");
- } catch (EOFException e) {
- // Pass
- }
- }
-
- /**
- * Test readTTFString(int arg)
- * @throws IOException exception
- */
- @Test
- public void testReadTTFStringIntArg() throws IOException {
- byte[] strByte = {(byte)'t', (byte)'e', (byte)'s', (byte)'t'};
- fontReader = new FontFileReader(new ByteArrayInputStream(strByte));
- assertEquals("test", fontReader.readTTFString(4));
- try {
- fontReader = new FontFileReader(new ByteArrayInputStream(strByte));
- assertEquals("test", fontReader.readTTFString(5));
- fail("FontFileReaderTest testReadTTFStringIntArg Fails.");
- } catch (EOFException e) {
- // Pass
- }
- }
-
- /**
- * Test readTTFString(int arg1, int arg2)
- */
- public void testReadTTFString2IntArgs() {
- // currently the same as above
- }
-
- /**
- * Test getBytes()
- * @throws IOException exception
- */
- @Test
- public void testGetBytes() throws IOException {
- byte[] retrievedBytes = fontReader.getBytes(0, 256);
- assertTrue(Arrays.equals(byteArray, retrievedBytes));
- }
-}
diff --git a/test/java/org/apache/fop/fonts/truetype/GlyfTableTestCase.java b/test/java/org/apache/fop/fonts/truetype/GlyfTableTestCase.java
index 825f71ac1..67191accc 100644
--- a/test/java/org/apache/fop/fonts/truetype/GlyfTableTestCase.java
+++ b/test/java/org/apache/fop/fonts/truetype/GlyfTableTestCase.java
@@ -19,6 +19,8 @@
package org.apache.fop.fonts.truetype;
+import static org.junit.Assert.assertTrue;
+
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -29,8 +31,6 @@ import java.util.Map;
import org.junit.Before;
import org.junit.Test;
-import static org.junit.Assert.assertTrue;
-
/**
* Tests {@link GlyfTable}.
*/
@@ -141,8 +141,7 @@ public class GlyfTableTestCase {
private void setupSubsetReader(Map<Integer, Integer> glyphs) throws IOException {
TTFSubSetFile fontFile = new TTFSubSetFile();
- fontFile.readFont(originalFontReader, "Deja", glyphs);
- byte[] subsetFont = fontFile.getFontSubset();
+ byte[] subsetFont = fontFile.readFont(originalFontReader, "Deja", glyphs);
InputStream intputStream = new ByteArrayInputStream(subsetFont);
subsetReader = new FontFileReader(intputStream);
}
diff --git a/test/java/org/apache/fop/fonts/truetype/TTFFileTestCase.java b/test/java/org/apache/fop/fonts/truetype/TTFFileTestCase.java
deleted file mode 100644
index d490a3d5d..000000000
--- a/test/java/org/apache/fop/fonts/truetype/TTFFileTestCase.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- * 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.truetype;
-
-import java.io.IOException;
-import java.util.Map;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.apache.fop.fonts.truetype.TTFFile.PostScriptVersion;
-
-/**
- * Class for testing org.apache.fop.fonts.truetype.TTFFile
- */
-public class TTFFileTestCase {
- // We only want to initialize the FontFileReader once (for performance reasons)
- /** The truetype font file (DejaVuLGCSerif) */
- protected final TTFFile dejavuTTFFile;
- /** The FontFileReader for ttfFile (DejaVuLGCSerif) */
- protected final FontFileReader dejavuReader;
- /** The truetype font file (DroidSansMono) */
- protected final TTFFile droidmonoTTFFile;
- /** The FontFileReader for ttfFile (DroidSansMono) */
- protected final FontFileReader droidmonoReader;
-
-
- /**
- * Constructor initialises FileFontReader to
- * @throws IOException exception
- */
- public TTFFileTestCase() throws IOException {
- dejavuTTFFile = new TTFFile();
- dejavuReader = new FontFileReader("test/resources/fonts/ttf/DejaVuLGCSerif.ttf");
- dejavuTTFFile.readFont(dejavuReader);
- droidmonoTTFFile = new TTFFile();
- droidmonoReader = new FontFileReader("test/resources/fonts/ttf/DroidSansMono.ttf");
- droidmonoTTFFile.readFont(droidmonoReader);
- }
-
- /**
- * Test convertTTFUnit2PDFUnit() - The units per em retrieved reading the HEAD table from
- * the font file. (DroidSansMono has the same units per em as DejaVu so no point testing it)
- */
- @Test
- public void testConvertTTFUnit2PDFUnit() {
- // DejaVu has 2048 units per em (PDF works in millipts, thus the 1000)
- // test rational number
- assertEquals(1000, dejavuTTFFile.convertTTFUnit2PDFUnit(2048));
- // test smallest case, this should = 0.488 (round down to 0)
- assertEquals(0, dejavuTTFFile.convertTTFUnit2PDFUnit(1));
- // this should round up, but since it's millipts...
- assertEquals(0, dejavuTTFFile.convertTTFUnit2PDFUnit(2));
- // ensure behaviour is the same for negative numbers
- assertEquals(0, dejavuTTFFile.convertTTFUnit2PDFUnit(-0));
- assertEquals(-1000, dejavuTTFFile.convertTTFUnit2PDFUnit(-2048));
- assertEquals(0, dejavuTTFFile.convertTTFUnit2PDFUnit(-1));
- assertEquals(0, dejavuTTFFile.convertTTFUnit2PDFUnit(-2));
- }
-
- /**
- * Test checkTTC()
- * @throws IOException exception
- */
- @Test
- public void testCheckTTC() throws IOException {
- // DejaVu is not a TTC, thus this returns true
- assertTrue(dejavuTTFFile.checkTTC(""));
- assertTrue(droidmonoTTFFile.checkTTC(""));
- /*
- * Cannot reasonably test the rest of this method without an actual truetype collection
- * because all methods in FontFileReader are "final" and thus mocking isn't possible.
- */
- }
-
- /**
- * Test getAnsiKerning() - Tests values retrieved from the kern table in the font file.
- */
- @Test
- public void testGetAnsiKerning() {
- Map<Integer, Map<Integer, Integer>> ansiKerning = dejavuTTFFile.getKerning();
- if (ansiKerning.isEmpty()) {
- fail();
- }
- Integer k1 = ansiKerning.get(Integer.valueOf('A')).get(
- Integer.valueOf('T'));
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(-112), k1.intValue());
- Integer k2 = ansiKerning.get(Integer.valueOf('Y')).get(Integer.valueOf('u'));
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(-178), k2.intValue());
-
- // DroidSansMono doens't have kerning (it's mono-spaced)
- ansiKerning = droidmonoTTFFile.getAnsiKerning();
- if (!ansiKerning.isEmpty()) {
- fail("DroidSansMono shouldn't have any kerning data.");
- }
- }
-
- /**
- * Test getCapHeight - there are several paths to test:
- * 1) The PCLT table (if present)
- * 2) The yMax (3rd) value, for the bounding box, for 'H' in the glyf table.
- * if not the above:
- * 3) The caps height in the OS/2 table
- * Tests values retrieved from analysing the font file.
- */
- @Test
- public void testGetCapHeight() {
- // DejaVu doesn't have the PCLT table and so these have to be guessed
- // The height is approximated to be the height of the "H" which for
- // Deja = 1493 TTFunits
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(1493), dejavuTTFFile.getCapHeight());
- // DroidSansMono doesn't have a PCLT table either
- // height of "H" = 1462
- assertEquals(droidmonoTTFFile.convertTTFUnit2PDFUnit(1462),
- droidmonoTTFFile.getCapHeight());
- }
-
- /**
- * Test getCharSetName() - check that it returns "WinAnsiEncoding".
- */
- @Test
- public void testGetCharSetName() {
- assertTrue("WinAnsiEncoding".equals(dejavuTTFFile.getCharSetName()));
- assertTrue("WinAnsiEncoding".equals(droidmonoTTFFile.getCharSetName()));
- }
-
- /**
- * Test getCharWidth() - Test values retrieved from the metrics in the glyf table in
- * the font file.
- */
- @Test
- public void testGetCharWidth() {
- // Arbitrarily test a few values:
- // The width of "H" (Unicode index 0x0048) is 1786
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(1786), dejavuTTFFile.getCharWidth(0x48));
- // The width of "i" (unicode index 0x0069) is 655 TTFunits
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(655), dejavuTTFFile.getCharWidth(0x69));
- // final check, "!" (unicode index 0x0021) is 823 TTFunits
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(823), dejavuTTFFile.getCharWidth(0x21));
-
- // All the glyphs should be the same width in DroidSansMono (mono-spaced)
- int charWidth = droidmonoTTFFile.convertTTFUnit2PDFUnit(1229);
- for (int i = 0; i < 255; i++) {
- assertEquals(charWidth, droidmonoTTFFile.getCharWidth(i));
- }
- }
-
- /**
- * TODO: add implementation to this test
- */
- public void testGetCMaps() {
- }
-
- /**
- * Test getFamilyNames() - Test value retrieved from the name table in the font file.
- */
- @Test
- public void testGetFamilyNames() {
- assertEquals(1, dejavuTTFFile.getFamilyNames().size());
- for (String name : dejavuTTFFile.getFamilyNames()) {
- assertEquals("DejaVu LGC Serif", name);
- }
- assertEquals(1, droidmonoTTFFile.getFamilyNames().size());
- for (String name : droidmonoTTFFile.getFamilyNames()) {
- assertEquals("Droid Sans Mono", name);
- }
- }
-
- /**
- * Test getFirstChar() - TODO: implement a more intelligent test here.
- */
- @Test
- public void testGetFirstChar() {
- // Not really sure how to test this intelligently
- assertEquals(0, dejavuTTFFile.getFirstChar());
- assertEquals(0, droidmonoTTFFile.getFirstChar());
- }
-
- /**
- * Test getFlags() - Test values retrieved from the POST table in the font file.
- */
- @Test
- public void testGetFlags() {
- /* DejaVu flags are:
- * italic angle = 0
- * fixed pitch = 0
- * has serifs = true (default value; this font doesn't have a PCLT table)
- */
- int flags = dejavuTTFFile.getFlags();
- assertEquals(0, flags & 64); // Italics angle = 0
- assertEquals(32, flags & 32); // Adobe standard charset
- assertEquals(0, flags & 2); // fixed pitch = 0
- assertEquals(1, flags & 1); // has serifs = 1 (true)
- /*
- * Droid flags are:
- * italic angle = 0
- * fixed pitch = 1
- * has serifs = true (default value; this font doesn't have a PCLT table)
- */
- flags = droidmonoTTFFile.getFlags();
- assertEquals(0, flags & 64);
- assertEquals(32, flags & 32);
- assertEquals(2, flags & 2);
- assertEquals(1, flags & 1);
- }
-
- /**
- * Test getFontBBox() - Test values retrieved from values in the HEAD table in the font file.
- */
- @Test
- public void testGetFontBBox() {
- int[] bBox = dejavuTTFFile.getFontBBox();
- /*
- * The head table has the following values(DejaVu):
- * xmin = -1576, ymin = -710, xmax = 3439, ymax = 2544
- */
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(-1576), bBox[0]);
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(-710), bBox[1]);
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(3439), bBox[2]);
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(2544), bBox[3]);
- /*
- * The head table has the following values (DroidSansMono):
- * xmin = -312, ymin= -555, xmax = 1315, ymax = 2163
- */
- bBox = droidmonoTTFFile.getFontBBox();
- assertEquals(droidmonoTTFFile.convertTTFUnit2PDFUnit(-312), bBox[0]);
- assertEquals(droidmonoTTFFile.convertTTFUnit2PDFUnit(-555), bBox[1]);
- assertEquals(droidmonoTTFFile.convertTTFUnit2PDFUnit(1315), bBox[2]);
- assertEquals(droidmonoTTFFile.convertTTFUnit2PDFUnit(2163), bBox[3]);
- }
-
- /**
- * Test getFullName() - Test value retrieved from the name table in the font file.
- */
- @Test
- public void testGetFullName() {
- assertEquals("DejaVu LGC Serif", dejavuTTFFile.getFullName());
- assertEquals("Droid Sans Mono", droidmonoTTFFile.getFullName());
- }
-
- /**
- * Test getGlyphName - Test value retrieved from the POST table in the font file.
- */
- @Test
- public void testGetGlyphName() {
- assertEquals("H", dejavuTTFFile.getGlyphName(43));
- assertEquals("H", droidmonoTTFFile.getGlyphName(43));
- }
-
- /**
- * Test getItalicAngle() - Test value retrieved from the POST table in the font file.
- */
- @Test
- public void testGetItalicAngle() {
- assertEquals("0", dejavuTTFFile.getItalicAngle());
- assertEquals("0", droidmonoTTFFile.getItalicAngle());
- }
-
- /**
- * Test getKerning() - Test values retrieved from the kern table in the font file.
- */
- @Test
- public void testGetKerning() {
- Map<Integer, Map<Integer, Integer>> kerning = dejavuTTFFile.getKerning();
- if (kerning.isEmpty()) {
- fail();
- }
- Integer k1 = kerning.get(Integer.valueOf('A')).get(Integer.valueOf('T'));
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(-112), k1.intValue());
- Integer k2 = kerning.get(Integer.valueOf('K')).get(Integer.valueOf('u'));
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(-45), k2.intValue());
-
- // DroidSansMono has no kerning data (mono-spaced)
- kerning = droidmonoTTFFile.getKerning();
- if (!kerning.isEmpty()) {
- fail("DroidSansMono shouldn't have any kerning data");
- }
- }
-
- /**
- * Test lastChar() - TODO: implement a more intelligent test
- */
- @Test
- public void testLastChar() {
- assertEquals(0xff, dejavuTTFFile.getLastChar());
- assertEquals(0xff, droidmonoTTFFile.getLastChar());
- }
-
- /**
- * Test getLowerCaseAscent() - There are several paths to test:
- * 1) The values in the HHEA table (see code)
- * 2) Fall back to values from the OS/2 table
- * Test values retrieved from the font file.
- */
- @Test
- public void testGetLowerCaseAscent() {
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(1556),
- dejavuTTFFile.getLowerCaseAscent());
- // Curiously the same value
- assertEquals(droidmonoTTFFile.convertTTFUnit2PDFUnit(1556),
- droidmonoTTFFile.getLowerCaseAscent());
- }
-
- /**
- * Test getPostScriptName() - Test values retrieved from the post table in the font file.
- */
- @Test
- public void testGetPostScriptName() {
- assertEquals(PostScriptVersion.V2, dejavuTTFFile.getPostScriptVersion());
- assertEquals(PostScriptVersion.V2, droidmonoTTFFile.getPostScriptVersion());
- }
-
- /**
- * Test getStemV() - Undefined.
- */
- @Test
- public void testGetStemV() {
- // Undefined
- assertEquals("0", dejavuTTFFile.getStemV());
- assertEquals("0", droidmonoTTFFile.getStemV());
- }
-
- /**
- * Test getSubFamilyName() - Test values retrieved from the name table in the font file.
- */
- @Test
- public void testGetSubFamilyName() {
- assertEquals("Book", dejavuTTFFile.getSubFamilyName());
- assertEquals("Regular", droidmonoTTFFile.getSubFamilyName());
- }
-
- /**
- * Test getTTCnames() - TODO: add implementation with TTC font.
- */
- public void testGetTTCnames() {
- // Can't test with with DejaVu since it's not a TrueType Collection
- }
-
- /**
- * Test getWeightClass() - Test value retrieved from the OS/2 table in the font file.
- */
- @Test
- public void testGetWeightClass() {
- // Retrieved from OS/2 table
- assertEquals(400, dejavuTTFFile.getWeightClass());
- assertEquals(400, droidmonoTTFFile.getWeightClass());
- }
-
- /**
- * Test getWidths() - Test values retrieved from the hmtx table in the font file.
- */
- @Test
- public void testGetWidths() {
- int[] widths = dejavuTTFFile.getWidths();
- // using the width of 'A' index = 36
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(1479), widths[36]);
- // using the width of '|' index = 95
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(690), widths[95]);
- widths = droidmonoTTFFile.getWidths();
- // DroidSansMono should have all widths the same size (mono-spaced)
- int width = droidmonoTTFFile.convertTTFUnit2PDFUnit(1229);
- for (int i = 0; i < 255; i++) {
- assertEquals(width, widths[i]);
- }
- }
-
- /**
- * Test getXHeight() - There are several paths to test:
- * 1) The PCLT table (if available)
- * 2) The yMax for the bounding box for 'x' in the glyf table.
- * Fall back:
- * 3) The xheight in the OS/2 table.
- */
- @Test
- public void testGetXHeight() {
- // Since there's no PCLT table, the height of 'x' is used for both DejaVu and DroidSansMono
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(1064), dejavuTTFFile.getXHeight());
- assertEquals(droidmonoTTFFile.convertTTFUnit2PDFUnit(1098), droidmonoTTFFile.getXHeight());
- }
-
- /**
- * Test isCFF() - TODO: add test for a CFF font.
- */
- @Test
- public void testIsCFF() {
- // Neither DejaVu nor DroidSansMono are a compact format font
- assertEquals(false, dejavuTTFFile.isCFF());
- assertEquals(false, droidmonoTTFFile.isCFF());
- }
-
- /**
- * Test isEmbeddable() - Test value retrieved from the OS/2 table in the font file.
- */
- @Test
- public void testIsEmbeddable() {
- // Dejavu and DroidSansMono are both embeddable
- assertEquals(true, dejavuTTFFile.isEmbeddable());
- assertEquals(true, droidmonoTTFFile.isEmbeddable());
- }
-
- /**
- * Test readFont() - Add implementation if necessary.
- */
- public void testReadFont() {
- // I'm pretty sure we've tested this with all the other tests
- }
-}
diff --git a/test/java/org/apache/fop/fonts/truetype/TTFFontLoaderTestCase.java b/test/java/org/apache/fop/fonts/truetype/TTFFontLoaderTestCase.java
index d6555c32e..35c865cd7 100644
--- a/test/java/org/apache/fop/fonts/truetype/TTFFontLoaderTestCase.java
+++ b/test/java/org/apache/fop/fonts/truetype/TTFFontLoaderTestCase.java
@@ -19,19 +19,18 @@
package org.apache.fop.fonts.truetype;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
import java.io.File;
import java.io.IOException;
import org.junit.Test;
-import org.apache.fop.fonts.EmbeddingMode;
import org.apache.fop.fonts.EncodingMode;
import org.apache.fop.fonts.FontManager;
import org.apache.fop.fonts.FontResolver;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
/**
* Test case for {@link TTFFontLoader}.
*/
@@ -48,12 +47,12 @@ public class TTFFontLoaderTestCase {
boolean useKerning = true;
TTFFontLoader fontLoader = new TTFFontLoader(absoluteFilePath, fontName, embedded,
- EmbeddingMode.AUTO, EncodingMode.AUTO, useKerning, useComplexScriptFeatures, resolver);
+ EncodingMode.AUTO, useKerning, useComplexScriptFeatures, resolver);
assertTrue(fontLoader.getFont().hasKerningInfo());
useKerning = false;
- fontLoader = new TTFFontLoader(absoluteFilePath, fontName, embedded, EmbeddingMode.AUTO,
- EncodingMode.AUTO, useKerning, useComplexScriptFeatures, resolver);
+ fontLoader = new TTFFontLoader(absoluteFilePath, fontName, embedded, EncodingMode.AUTO,
+ useKerning, useComplexScriptFeatures, resolver);
assertFalse(fontLoader.getFont().hasKerningInfo());
}
}
diff --git a/test/java/org/apache/fop/fonts/truetype/TTFSubSetFileTestCase.java b/test/java/org/apache/fop/fonts/truetype/TTFSubSetFileTestCase.java
deleted file mode 100644
index 16bedad8d..000000000
--- a/test/java/org/apache/fop/fonts/truetype/TTFSubSetFileTestCase.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.truetype;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * This class tests TTFSubSetFile
- * TODO: Test with more than just a single font
- */
-public class TTFSubSetFileTestCase extends TTFFileTestCase {
- private TTFSubSetFile ttfSubset;
- private byte[] subset;
- /**
- * Constructor
- * @throws IOException exception
- */
- public TTFSubSetFileTestCase() throws IOException {
- super();
- }
-
- /**
- * setUp()
- * @exception IOException file read error
- */
- @Before
- public void setUp() throws IOException {
- ttfSubset = new TTFSubSetFile();
- Map<Integer, Integer> glyphs = new HashMap<Integer, Integer>();
- for (int i = 0; i < 255; i++) {
- glyphs.put(i, i);
- }
- ttfSubset.readFont(dejavuReader, "DejaVu", glyphs);
- subset = ttfSubset.getFontSubset();
- }
- /**
- * Test readFont(FontFileReader, String, Map) - Reads the font and tests the output by injecting
- * it into a TTFFile object to check the validity of the file as a font. This currently doesn't
- * create a cmap table, and so the font doesn't contain ALL of the mandatory tables.
- * @throws IOException exception
- */
- @Test
- public void testReadFont3Args() throws IOException {
-
- ByteArrayInputStream byteArray = new ByteArrayInputStream(subset);
- dejavuTTFFile.readFont(new FontFileReader(byteArray));
- // Test a couple arbitrary values
- assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(-1576), dejavuTTFFile.getFontBBox()[0]);
- assertEquals(dejavuTTFFile.getFullName(), "DejaVu LGC Serif");
- }
-}
diff --git a/test/java/org/apache/fop/fonts/truetype/TTFTableNameTestCase.java b/test/java/org/apache/fop/fonts/truetype/TTFTableNameTestCase.java
deleted file mode 100644
index b9066dc2d..000000000
--- a/test/java/org/apache/fop/fonts/truetype/TTFTableNameTestCase.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * 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.truetype;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * This class tests the enum org.apache.fop.fonts.truetype.TTFTableName
- *
- */
-public class TTFTableNameTestCase {
- /**
- * Test getName() - tests that the getName() method returns the expected String as expected in
- * the Directory Table.
- * @exception IllegalAccessException error
- */
- @Test
- public void testGetName() throws IllegalAccessException {
- assertEquals("tableDirectory", TTFTableName.TABLE_DIRECTORY.getName());
- assertEquals("EBDT", TTFTableName.EBDT.getName());
- assertEquals("EBLC", TTFTableName.EBLC.getName());
- assertEquals("EBSC", TTFTableName.EBSC.getName());
- assertEquals("FFTM", TTFTableName.FFTM.getName());
- assertEquals("GDEF", TTFTableName.GDEF.getName());
- assertEquals("GPOS", TTFTableName.GPOS.getName());
- assertEquals("GSUB", TTFTableName.GSUB.getName());
- assertEquals("LTSH", TTFTableName.LTSH.getName());
- assertEquals("OS/2", TTFTableName.OS2.getName());
- assertEquals("PCLT", TTFTableName.PCLT.getName());
- assertEquals("VDMX", TTFTableName.VDMX.getName());
- assertEquals("cmap", TTFTableName.CMAP.getName());
- assertEquals("cvt ", TTFTableName.CVT.getName());
- assertEquals("fpgm", TTFTableName.FPGM.getName());
- assertEquals("gasp", TTFTableName.GASP.getName());
- assertEquals("glyf", TTFTableName.GLYF.getName());
- assertEquals("hdmx", TTFTableName.HDMX.getName());
- assertEquals("head", TTFTableName.HEAD.getName());
- assertEquals("hhea", TTFTableName.HHEA.getName());
- assertEquals("hmtx", TTFTableName.HMTX.getName());
- assertEquals("kern", TTFTableName.KERN.getName());
- assertEquals("loca", TTFTableName.LOCA.getName());
- assertEquals("maxp", TTFTableName.MAXP.getName());
- assertEquals("name", TTFTableName.NAME.getName());
- assertEquals("post", TTFTableName.POST.getName());
- assertEquals("prep", TTFTableName.PREP.getName());
- assertEquals("vhea", TTFTableName.VHEA.getName());
- assertEquals("vmtx", TTFTableName.VMTX.getName());
- // make sure it works with other table names
- TTFTableName test = TTFTableName.getValue("test");
- assertEquals("test", test.getName());
- }
-
- /**
- * Test getValue(String) - tests that the getValue(String) method returns the expected
- * TTFTableNames value when it is given a String (name of a table).
- * @exception IllegalAccessException error
- */
- @Test
- public void testGetValue() throws IllegalAccessException {
- assertEquals(TTFTableName.EBDT, TTFTableName.getValue("EBDT"));
- assertEquals(TTFTableName.EBLC, TTFTableName.getValue("EBLC"));
- assertEquals(TTFTableName.EBSC, TTFTableName.getValue("EBSC"));
- assertEquals(TTFTableName.FFTM, TTFTableName.getValue("FFTM"));
- assertEquals(TTFTableName.LTSH, TTFTableName.getValue("LTSH"));
- assertEquals(TTFTableName.OS2, TTFTableName.getValue("OS/2"));
- assertEquals(TTFTableName.PCLT, TTFTableName.getValue("PCLT"));
- assertEquals(TTFTableName.VDMX, TTFTableName.getValue("VDMX"));
- assertEquals(TTFTableName.CMAP, TTFTableName.getValue("cmap"));
- assertEquals(TTFTableName.CVT, TTFTableName.getValue("cvt "));
- assertEquals(TTFTableName.FPGM, TTFTableName.getValue("fpgm"));
- assertEquals(TTFTableName.GASP, TTFTableName.getValue("gasp"));
- assertEquals(TTFTableName.GLYF, TTFTableName.getValue("glyf"));
- assertEquals(TTFTableName.HDMX, TTFTableName.getValue("hdmx"));
- assertEquals(TTFTableName.HEAD, TTFTableName.getValue("head"));
- assertEquals(TTFTableName.HHEA, TTFTableName.getValue("hhea"));
- assertEquals(TTFTableName.HMTX, TTFTableName.getValue("hmtx"));
- assertEquals(TTFTableName.KERN, TTFTableName.getValue("kern"));
- assertEquals(TTFTableName.LOCA, TTFTableName.getValue("loca"));
- assertEquals(TTFTableName.MAXP, TTFTableName.getValue("maxp"));
- assertEquals(TTFTableName.NAME, TTFTableName.getValue("name"));
- assertEquals(TTFTableName.POST, TTFTableName.getValue("post"));
- assertEquals(TTFTableName.PREP, TTFTableName.getValue("prep"));
- assertEquals(TTFTableName.VHEA, TTFTableName.getValue("vhea"));
- assertEquals(TTFTableName.VMTX, TTFTableName.getValue("vmtx"));
- // Test that we can store a random table name and it will not fail or throw an error.
- TTFTableName test = TTFTableName.getValue("random");
- assertTrue(test instanceof TTFTableName);
- }
-
- /**
- * This class overrides hashCode() - we need to ensure it works properly by instantiating two
- * objects and comparing their hash-codes.
- * @exception IllegalAccessException error
- */
- @Test
- public void testHashCode() throws IllegalAccessException {
- TTFTableName a = TTFTableName.getValue("testObject");
- TTFTableName b = TTFTableName.getValue("testObject");
- assertTrue(a.hashCode() == b.hashCode());
- TTFTableName c = TTFTableName.getValue("fail");
- assertFalse(a.hashCode() == c.hashCode());
- }
-
- /**
- * This class overrides equals(object) - we need to test:
- * 1) Reflexivity
- * 2) Symmetry
- * 3) Transitivity
- * 4) Consistency
- * 5) check it fails if you put in a null value
- * @throws IllegalAccessException error
- */
- @Test
- public void testEquals() throws IllegalAccessException {
- // Reflexivity
- TTFTableName a = TTFTableName.getValue("test");
- assertTrue(a.equals(a));
- // Symmetry
- TTFTableName b = TTFTableName.getValue("test");
- assertTrue(a.equals(b));
- assertTrue(b.equals(a));
- // Transitivity (tested with symmetry)
- // Consistency (test that a == b is true and that a == c fails)
- TTFTableName c = TTFTableName.getValue("fail");
- for (int i = 0; i < 100; i++) {
- assertTrue(a.equals(b));
- assertFalse(a.equals(c));
- }
- // check with null value
- assertFalse(a.equals(null));
- }
-}
diff --git a/test/java/org/apache/fop/render/RawPNGTestUtil.java b/test/java/org/apache/fop/render/RawPNGTestUtil.java
deleted file mode 100644
index e6660bb42..000000000
--- a/test/java/org/apache/fop/render/RawPNGTestUtil.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.zip.Deflater;
-import java.util.zip.DeflaterOutputStream;
-
-import org.apache.xmlgraphics.image.loader.ImageSize;
-
-public final class RawPNGTestUtil {
-
- private static int NUM_ROWS = 32;
- private static int NUM_COLUMNS = 32;
- private static int DPI = 72;
-
- private RawPNGTestUtil() {
-
- }
-
- /**
- * Builds a PNG IDAT section for a square of a given color and alpha; the filter is fixed.
- * @param gray the gray color; set to -1 if using RGB
- * @param red the red color; ignored if gray > -1
- * @param green the green color; ignored if gray > -1
- * @param blue the blue color; ignored if gray > -1
- * @param alpha the alpha color; set to -1 if not present
- * @return the PNG IDAT byte array
- * @throws IOException
- */
- public static byte[] buildGRGBAData(int gray, int red, int green, int blue, int alpha) throws IOException {
- // build an image, 32x32, Gray or RGB, with or without alpha, and with filter
- int filter = 0;
- int numRows = NUM_ROWS;
- int numColumns = NUM_COLUMNS;
- int numComponents = (gray > -1 ? 1 : 3) + (alpha > -1 ? 1 : 0);
- int numBytesPerRow = numColumns * numComponents + 1; // 1 for filter
- int numBytes = numRows * numBytesPerRow;
- byte[] data = new byte[numBytes];
- for (int r = 0; r < numRows; r++) {
- data[r * numBytesPerRow] = (byte) filter;
- for (int c = 0; c < numColumns; c++) {
- if (numComponents == 1) {
- data[r * numBytesPerRow + numComponents * c + 1] = (byte) gray;
- } else if (numComponents == 2) {
- data[r * numBytesPerRow + numComponents * c + 1] = (byte) gray;
- data[r * numBytesPerRow + numComponents * c + 2] = (byte) alpha;
- } else if (numComponents == 3) {
- data[r * numBytesPerRow + numComponents * c + 1] = (byte) red;
- data[r * numBytesPerRow + numComponents * c + 2] = (byte) green;
- data[r * numBytesPerRow + numComponents * c + 3] = (byte) blue;
- } else if (numComponents == 4) {
- data[r * numBytesPerRow + numComponents * c + 1] = (byte) red;
- data[r * numBytesPerRow + numComponents * c + 2] = (byte) green;
- data[r * numBytesPerRow + numComponents * c + 3] = (byte) blue;
- data[r * numBytesPerRow + numComponents * c + 4] = (byte) alpha;
- }
- }
- }
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- DeflaterOutputStream dos = new DeflaterOutputStream(baos, new Deflater());
- dos.write(data);
- dos.close();
- return baos.toByteArray();
- }
-
- /**
- *
- * @return a default ImageSize
- */
- public static ImageSize getImageSize() {
- return new ImageSize(NUM_ROWS, NUM_COLUMNS, DPI);
- }
-}
diff --git a/test/java/org/apache/fop/render/pdf/ImageRawPNGAdapterTestCase.java b/test/java/org/apache/fop/render/pdf/ImageRawPNGAdapterTestCase.java
deleted file mode 100644
index 885821f66..000000000
--- a/test/java/org/apache/fop/render/pdf/ImageRawPNGAdapterTestCase.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * 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.pdf;
-
-import java.awt.image.ComponentColorModel;
-import java.awt.image.IndexColorModel;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.zip.Deflater;
-import java.util.zip.DeflaterOutputStream;
-
-import org.junit.Test;
-
-import org.apache.xmlgraphics.image.loader.ImageSize;
-import org.apache.xmlgraphics.image.loader.impl.ImageRawPNG;
-
-import org.apache.fop.pdf.FlateFilter;
-import org.apache.fop.pdf.PDFAMode;
-import org.apache.fop.pdf.PDFDocument;
-import org.apache.fop.pdf.PDFProfile;
-import org.apache.fop.render.RawPNGTestUtil;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-public class ImageRawPNGAdapterTestCase {
-
- @Test
- public void testSetupWithIndexColorModel() {
- IndexColorModel cm = mock(IndexColorModel.class);
- ImageRawPNG irpng = mock(ImageRawPNG.class);
- PDFDocument doc = mock(PDFDocument.class);
- PDFProfile profile = mock(PDFProfile.class);
- ImageRawPNGAdapter irpnga = new ImageRawPNGAdapter(irpng, "mock");
- ImageSize is = RawPNGTestUtil.getImageSize();
-
- when(irpng.getColorModel()).thenReturn(cm);
- // when(cm.hasAlpha()).thenReturn(false);
- when(doc.getProfile()).thenReturn(profile);
- when(profile.getPDFAMode()).thenReturn(PDFAMode.PDFA_1A);
- when(irpng.getSize()).thenReturn(is);
- irpnga.setup(doc);
- FlateFilter filter = (FlateFilter) irpnga.getPDFFilter();
- assertEquals(1, filter.getColors());
- }
-
- @Test
- public void testSetupWithComponentColorModel() throws IOException {
- ComponentColorModel cm = mock(ComponentColorModel.class);
- ImageRawPNG irpng = mock(ImageRawPNG.class);
- PDFDocument doc = mock(PDFDocument.class);
- PDFProfile profile = mock(PDFProfile.class);
- ImageRawPNGAdapter irpnga = new ImageRawPNGAdapter(irpng, "mock");
- ImageSize is = RawPNGTestUtil.getImageSize();
-
- when(irpng.getColorModel()).thenReturn(cm);
- when(cm.getNumComponents()).thenReturn(3);
- // when(cm.hasAlpha()).thenReturn(false);
- when(doc.getProfile()).thenReturn(profile);
- when(profile.getPDFAMode()).thenReturn(PDFAMode.PDFA_1A);
- when(irpng.getSize()).thenReturn(is);
- irpnga.setup(doc);
- FlateFilter filter = (FlateFilter) irpnga.getPDFFilter();
- assertEquals(3, filter.getColors());
- }
-
- @Test
- public void testOutputContentsWithRGBPNG() throws IOException {
- testOutputContentsWithGRGBAPNG(-1, 128, 128, 128, -1);
- }
-
- @Test
- public void testOutputContentsWithRGBAPNG() throws IOException {
- testOutputContentsWithGRGBAPNG(-1, 128, 128, 128, 128);
- }
-
- @Test
- public void testOutputContentsWithGPNG() throws IOException {
- testOutputContentsWithGRGBAPNG(128, -1, -1, -1, -1);
- }
-
- @Test
- public void testOutputContentsWithGAPNG() throws IOException {
- testOutputContentsWithGRGBAPNG(128, -1, -1, -1, 128);
- }
-
- private void testOutputContentsWithGRGBAPNG(int gray, int red, int green, int blue, int alpha)
- throws IOException {
- int numColorComponents = gray > -1 ? 1 : 3;
- int numComponents = numColorComponents + (alpha > -1 ? 1 : 0);
- ComponentColorModel cm = mock(ComponentColorModel.class);
- ImageRawPNG irpng = mock(ImageRawPNG.class);
- PDFDocument doc = mock(PDFDocument.class);
- PDFProfile profile = mock(PDFProfile.class);
- ImageRawPNGAdapter irpnga = new ImageRawPNGAdapter(irpng, "mock");
- ImageSize is = RawPNGTestUtil.getImageSize();
-
- when(irpng.getColorModel()).thenReturn(cm);
- when(cm.getNumComponents()).thenReturn(numComponents);
- // when(cm.hasAlpha()).thenReturn(false);
- when(doc.getProfile()).thenReturn(profile);
- when(profile.getPDFAMode()).thenReturn(PDFAMode.PDFA_1A);
- when(irpng.getSize()).thenReturn(is);
- irpnga.setup(doc);
- FlateFilter filter = (FlateFilter) irpnga.getPDFFilter();
- assertEquals(numColorComponents, filter.getColors());
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- byte[] data = RawPNGTestUtil.buildGRGBAData(gray, red, green, blue, alpha);
- ByteArrayInputStream bais = new ByteArrayInputStream(data);
- when(irpng.createInputStream()).thenReturn(bais);
- irpnga.outputContents(baos);
- if (alpha > -1) {
- byte[] expected = RawPNGTestUtil.buildGRGBAData(gray, red, green, blue, -1);
- assertArrayEquals(expected, baos.toByteArray());
- } else {
- assertArrayEquals(data, baos.toByteArray());
- }
- }
-
-}
diff --git a/test/java/org/apache/fop/render/ps/ImageEncoderPNGTestCase.java b/test/java/org/apache/fop/render/ps/ImageEncoderPNGTestCase.java
deleted file mode 100644
index 458033dad..000000000
--- a/test/java/org/apache/fop/render/ps/ImageEncoderPNGTestCase.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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;
-
-import java.awt.image.ComponentColorModel;
-import java.awt.image.IndexColorModel;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-import org.junit.Test;
-
-import org.apache.xmlgraphics.image.loader.ImageSize;
-import org.apache.xmlgraphics.image.loader.impl.ImageRawPNG;
-
-import org.apache.fop.render.RawPNGTestUtil;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-public class ImageEncoderPNGTestCase {
-
- @Test
- public void testWriteToWithRGBPNG() throws IOException {
- testWriteToWithGRGBAPNG(-1, 128, 128, 128, -1);
- }
-
- @Test
- public void testWriteToWithGPNG() throws IOException {
- testWriteToWithGRGBAPNG(128, -1, -1, -1, -1);
- }
-
- @Test
- public void testWriteToWithRGBAPNG() throws IOException {
- testWriteToWithGRGBAPNG(-1, 128, 128, 128, 128);
- }
-
- @Test
- public void testWriteToWithGAPNG() throws IOException {
- testWriteToWithGRGBAPNG(128, -1, -1, -1, 128);
- }
-
- private void testWriteToWithGRGBAPNG(int gray, int red, int green, int blue, int alpha)
- throws IOException {
- int numComponents = (gray > -1 ? 1 : 3) + (alpha > -1 ? 1 : 0);
- ImageSize is = RawPNGTestUtil.getImageSize();
- ComponentColorModel cm = mock(ComponentColorModel.class);
- when(cm.getNumComponents()).thenReturn(numComponents);
- ImageRawPNG irpng = mock(ImageRawPNG.class);
- when(irpng.getColorModel()).thenReturn(cm);
- when(irpng.getSize()).thenReturn(is);
- ImageEncoderPNG iepng = new ImageEncoderPNG(irpng);
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- byte[] data = RawPNGTestUtil.buildGRGBAData(gray, red, green, blue, alpha);
- ByteArrayInputStream bais = new ByteArrayInputStream(data);
- when(irpng.createInputStream()).thenReturn(bais);
- iepng.writeTo(baos);
- if (alpha > -1) {
- byte[] expected = RawPNGTestUtil.buildGRGBAData(gray, red, green, blue, -1);
- assertArrayEquals(expected, baos.toByteArray());
- } else {
- assertArrayEquals(data, baos.toByteArray());
- }
- }
-
- @Test
- public void testWriteToWithPalettePNG() throws IOException {
- ImageSize is = RawPNGTestUtil.getImageSize();
- IndexColorModel cm = mock(IndexColorModel.class);
- ImageRawPNG irpng = mock(ImageRawPNG.class);
- when(irpng.getColorModel()).thenReturn(cm);
- when(irpng.getSize()).thenReturn(is);
- ImageEncoderPNG iepng = new ImageEncoderPNG(irpng);
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- byte[] data = RawPNGTestUtil.buildGRGBAData(128, -1, -1, -1, -1);
- ByteArrayInputStream bais = new ByteArrayInputStream(data);
- when(irpng.createInputStream()).thenReturn(bais);
- iepng.writeTo(baos);
- assertArrayEquals(data, baos.toByteArray());
- }
-
- @Test
- public void testGetImplicitFilterWithIndexColorModel() {
- ImageSize is = RawPNGTestUtil.getImageSize();
- IndexColorModel cm = mock(IndexColorModel.class);
- ImageRawPNG irpng = mock(ImageRawPNG.class);
- when(irpng.getColorModel()).thenReturn(cm);
- when(irpng.getBitDepth()).thenReturn(8);
- when(irpng.getSize()).thenReturn(is);
- ImageEncoderPNG iepng = new ImageEncoderPNG(irpng);
-
- String expectedFilter = "<< /Predictor 15 /Columns 32 /Colors 1 /BitsPerComponent 8 >> /FlateDecode";
- assertEquals(expectedFilter, iepng.getImplicitFilter());
- }
-
- @Test
- public void testGetImplicitFilterWithComponentColorModel() {
- ImageSize is = RawPNGTestUtil.getImageSize();
- ComponentColorModel cm = mock(ComponentColorModel.class);
- when(cm.getNumComponents()).thenReturn(3);
- ImageRawPNG irpng = mock(ImageRawPNG.class);
- when(irpng.getColorModel()).thenReturn(cm);
- when(irpng.getBitDepth()).thenReturn(8);
- when(irpng.getSize()).thenReturn(is);
- ImageEncoderPNG iepng = new ImageEncoderPNG(irpng);
-
- String expectedFilter = "<< /Predictor 15 /Columns 32 /Colors 3 /BitsPerComponent 8 >> /FlateDecode";
- assertEquals(expectedFilter, iepng.getImplicitFilter());
- }
-
-}
diff --git a/test/java/org/apache/fop/render/ps/PSRenderingUtilTestCase.java b/test/java/org/apache/fop/render/ps/PSRenderingUtilTestCase.java
deleted file mode 100644
index 3f1088fe1..000000000
--- a/test/java/org/apache/fop/render/ps/PSRenderingUtilTestCase.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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;
-
-import java.io.IOException;
-
-import org.junit.Test;
-
-import org.apache.xmlgraphics.ps.PSGenerator;
-
-import org.apache.fop.render.ps.extensions.PSPageTrailerCodeBefore;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
-public class PSRenderingUtilTestCase {
-
- private final String content = "<< /MyEntry 0 >> command";
- private final PSPageTrailerCodeBefore ptcb = new PSPageTrailerCodeBefore(content);
- private final PSGenerator gen = mock(PSGenerator.class);
-
- @Test
- public void testWriteEnclosedExtensionAttachment() throws IOException {
- PSRenderingUtil.writeEnclosedExtensionAttachment(gen, ptcb);
- verify(gen).writeln(content);
- }
-
-}
diff --git a/test/java/org/apache/fop/render/ps/RenderPSTestSuite.java b/test/java/org/apache/fop/render/ps/RenderPSTestSuite.java
deleted file mode 100644
index 2e15bf91f..000000000
--- a/test/java/org/apache/fop/render/ps/RenderPSTestSuite.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-import org.apache.fop.render.ps.fonts.PSTTFGeneratorTestCase;
-import org.apache.fop.render.ps.fonts.PSTTFGlyphOutputStreamTestCase;
-import org.apache.fop.render.ps.fonts.PSTTFOutputStreamTestCase;
-import org.apache.fop.render.ps.fonts.PSTTFTableOutputStreamTestCase;
-
-
-/**
- * A test Suite for org.apache.fop.render.ps.*
- */
-@RunWith(Suite.class)
-@SuiteClasses({
- PSTTFGeneratorTestCase.class,
- PSTTFOutputStreamTestCase.class,
- PSTTFGlyphOutputStreamTestCase.class,
- PSTTFTableOutputStreamTestCase.class
-})
-public final class RenderPSTestSuite {
-}
diff --git a/test/java/org/apache/fop/render/ps/fonts/PSTTFGeneratorTestCase.java b/test/java/org/apache/fop/render/ps/fonts/PSTTFGeneratorTestCase.java
deleted file mode 100644
index f7f311ff8..000000000
--- a/test/java/org/apache/fop/render/ps/fonts/PSTTFGeneratorTestCase.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * 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.fonts;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.apache.xmlgraphics.ps.PSGenerator;
-
-/**
- * The test class for org.apache.fop.render.ps.fonts.PSGenerator
- */
-public class PSTTFGeneratorTestCase {
- private PSTTFGenerator ttfGen;
- private ByteArrayOutputStream out = new ByteArrayOutputStream();
- private PSGenerator gen = new PSGenerator(out);
- private byte[] byteArray;
-
- /**
- * Constructor
- */
- public PSTTFGeneratorTestCase() {
- byteArray = new byte[65536];
- for (int i = 0; i < 65536; i++) {
- byteArray[i] = (byte) i;
- }
- }
-
- @Before
- public void setUp() {
- ttfGen = new PSTTFGenerator(gen);
- }
-
- /**
- * Tests startString() - starts the string in an appropriate way for a PostScript file.
- * @exception IOException write error
- */
- @Test
- public void testStartString() throws IOException {
- ttfGen.startString();
- assertEquals("<\n", out.toString());
- }
-
- /**
- * Test streamBytes() - tests that strings are written to file in the proper format.
- * @throws IOException write error.
- */
- @Test
- public void testStreamBytes() throws IOException {
- ttfGen.streamBytes(byteArray, 0, 16);
- assertEquals("000102030405060708090A0B0C0D0E0F", out.toString());
- /*
- * 65520 is the closes multiple of 80 to 65535 (max string size in PS document) and since
- * one byte takes up two characters, 65520 / 2 - 16 (16 bytes already written)= 32744.
- */
- ttfGen.streamBytes(byteArray, 0, 32744);
- // Using a regex to ensure that the format is correct
- assertTrue(out.toString().matches("([0-9A-F]{80}\n){819}"));
- try {
- ttfGen.streamBytes(byteArray, 0, PSTTFGenerator.MAX_BUFFER_SIZE + 1);
- fail("Shouldn't be able to write more than MAX_BUFFER_SIZE to a PS document");
- } catch (UnsupportedOperationException e) {
- // PASS
- }
- }
-
- /**
- * Test reset() - reset should reset the line counter such that when reset() is invoked the
- * following string streamed to the PS document should be 80 chars long.
- * @throws IOException file write error.
- */
- @Test
- public void testReset() throws IOException {
- ttfGen.streamBytes(byteArray, 0, 40);
- assertTrue(out.toString().matches("([0-9A-F]{80}\n)"));
- ttfGen.streamBytes(byteArray, 0, 40);
- assertTrue(out.toString().matches("([0-9A-F]{80}\n){2}"));
-
- }
-
- /**
- * Test endString() - ensures strings are ended in the PostScript document in the correct
- * format, a "00" needs to be appended to the end of a string.
- * @throws IOException file write error
- */
- @Test
- public void testEndString() throws IOException {
- ttfGen.endString();
- assertEquals("00\n> ", out.toString());
- out.reset();
- // we need to check that this doesn't write more than 80 chars per line
- ttfGen.streamBytes(byteArray, 0, 40);
- ttfGen.endString();
- assertTrue(out.toString().matches("([0-9A-F]{80}\n)00\n> "));
- }
-}
diff --git a/test/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStreamTestCase.java b/test/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStreamTestCase.java
deleted file mode 100644
index 82b4364c3..000000000
--- a/test/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStreamTestCase.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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.fonts;
-
-import java.io.IOException;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InOrder;
-
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.inOrder;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
-/**
- * Test class for PSTTFGlyphOutputStream
- */
-public class PSTTFGlyphOutputStreamTestCase {
- private PSTTFGenerator mockGen;
- private PSTTFGlyphOutputStream glyphOut;
-
- @Before
- public void setUp() {
- mockGen = mock(PSTTFGenerator.class);
- glyphOut = new PSTTFGlyphOutputStream(mockGen);
- }
-
- /**
- * Test startGlyphStream() - test that startGlyphStream() invokes reset() and startString() in
- * PSTTFGenerator.
- * @exception IOException file write error
- */
- @Test
- public void testStartGlyphStream() throws IOException {
- glyphOut.startGlyphStream();
- verify(mockGen).startString();
- }
-
- /**
- * Test streamGlyph(byte[],int,int) - tests several paths:
- * 1) strings are properly appended
- * 2) when total strings size > PSTTFGenerator.MAX_BUFFER_SIZE, the strings is closed and a new
- * strings is started.
- * 3) if a glyph of size > PSTTFGenerator.MAX_BUFFER_SIZE is attempted, an exception is thrown.
- * @throws IOException file write error.
- */
- @Test
- public void testStreamGlyph() throws IOException {
- int byteArraySize = 10;
- byte[] byteArray = new byte[byteArraySize];
- int runs = 100;
- for (int i = 0; i < runs; i++) {
- glyphOut.streamGlyph(byteArray, 0, byteArraySize);
- }
- verify(mockGen, times(runs)).streamBytes(byteArray, 0, byteArraySize);
-
- /*
- * We want to run this for MAX_BUFFER_SIZE / byteArraySize so that go over the string
- * boundary and enforce the ending and starting of a new string. Using mockito to ensure
- * that this behaviour is performed in order (since this is an integral behavioural aspect)
- */
- int stringLimit = PSTTFGenerator.MAX_BUFFER_SIZE / byteArraySize;
- for (int i = 0; i < stringLimit; i++) {
- glyphOut.streamGlyph(byteArray, 0, byteArraySize);
- }
- InOrder inOrder = inOrder(mockGen);
- inOrder.verify(mockGen, times(stringLimit)).streamBytes(byteArray, 0, byteArraySize);
- inOrder.verify(mockGen).endString();
- inOrder.verify(mockGen).startString();
- inOrder.verify(mockGen, times(runs)).streamBytes(byteArray, 0, byteArraySize);
-
- try {
- glyphOut.streamGlyph(byteArray, 0, PSTTFGenerator.MAX_BUFFER_SIZE + 1);
- fail("Shouldn't allow a length > PSTTFGenerator.MAX_BUFFER_SIZE");
- } catch (UnsupportedOperationException e) {
- // PASS
- }
- }
-
- /**
- * Test endGlyphStream() - tests that PSTTFGenerator.endString() is invoked when this method
- * is called.
- * @throws IOException file write exception
- */
- @Test
- public void testEndGlyphStream() throws IOException {
- glyphOut.endGlyphStream();
- verify(mockGen).endString();
- }
-}
diff --git a/test/java/org/apache/fop/render/ps/fonts/PSTTFOutputStreamTestCase.java b/test/java/org/apache/fop/render/ps/fonts/PSTTFOutputStreamTestCase.java
deleted file mode 100644
index 744f17f64..000000000
--- a/test/java/org/apache/fop/render/ps/fonts/PSTTFOutputStreamTestCase.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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.fonts;
-
-import java.io.IOException;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
-import org.apache.xmlgraphics.ps.PSGenerator;
-
-import org.apache.fop.fonts.truetype.TTFGlyphOutputStream;
-import org.apache.fop.fonts.truetype.TTFTableOutputStream;
-
-/**
- * Tests PSTTFOuputStream
- */
-public class PSTTFOutputStreamTestCase {
- private PSGenerator gen;
- private PSTTFOutputStream out;
-
- /**
- * Assigns an OutputStream to the PSGenerator.
- */
- @Before
- public void setUp() {
- gen = mock(PSGenerator.class);
- out = new PSTTFOutputStream(gen);
- }
-
- /**
- * Test startFontStream() - Just tests that the font is properly initiated in the PostScript
- * document (in this case with "/sfnts[")
- * @throws IOException write exception.
- */
- @Test
- public void testStartFontStream() throws IOException {
- out.startFontStream();
- verify(gen).write("/sfnts[");
- }
-
- /**
- * Test getTableOutputStream() - we need to test that the inheritance model is properly obeyed.
- */
- @Test
- public void testGetTableOutputStream() {
- TTFTableOutputStream tableOut = out.getTableOutputStream();
- assertTrue(tableOut instanceof PSTTFTableOutputStream);
- }
-
- /**
- * Test getGlyphOutputStream() - we need to test that the inheritance model is properly obeyed.
- */
- @Test
- public void testGetGlyphOutputStream() {
- TTFGlyphOutputStream glyphOut = out.getGlyphOutputStream();
- assertTrue(glyphOut instanceof PSTTFGlyphOutputStream);
- }
-
- /**
- * Test endFontStream()
- * @exception IOException write error.
- */
- @Test
- public void testEndFontStream() throws IOException {
- out.endFontStream();
- verify(gen).writeln("] def");
- }
-}
diff --git a/test/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStreamTestCase.java b/test/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStreamTestCase.java
deleted file mode 100644
index c20c3d8b1..000000000
--- a/test/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStreamTestCase.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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.fonts;
-
-import java.io.IOException;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InOrder;
-
-import static org.mockito.Mockito.inOrder;
-import static org.mockito.Mockito.mock;
-
-/**
- * Test class for unit testing PSTTFTableOutputStream
- */
-public class PSTTFTableOutputStreamTestCase {
- private PSTTFGenerator mockGen;
- private PSTTFTableOutputStream tableOut;
-
- @Before
- public void setUp() {
- mockGen = mock(PSTTFGenerator.class);
- tableOut = new PSTTFTableOutputStream(mockGen);
- }
-
- /**
- * Test streamTable() - several paths to test (2. and 3. test corner cases):
- * 1) that a table of length < PSTTFGenerator.MAX_BUFFER_SIZE invokes the correct methods in
- * PSTTFGenerator.
- * 2) that a table of length > PSTTFGenerator.MAX_BUFFER_SIZE and
- * length == n * PSTTFGenerator.MAX_BUFFER_SIZE is split up and the methods in PSTTFGenerator
- * are invoked.
- * 3) that a table of length > PSTTFGenerator.MAX_BUFFER_SIZE but
- * length != n * PSTTFGenerator.MAX_BUFFER_SIZE is split up and the methods in PSTTFGenerator
- * are invoked.
- * @throws IOException file write error.
- */
- @Test
- public void testStreamTable() throws IOException {
- byte[] byteArray = new byte[PSTTFGenerator.MAX_BUFFER_SIZE * 3];
- tableOut.streamTable(byteArray, 0, 10);
- InOrder inOrder = inOrder(mockGen);
- inOrder.verify(mockGen).startString();
- inOrder.verify(mockGen).streamBytes(byteArray, 0, 10);
- inOrder.verify(mockGen).endString();
-
- setUp(); // reset all all the method calls
- /* We're going to run this 3 times to ensure the proper method calls are invoked and all
- * the bytes are streamed */
- tableOut.streamTable(byteArray, 0, byteArray.length);
- inOrder = inOrder(mockGen);
- for (int i = 0; i < 3; i++) {
- int offset = PSTTFGenerator.MAX_BUFFER_SIZE * i;
- inOrder.verify(mockGen).startString();
- inOrder.verify(mockGen).streamBytes(byteArray, offset, PSTTFGenerator.MAX_BUFFER_SIZE);
- inOrder.verify(mockGen).endString();
- }
-
- setUp(); // reset all the method calls
- tableOut.streamTable(byteArray, 0, PSTTFGenerator.MAX_BUFFER_SIZE + 1);
- inOrder = inOrder(mockGen);
- inOrder.verify(mockGen).startString();
- inOrder.verify(mockGen).streamBytes(byteArray, 0, PSTTFGenerator.MAX_BUFFER_SIZE);
- inOrder.verify(mockGen).endString();
- inOrder.verify(mockGen).startString();
- inOrder.verify(mockGen).streamBytes(byteArray, PSTTFGenerator.MAX_BUFFER_SIZE, 1);
- inOrder.verify(mockGen).endString();
- }
-}
diff --git a/test/java/org/apache/fop/svg/PDFGraphics2DTestCase.java b/test/java/org/apache/fop/svg/PDFGraphics2DTestCase.java
deleted file mode 100644
index 3f610c56f..000000000
--- a/test/java/org/apache/fop/svg/PDFGraphics2DTestCase.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.svg;
-
-import java.awt.BasicStroke;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertTrue;
-
-public class PDFGraphics2DTestCase {
-
- @Test
- public void testApplyStrokeNullDash() {
- PDFGraphics2D g2d = new PDFGraphics2D(false);
- BasicStroke stroke = new BasicStroke();
- g2d.applyStroke(stroke);
- assertTrue(g2d.getString().contains("[] 0 d\n"));
- }
-
- @Test
- public void testApplyStrokeNonNullDash() {
- PDFGraphics2D g2d = new PDFGraphics2D(false);
- float[] dashArray = {3.0f, 5.0f};
- BasicStroke stroke = new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER, 10.0f,
- dashArray, 0.0f);
- g2d.applyStroke(stroke);
- assertTrue(g2d.getString().contains("[3 5] 0 d\n"));
- }
-
-}
diff --git a/test/java/org/apache/fop/util/HexEncoderTestCase.java b/test/java/org/apache/fop/util/HexEncoderTestCase.java
deleted file mode 100644
index cb366abdf..000000000
--- a/test/java/org/apache/fop/util/HexEncoderTestCase.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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.util;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * Test case for the conversion of characters into hex-encoded strings.
- */
-public class HexEncoderTestCase {
-
- /**
- * Tests that characters are properly encoded into hex strings.
- */
- @Test
- public void testEncodeChar() {
- char[] digits = new char[] {'0', '0', '0', '0'};
- for (int c = 0; c <= 0xFFFF; c++) {
- assertEquals(new String(digits), HexEncoder.encode((char) c));
- increment(digits);
- }
- }
-
- private static void increment(char[] digits) {
- int d = 4;
- do {
- d--;
- digits[d] = successor(digits[d]);
- } while (digits[d] == '0' && d > 0);
- }
-
- private static char successor(char d) {
- if (d == '9') {
- return 'A';
- } else if (d == 'F') {
- return '0';
- } else {
- return (char) (d + 1);
- }
- }
-
-}
diff --git a/test/layoutengine/standard-testcases/bidi_propagation_1.xml b/test/layoutengine/standard-testcases/bidi_propagation_1.xml
index 587bc6d2f..947d9dac5 100644
--- a/test/layoutengine/standard-testcases/bidi_propagation_1.xml
+++ b/test/layoutengine/standard-testcases/bidi_propagation_1.xml
@@ -66,7 +66,7 @@
<fo:table-cell margin-left="0" text-align="right">
<fo:block>
<fo:inline>
- <fo:inline><fo:bidi-override unicode-bidi="bidi-override" direction="rtl">XY</fo:bidi-override></fo:inline>
+ <fo:inline><fo:bidi-override unicode-bidi="bidi-override" direction="rtl">X</fo:bidi-override></fo:inline>
</fo:inline>
</fo:block>
</fo:table-cell>
@@ -93,7 +93,7 @@
<fo:table-cell margin-left="0" text-align="right">
<fo:block>
<fo:inline>
- <fo:inline><fo:bidi-override unicode-bidi="bidi-override" direction="rtl">XY</fo:bidi-override></fo:inline>
+ <fo:inline><fo:bidi-override unicode-bidi="bidi-override" direction="rtl">X</fo:bidi-override></fo:inline>
</fo:inline>
</fo:block>
</fo:table-cell>
diff --git a/test/layoutengine/standard-testcases/character_writing-mode_rl.xml b/test/layoutengine/standard-testcases/character_writing-mode_rl.xml
index db65238c0..adc126ec8 100644
--- a/test/layoutengine/standard-testcases/character_writing-mode_rl.xml
+++ b/test/layoutengine/standard-testcases/character_writing-mode_rl.xml
@@ -59,18 +59,18 @@
<eval expected="6672" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/@ipd"/>
<eval expected="4" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/word[1]"/>
<eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/word[1]/@level"/>
- <eval expected="" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/word[1]/@reversed"/>
+ <true xpath="boolean(//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/word[1]/@reversed)"/>
<eval expected="6672" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[2]/@ipd"/>
<eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[2]/word[1]"/>
- <eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[2]/word[1]/@level"/>
- <eval expected="" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[2]/word[1]/@reversed"/>
+ <eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/word[1]/@level"/>
+ <true xpath="boolean(//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/word[1]/@reversed)"/>
<eval expected="6672" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[3]/@ipd"/>
<eval expected="2" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[3]/word[1]"/>
<eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[3]/word[1]/@level"/>
- <eval expected="" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[3]/word[1]/@reversed"/>
+ <true xpath="boolean(//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[3]/word[1]/@reversed)"/>
<eval expected="6672" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[4]/@ipd"/>
<eval expected="1" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[4]/word[1]"/>
<eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[4]/word[1]/@level"/>
- <eval expected="" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[4]/word[1]/@reversed"/>
+ <true xpath="boolean(//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[4]/word[1]/@reversed)"/>
</checks>
</testcase>
diff --git a/test/pdf/accessibility/pdf/role.pdf b/test/pdf/accessibility/pdf/role.pdf
index 4dfb686c9..38fcf1bde 100644
--- a/test/pdf/accessibility/pdf/role.pdf
+++ b/test/pdf/accessibility/pdf/role.pdf
Binary files differ
diff --git a/test/pdf/accessibility/role.fo b/test/pdf/accessibility/role.fo
index b94c6ab67..885638592 100644
--- a/test/pdf/accessibility/role.fo
+++ b/test/pdf/accessibility/role.fo
@@ -24,8 +24,8 @@
<fo:region-after extent="10pt"/>
</fo:simple-page-master>
</fo:layout-master-set>
- <fo:page-sequence master-reference="page" language="en" country="GB" role="Art">
- <fo:static-content flow-name="xsl-region-after" role="artifact" font-size="8pt">
+ <fo:page-sequence master-reference="page" role="Art">
+ <fo:static-content flow-name="xsl-region-after" role="NonStruct" font-size="8pt">
<fo:block text-align="center"><fo:page-number/></fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body" role="NonStruct" hyphenate="true"
diff --git a/test/resources/fonts/ttf/DroidSansMono.LICENSE b/test/resources/fonts/ttf/DroidSansMono.LICENSE
deleted file mode 100644
index 1a96dfde6..000000000
--- a/test/resources/fonts/ttf/DroidSansMono.LICENSE
+++ /dev/null
@@ -1,18 +0,0 @@
-Copyright (C) 2008 The Android Open Source Project
-
-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.
-
-##########
-
-This directory contains the fonts for the platform. They are licensed
-under the Apache 2 license.
diff --git a/test/resources/fonts/ttf/DroidSansMono.ttf b/test/resources/fonts/ttf/DroidSansMono.ttf
deleted file mode 100644
index 4546611d4..000000000
--- a/test/resources/fonts/ttf/DroidSansMono.ttf
+++ /dev/null
Binary files differ