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.
Jeremias Maerki [Tue, 23 Aug 2005 15:16:49 +0000 (15:16 +0000)]
Started to implement a resource tracking facility in the PSGenerator. It tracks resources such as EPS files, procset etc. as PSResource instances.
Resource-DSC comments are now generated.
Procsets moved into the Prolog where they belong.
Font setup is no longer a resource as it is not interchangeable between rendering runs. It's now just setup code with FOP-specific comments surrounding it.
In the future, this may also make it possible to write a size-optimized PS file from which the resources are stripped while writing the file. These resources will then be installed directly on a printer or inserted into the Prolog by a post-processor.
Jeremias Maerki [Tue, 23 Aug 2005 14:33:38 +0000 (14:33 +0000)]
New "-foout" parameter which only saves the intermediate XSL-FO file when -xml and -xsl are used. Saves people from having to call a separate XSL transformer.
Jeremias Maerki [Tue, 23 Aug 2005 14:06:25 +0000 (14:06 +0000)]
Moved CLI to its own package. New main class is org.apache.fop.cli.Main.
InputHandler is not passed through the FOUserAgent anymore. IMO it doesn't belong there. Instead I defined an interface "Renderable" in the AWT preview that InputHandler implements. This is used exclusively for reloading the document inside the preview dialog.
Jeremias Maerki [Tue, 23 Aug 2005 07:51:16 +0000 (07:51 +0000)]
ForrestBot driver file using SCP for deployment of the FOP site to http://xmlgraphics.apache.org/fop/ after building the site with Forrest. Tested with Apache Forrest 0.7.
Build and deploy the FOP website using:
ant -f publish.xml
Jeremias Maerki [Mon, 22 Aug 2005 15:14:43 +0000 (15:14 +0000)]
Fix the DSC comment (Begin|EndDocument) for EPS files. It wasn't in the right place.
Added a FOP-specific comment around the whole EPS to delimit the EPS code.
Use the original URI if the EPS file has no name (which isn't parsed at the moment anyway).
Jeremias Maerki [Mon, 22 Aug 2005 14:48:42 +0000 (14:48 +0000)]
Remember the original URI in the FopImage instance.
Output the original URI in the comment when writing an image to PostScript. Useful for people who post-process their PostScript files.
Fixed the position of the image comment so it can be used to factor out duplicate images when combining multiple PostScript files.
Jeremias Maerki [Sun, 21 Aug 2005 16:44:00 +0000 (16:44 +0000)]
Bugzilla #36224:
This patch ports the 0.20.5 CCITTFaxDecode filter functionality and its support
of direct embedding on certain TIFF images to the trunk.
It also cleans up some of the image handling with respect to consistent closing
of the input stream to avoid dangling open files.
Submitted by: Manuel Mall <mm.at.arcus.com.au>
Changes to the patch:
Fixed a small problem with the NullFilter in the PDF library.
Used tiff_group4.tiff in external-graphic-tiff.xml.
Jeremias Maerki [Sun, 21 Aug 2005 13:36:53 +0000 (13:36 +0000)]
A big step towards a usable PostScript renderer.
Some code that can be used by both PS and PDF renderers factored out into a common base class (AbstractPathOrientedRenderer).
Coordinate system of PS renderer and PSGraphics2D changed to be based on points rather than millipoints to be the same as the PDFRenderer. This improves the chance to reuse code.
PSGenerator set to PostScript level 2 now, should later be configurable. There may still be some PS commands which should be changed from Level 2 to Level 1, just to be able to support Level 1 later should anyone ask for it.
Bitmap, EPS and SVG support should be mostly restored now.
PSState was extended to provide the same break-out mechanism for fixed b-cs. And it has better support for tracking the graphics state.
Added some FOP-specific comments to certain constructs for people who want to post-process the PS output.
BatchDiffer shows very few visual differences now on the layout engine test cases between PDF and PS.