Jeremias Maerki [Thu, 19 Jan 2006 15:10:14 +0000 (15:10 +0000)]
Following a clarification by the XSL FO SG, space traits are only set on the first and last area generated by an FO, and not on every area anymore.
For details, see: http://wiki.apache.org/xmlgraphics-fop/XslFoSpecificationUncertainties/SpaceTraits
Note: this change brings another issue in column balancing to light. That's the reason for disabling one of the tests. I wasn't able to find a quick fix there.
Jeremias Maerki [Thu, 19 Jan 2006 09:46:44 +0000 (09:46 +0000)]
New interface XMLizable (copied from Apache Excalibur) to mark classes that can serialize themselves to XML (SAX stream).
New interface ContentHandlerFactory (plus associated Factory with Service discovery) for sub-document parsing plug-ins. Used by the area tree but could be used independently.
ExtensionAttachments are now part of the area tree and are written by XMLRenderer and parsed by AreaTreeParser.
The PS Extensions are extended to support serialization to and deserialization from XML.
Added a test case that tests the PS Extension WRT the handling in the area tree XML.
Jeremias Maerki [Tue, 17 Jan 2006 11:07:10 +0000 (11:07 +0000)]
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes.
The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser.
The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient.
XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though.
ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null.
The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document.
The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format.
The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected.
Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation.
Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser.
Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow.
Jeremias Maerki [Mon, 16 Jan 2006 09:18:11 +0000 (09:18 +0000)]
Bugfix: Floating point numbers were not properly formatted in the PDF renderer which could lead to error messages while opening a PDF in Acrobat Reader.
Simon Pepping [Tue, 10 Jan 2006 20:18:13 +0000 (20:18 +0000)]
The last page sequence should also follow its force-page-count trait.
Replace one test case with two leaner test cases, submitted by Gerhard
Oettl, see bug 38087.
Jeremias Maerki [Tue, 10 Jan 2006 13:19:54 +0000 (13:19 +0000)]
Fixed ugly NPE (with no message) when a malconfigured font was processed by the PS Renderer (even when that font is not used). When the font is used we don't get an NPE anymore but a Runtime exception. Not ideal, but a little better, especially because of the error message. I hope that at some point someone finds time to clean up the whole exception handling in FOP.
Manuel Mall [Sat, 7 Jan 2006 13:15:53 +0000 (13:15 +0000)]
Added support for relative font config URLs (metrics-url and embed-url). These URLs are now resolved through the FOP config URI resolver. A new configuration item font-base has been added which defines the base URL to be used for resolution of the font URLs. If it is not given the normal FOP base URL is used. Unrelated to this feature the patch also contains a new image class (java 1.4 specific) for JPEG images. This is for renderers (e.g. AFP) which require access to the decoded JPEG.
Jeremias Maerki [Thu, 5 Jan 2006 10:24:18 +0000 (10:24 +0000)]
Bugzilla #38132:
Bugfix: Certain border styles could lead to a NullPointerException.
inset and groove are now mapped to RTF's "engrave", outset and ridge to "emboss". If no mapping can be found the "solid" style is used. Before null was returned which was the cause for the NPE.
Jeremias Maerki [Wed, 4 Jan 2006 19:30:24 +0000 (19:30 +0000)]
Bugzilla #38102:
Bugfix: Space was not adjusted if the space was on a nested block inside an auto-height block-container. This could lead to content overflowing the bottom of a page.
Note: Tables and lists currently don't offer space adjustments due to the current limits of the element list combination process. Once the stretch/shrink components are handled during element list combination, this will have to be rechecked.
Jeremias Maerki [Tue, 3 Jan 2006 17:35:23 +0000 (17:35 +0000)]
Bugfix: TableCell did not properly report that it generates reference-areas which could lead to wrong inherited values for start-indent and end-indent.
Jeremias Maerki [Tue, 3 Jan 2006 13:08:45 +0000 (13:08 +0000)]
The font loading code now reads the encoding value from the XML font metrics file so that Type 1 fonts like Symbol and ZapfDingbats can be embedded explicitely (Required by PDF/A).
Note that it is necessary to set the encoding value in the font metrics file manually since it cannot be extracted from the PFM file reliably, i.e. for "Symbol" use "SymbolEncoding" and for "ZapfDingbats" use "ZapfDingbatsEncoding".
Manuel Mall [Wed, 28 Dec 2005 03:08:49 +0000 (03:08 +0000)]
LineArea had a finalize method which caused a NPE when called from the garbage collector. I assume it was never intended for this method to be an override of the Java Object finalize method. Renamed the method to finalise.
Jeremias Maerki [Thu, 22 Dec 2005 20:10:54 +0000 (20:10 +0000)]
As announced, I brought FontTriplet to more life by making it Serializable and using it to transport the information about the font in use through the area tree. This has small effects on the test cases as the values in the generated XML are slightly different. While refactoring I saw that there's some room for optimization. Too many objects are still created. It should be quite easy now with the FontTriplet to create a small cache.
Jeremias Maerki [Thu, 22 Dec 2005 10:51:29 +0000 (10:51 +0000)]
More work on preparing for the intermediate format.
Font traits are added in a single place in TraitSetter so it will be easier to change those.
Remove direct references on FObjs in the area tree for regions.
Jeremias Maerki [Thu, 22 Dec 2005 08:51:37 +0000 (08:51 +0000)]
Issue a warning when an unresolved bookmark item is received. This will be currently triggered by bug #37993. This is just to raise awareness of the problem.
Jeremias Maerki [Thu, 22 Dec 2005 07:58:31 +0000 (07:58 +0000)]
Introduced a flag to tell the page breaking to operate in auto-height mode, i.e. no overflows can happen. This disables the overflow warnings when footnote-separators are defined. They don't have an explicit height.
Jeremias Maerki [Wed, 21 Dec 2005 10:20:56 +0000 (10:20 +0000)]
Further decoupling the area tree from the FO tree.
Created a new class org.apache.fop.layoutmgr.Page that holds a reference to the generating SimplePageMaster and the PageViewport. A deserialized area tree doesn't need a reference to the SimplePageMaster.
Renamed PageViewportProvider to PageProvider as it now returns Page instances, not (directly) PageViewports.
Jeremias Maerki [Tue, 20 Dec 2005 12:53:50 +0000 (12:53 +0000)]
First step towards reactivating CachedRenderPagesModel (helps preparing for the intermediate format).
Fix some serialization problems in the area tree.
Jeremias Maerki [Tue, 20 Dec 2005 09:33:44 +0000 (09:33 +0000)]
Bugzilla #37964:
Hard breaks with even-page or odd-page were not handled correctly when spaces were surrounding the break. The code that retrieves the break-class from the penalty assumes that the penalty is on the last element in the list, but the space resolution added additional glues after the penalty.
Jeremias Maerki [Mon, 19 Dec 2005 10:46:54 +0000 (10:46 +0000)]
Update for status page. Table on status of the individual components added. This reflects my own view, not necessarily everyone's. If I'm wrong about anything, please change.
Jeremias Maerki [Fri, 16 Dec 2005 14:40:20 +0000 (14:40 +0000)]
XMLHandler interface changed so it reports whether it supports a particular Renderer instead of reporting the MIME type. One MIME type could be implemented by multiple Renderer implementations so conflicts could occur. Almost all XMLHandler implementations will have a dependency on a particular Renderer implementation.
XMLHandlers are now configurable.
Standard XMLHandlers now get registered through service lookup.
Simplification: XMLHandlers don't need nested classes for the handling functionality anymore. If Batik, for example, is not in the classpath it will already be detected while registering the XMLHandlers.
The RendererContextConstants interface now standardizes some of the keys used in the RendererContext and helps with actually decoupling the XMLHandler implementations from the renderers. This is one step towards making Batik an optional dependency and making it possible to move the SVG functionality to a separate place later.
Extracted the SVG XMLHandler functionality from the sandbox SVGRenderer into a separate class following the example of the other renderers.
Bugfix in PSSVGHandler: Fixed a copy/paste error which could lead to wrong clipping of an SVG image for PostScript output.
Jeremias Maerki [Thu, 15 Dec 2005 22:20:48 +0000 (22:20 +0000)]
NOTE: API changes in a backwards-incompatible way: FOUserAgent.setResolution() -> FOUserAgent.setSourceResolution() and FOUserAgent.setTargetResolution()
Resolution parameter to the user agent is split into:
- a source resolution used to determine the pixel size in SVG images and bitmap without resolution information
- a target resolution used to specify the output resolution of bitmap images generated by bitmap renderers and bitmaps generated by Batik for filter effects.
Jeremias Maerki [Thu, 15 Dec 2005 16:59:37 +0000 (16:59 +0000)]
Bugzilla #37875:
Some content inside a table-header may not have been renderered on pages n > 1 in certain conditions.
LineLM kept state between calls to addAreas which can have ugly side-effects in case of table-headers, for example, where the same positions are rendered more than once. I don't know why the bug only manifests if there's an overflow in the second line of the table-header in the test case.