Using the fo property last-line-end-indent instead of a hard coded value.
This fixes item 1) in bug 36533.
Note that the old behaviour (before the changes) was not completely equivalent to the one requested by the specs, as the empty space was not necessarily placed at the end of the line; for example, the last line in a right-aligned paragraph was aligned as the previous lines, although shorter.
Bugzilla #36520:
Cleaner transformation matrix handling.
SVG painting extracted into an XMLHandler subclass like for the other renderers.
Submitted by: Richard Wheeldon <richardw.at.geoquip-rnd.demon.co.uk>
Bugzilla #36505:
Several fixes for SVG painting in the Java2DRenderer.
Updated SVG test case to test additional features.
Submitted by: Richard Wheeldon <richardw.at.geoquip-rnd.demon.co.uk>
Comments and changes by jeremias:
Added an additional SVG image with an intrinsic size and modified the test case to use and test that, too.
I'll commit this patch because it improves the current situation but I'm not happy with the current state of Java2DRenderer.renderSVGDocument(). Creating inverse transformation matrices is surely not the right way to do this. The matrix should be saved and restored instead.
Furthermore, renderSVGDocument should be extracted into a Java2DSVGHandler like it is done for the other renderers.
font dict writing moved to new class PSFontUtils.
PSGenerator.resolveURI() does the same as FOUserAgent.resolveURI() but thus avoids the dependency on FOUserAgent. Needed for font embedding.
Treat fonts as resources now.
Wrap font keying in FOP-specific comments for reliable finding.
New class SubInputStream which reads a maximum number of bytes from an underlying InputStream and then behaves like it has reached EOF. Used for Type1 font embedding.
Not sure if it's the best solution but this changes the following:
- Enable plain filenames (without "file:" scheme) as URI. FOURIResolver tries to create a java.io.File to access the file.
- If after removing the scheme from a file: URL the string still contains a ":" it is likely an absolute Windows path for which the user forgot to specify a leading "/", i.e.:
file:C:/Temp/test.txt --> file:/C:/Temp/test.txt
Re-adjusting lines after a page-number or a page-number-citation is resolved.
At the moment, only TextAreas are adjusted, the other will be fixed soon!
Bugzilla #36476:
Border support on block, block-container and inline introduced. Nesting borders are supported partially: only two levels of nesting.
Consecutive paragraphs with identical border formatting are considered part
of a single group with the border information applying to the entire group.
Bugzilla #36477:
start-indent and end-indent are used instead of margins only to do indentation.
Bugzilla #36475:
Fix for block background not extending to the whole block content-width.
Submitted by: Sergey Simonchik <Sergey.Simonchik.at.borland.com>
Bugzilla #36487:
Background images were incorrectly positioned in some absolute positioned blocks.
Some additional attributes output by the XMLRenderer.
Refactored the layout for e-g and i-f-o. Introduced common base classes for the
corresponding flow objects as well as the e-g and i-f-o LMs.
Fixed incorrectly applied margins on region-body when writing mode is not lr.
Fixed application of correct percent base for margins and extents on regions
when the reference orientation is 90 degrees.
Fixed incorrectly positioned regions when writing mode is different between the
simple-page-master setting and the setting on the region.
Several updates to the layout engine test cases.
Submitted by: Manuel Mall <mm.at.arcus.com.au>
Initial work on enhancing the extension facilities to register special extensions which create so-called ExtensionAttachment objects which are attached to the formatting object they are attached to. These objects can be evaluated by standard or custom layout managers or simply passed through to the area tree (the latter is NYI). The AreaTreeHandler currently takes ExtensionAttachment objects from fo:root and fo:declarations and wraps them in OffDocumentItems that Renderers can react on to provide additional functionality on document-level (like PDF metadata or PostScript media dictionaries). Since the simple-page-master is available directly from the PageViewport the renderer can take ExtensionAttachment objects directly from there (see PSRenderer.renderPage()).
Extension Elements that provide ExtensionAttachments are not added as such to the child element list of a formatting object since they work a little differently and should free memory as soon as possible.
The PostScript extension described in http://wiki.apache.org/xmlgraphics-fop/ExtensionsForPostScript are now fully implemented but under the namespace URI "http://xmlgraphics.apache.org/fop/postscript", not "http://xml.apache.org/fop/extensions". I'll need to look at namespaces again separately, later.
The new PSExtensionElementMapping is currently hard-coded into FOTreeBuilder as are the other ElementMapping classes.
OffDocumentItem is now an interface, AbstractOffDocumentItem now providing the base functionality of the former OffDocumentItem class.
Lots of clean-up and javadocs while working through this, for example: FObj.childNodes is not public anymore. Instead a special method on fo.flow.InstreamForeignObject provides the child in the one case childNodes was directly accessed. PropertyMaker access in FObj is also done through a method now, propertyListTable is now private.
Fixed getDocument() method (is now getDOMDocument()). The plan extension still worked because convertToSvg() was called by getDimension(). Anyway, this is now fixed.
Bugzilla #36460 (first part):
Some minor cleanup and two bigger revamps of two cases. (Forgot the new image.)
Submitted by: Manuel Mall <mm.at.arcus.com.au>
PDFNumber.doubleOut() rewritten using java.text.DecimalFormat.
This fixes a bug of doubleOut() not recognizing the scientific format sometimes returned by Double.toString(double).
This change may result in slightly different value being written to the PDF stream. The former doubleOut contained specific code to do special rounding where the new method using DecimalFormat implicitly uses the BigDecimal.ROUND_HALF_EVEN strategy when rounding. These different values hopefully won't make a big visual difference. They don't in my tests.
An additional comment so this line will not be activated accidentally. The problem was a backwards-incompatible chnage in Batik for which a patch has been submitted:
http://issues.apache.org/bugzilla/show_bug.cgi?id=36455
Jeremias Maerki [Wed, 31 Aug 2005 20:34:14 +0000 (20:34 +0000)]
Set not only the base URL for the SVG Document but also the URI. Otherwise, relatively referenced documents or images inside an SVG defined in a fo:instream-foreign-object don't get resolved. This fixes certain problems with examples/fo/svg/external.fo.
Jeremias Maerki [Wed, 31 Aug 2005 08:53:25 +0000 (08:53 +0000)]
Bugzilla #36432:
JAI image does not release all resources - reported by Stephen Denne - thanks!
When loading an image provider whose support libraries are missing an
exception is thrown which should really only be a warning and the next provider
be tried.
Submitted by: Manuel Mall <mm.at.arcus.com.au>
Changes to the patch by JM:
Log level for the warning changed to debug() because the binary distribution is compiled with JAI and JIMI support and this will cause a lot of inappropriate warnings for people just happy with ImageIO images.
Jeremias Maerki [Tue, 30 Aug 2005 19:32:05 +0000 (19:32 +0000)]
Harmonization between the two Graphics2D implementations. Clipping is done after the transform. All path iterators use an identity transform which makes the PDF/PS code more readable and usually smaller.
Added missing support for non-zero winding rule in PSGraphics2D.
Jeremias Maerki [Tue, 30 Aug 2005 18:14:39 +0000 (18:14 +0000)]
normal-breaking6 shows problems with breaking in narrow environments.
keep-together-inline1 documents that keep-together.within-line doesn't work, yet.
Jeremias Maerki [Mon, 29 Aug 2005 12:03:27 +0000 (12:03 +0000)]
Background trait's toString() streamlined. Test cases adjusted accordingly.
Test cases without checks will fail from now on!!!
Checks for certain test cases and the others are added to the disabled list.
Jeremias Maerki [Mon, 29 Aug 2005 11:50:14 +0000 (11:50 +0000)]
Set the background a little later, after the IPD is set. A block area grows as necessary so this doesn't currently fix the problem that the background traits are set before the BPD is known.
Jeremias Maerki [Sat, 27 Aug 2005 21:51:40 +0000 (21:51 +0000)]
Added negative reference-orientations to block-container4.
Now checking the CTMs, too
New block-container4a based on the test case submitted by Yannick Valot for Bugzilla #36391.
I had to disable block-container4a because the CTM for 180/-180 is really wrong. Comment about the defect added to the checks. There's no quick fix, but this is also low-priority for me.
Jeremias Maerki [Fri, 26 Aug 2005 21:01:06 +0000 (21:01 +0000)]
Bugfixes and code cleanup:
- processPathIterator method like in PSGraphics2D to reduce duplicate code.
- draw() and fill() coding styles synchronized (which fixes a bug reported by Lawrence Michel)
- Higher resolution for many (not all!) formatted doubles to address the problem reported by Martin Weindel in Bugzilla #35918.
Jeremias Maerki [Fri, 26 Aug 2005 12:25:43 +0000 (12:25 +0000)]
Bugzilla: #36356
Test case for Bug #36356, slightly simplified by using absolute lengths instead of percentages for the margins. Checks added, too.
Submitted by: Manuel Mall <mm.at.arcus.com.au>
Jeremias Maerki [Thu, 25 Aug 2005 14:26:28 +0000 (14:26 +0000)]
After chasing a phantom for hours, it looks like it's simply the big images being generated that eat over 90% of the memory and at some point cause an OutOfMemoryError. Releasing the bitmaps a little sooner now which helps a little. "-Xmx256m" is still a good idea for BatchDiffer.
Haven't found any memory leaks inside FOP, since I fixed the image cache.
Jeremias Maerki [Wed, 24 Aug 2005 20:53:55 +0000 (20:53 +0000)]
Improved text painting for PostScript (including letter-space and word-space)
Moved text-decoration painting to the common base class and reused the border line painting method for this purpose.
Jeremias Maerki [Wed, 24 Aug 2005 13:43:00 +0000 (13:43 +0000)]
Fixes unrecoverable exceptions causing BatchDiffer to fail.
Doing a clean separation of encoded and decoded data inside the image implementations. Helps fix a problem with the encoded CCITT TIFF being sent to the PS output even though this is not yet implemented.