Patch for the implementation of the improved float-placement algorithm
Changes:
- merge in changes up to revision 432403 of the trunk
- extract LineBreakingAlgorithm and LineBreakPosition from LineLayoutManager and
put them in the breaking subpackage (was in preparation for the side-floats
implementation)
New features:
- minimum accepted fill ratio for pages: underfull pages which have at least
this fill ratio are considered to be feasible breaks
- float-only pages; this may be parameterized
- big floats may now be split on several pages
- shrink- and stretchability of out-of-line object are now taken into account
Added support for a 8x8 bayer dither matrix if anyone wants to try that. Currently, 4x4 is hard-coded. The 8x8 might only be an option for larger areas (i.e. not text) but the results didn't look any better when printed.
Attempt to make grayscale patterns look nicer when using PCL commands. The standard PCL shades are very coarse and I replaced them with a simple 4x4 bayer dither pattern defined as a user-defined pattern in PCL.
Current side-effect: Darker gray values will result in almost black output on some printers (at least on mine).
Activating ImageIOImage for reading PNG images in the ImageFactory made some test cases fail. The reason is that the PNGReader cannot extract the image resolution and leaves the default of 72dpi.
Added code to inspect the image metadata for resolution info.
I added the same hack as is already used in PNGImage to force loading the whole image when the image dimensions are requested, i.e. getting the right image size is more important than efficient memory use for now.
The image package needs that redesign sooner or later....
Command-line integration of PDF/X support. Generalized the specifying of PDF profiles (-pdfprofile parameter).
Documentation update for PDF/A.
Documentation for PDF/X.
Fixed two memory-leaks in image handling (ImageFactory and ExternalGraphic). The image cache is finally working properly. Currently implemented without the cleanup thread as done by Batik.
Added ImageIO provider for handling PNG in addition to the internal codec. ImageIO proved to be faster and less memory-intensive for PNGs. ImageIO takes precedence of the internal codec.
Bugzilla #39608:
Let numeric property values without a unit be treated as pixels like in HTML. This fixes certain NullPointerExceptions when no units are specified.
Made FOUserAgent.configure() protected again (not to tempt any users to play with it). Instead improved CommandLineOptions to properly build and adjust the FOUserAgent. Manuel's fix was ok, but I wasn't too comfortable with the public configure() method.
Showing a problem with SVG used inside a basic-link. The size of the link rect is wrong and only spans the area of the nominal line rect. (As reported on fop-users)
Bugzilla #39983:
Moved the setting of the system look&feel to CommandLineOptions. Shouldn't really be in PreviewDialog.java.
Added a parameter to createPreviewDialog() so embedders don't get a System.exit() when the user closes the preview dialog. System.exit() may only be called if the preview dialog is the main window.
Jeremias Maerki [Thu, 29 Jun 2006 10:13:08 +0000 (10:13 +0000)]
Re-routing SVG painting to the Graphics2DAdapter and teach the latter to respect the renderer's colorImages setting.
Removed obsolete SVGConverter.
This fixes painting SVG at a hard-coded resolution. Now uses the target resolution from the user agent.
Jeremias Maerki [Tue, 20 Jun 2006 14:57:44 +0000 (14:57 +0000)]
XML Graphics Commons 1.0 replaced with a SVN snapshot (containing the XMP framework).
Reworked the XMP support for PDF to use the XMP framework from XML Graphics Commons.
XMP metadata embedded in fo:declarations is now properly handled. Its values are copied to the Info object according to the rules from PDF/A-1.
Metadata values from the user agent (title, author etc.) are properly merged with metadata from the XSL-FO document. UserAgent metadata overrides FO metadata.
Note: This is useful and active even if you don't activate PDF/A support.
Jeremias Maerki [Wed, 14 Jun 2006 14:34:29 +0000 (14:34 +0000)]
Added initial support for PDF/X-3:2003 (ISO 15930-6:2003(E)).
Fixed bugs in PDF/A support: Transparency is now switched off and the CIDSet object is generated for CID fonts.
PDF/A and PDF/X are now "profiles" (see PDFProfile) which are used to control the allowed, required and forbidden features in PDF. PDF/A-1b and PDF/X-3:2003 can both be activated simultaneously as they are compatible.
For PDF/X, color handling has been improved a little (PDFColorSpace is now an interface, the old PDFColorSpace is now PDFDeviceColorSpace) and most importantly, the "DefaultRGB" color space is now mapped to the sRGB color space (for all colors in DeviceRGB) which ensures that all sRGB colors from XSL-FO are also sRGB colors in PDF which wasn't necessarily the case before.
For PDF/X, added support for a custom, non-sRGB output profile because PDF/X requires a "Output Device Profile" (which sRGB is not).
ICC profiles are now shared/cached among images.
Added support for fox:conversion-mode="bitmap" in the PDFRenderer to handle SVGs with transparency when transparency is forbidden (PDF/X and PDF/A). Only drawback: the image is not combined with the background. An opaque bitmap with a white background is generated.
Jeremias Maerki [Thu, 8 Jun 2006 12:46:50 +0000 (12:46 +0000)]
Added region-body_display-align to demonstrate the default behaviour for adjustable spaces when display-align is set to "auto".
Reactivated proprietary display-align="distribute" so a block-container can cause its content to be "justified" in the reference area if it's large enough and the adjustable elements (min/opt/max) allow for it. I may be misusing the original intended behaviour of "distribute" but for block-container this seemed suitable since it's destined to produce only one viewport/reference pair if possible. Test added that demonstrates the proprietary value on block-container. Note: on normal region-body elements, display-align="distribute" has currently no effect since the code did not evolve with the changes in the layout engine.
Jeremias Maerki [Thu, 8 Jun 2006 12:36:23 +0000 (12:36 +0000)]
Set a PrefixResolver for the "true" check, too, not only for "eval".
Added optional "tolerance" value for number comparisons using the "eval" check. Simplifies certain checks.
Jeremias Maerki [Fri, 2 Jun 2006 07:34:25 +0000 (07:34 +0000)]
Bugzilla #39701:
Fix potential NullPointerException when buggy JAXP implementations return null instead of an empty String as namespace URI.
Submitted by: Stefan Ziel <stefan.ziel.at.claninfo.ch>
Jeremias Maerki [Thu, 1 Jun 2006 07:34:29 +0000 (07:34 +0000)]
Added detection code for AFM and PFB files. Sadly, for PFM there does not seem to be a reliable method of detecting the file type. For example, I remember is PFM file that did not contain the right file size (file size is in the header).
Jeremias Maerki [Wed, 31 May 2006 21:17:18 +0000 (21:17 +0000)]
Improved accuracy of font size selection. The font size is not rounded down to the next integer point value anymore. (Java2D renderers profit from that one, too)
PCL Renderer:
Found a use case for that Java2D ascent value (which I call MaxAscent). It is used for painting text as bitmaps and to make sure the image the text is painted on is big enough if the font ascends beyond the em box. For non-Java2D fonts, MaxAscent is the same as ascent.
Added a check that lets text painting fall back to bitmaps if there are characters that are not in the ISO-8859-1 encoding. This also enables Symbol and ZapfDingbats fonts.
A "text-rendering" setting allows to disable PCL text painting in case the mix of PCL and bitmap text painting should result in unwelcome output. Note: the bitmap rendering is relatively slow (many small bitmaps). In the end we might end up rendering using a BitmapRenderer and only wrapping the whole thing in PCL (much like the Windows PCL drivers do). This would be faster than creating many small bitmaps.
Jeremias Maerki [Wed, 31 May 2006 13:36:18 +0000 (13:36 +0000)]
Fix for border painting in "quality" mode. Some borders were swallowed.
Added an additional parameter to distinguish between painting bitmap with source transparency (bitmapped text and borders) and without (images).
Jeremias Maerki [Tue, 30 May 2006 15:53:12 +0000 (15:53 +0000)]
Changed the way the graphics state handling is done to make a cleaner "break out" for fixed block-containers possible.
Fixed block-containers are now working correctly. The Java2D renderer as well as its descendants are now basically on the same feature level as PDF and PS. All area tree elements get rendered correctly.
Jeremias Maerki [Mon, 29 May 2006 14:22:04 +0000 (14:22 +0000)]
Making ImageIO come before JAI for GIF images. ImageIO handles GIFs nicely, even with transparency. JAI is only still interesting for people on JDK 1.3. Everyone else is ok with Image I/O.
Jeremias Maerki [Thu, 25 May 2006 11:20:48 +0000 (11:20 +0000)]
Removed VMI setting which caused pages > 1 to be shifted down for some reason. Looks like the VMI setting has no influence for the PCL Renderer since we reposition the cursor for each text string.
Implemented the break out list for fixed block-containers.
Simon Pepping [Fri, 19 May 2006 15:10:44 +0000 (15:10 +0000)]
An emergency patch to avoid that a non-breaking space at the end of an
fo:inline with padding, followed by another fo:inline, while
text-align is justify, does not cause a NullPointerException due to
InlineStackingLayoutManager.addALetterSpaceTo(). Patch submitted by
Max Berger <max@berger.name>, applied with some modifications. This
patch solves bug 39571.
Jeremias Maerki [Fri, 19 May 2006 11:51:40 +0000 (11:51 +0000)]
Bugfix: The combination of hyphenation and kerning resulted in slightly ragged right ends for right-aligned and justified text. The kerning values were not correctly placed and summed up for hyphenation and no-hyphenation conditions.
Jeremias Maerki [Thu, 18 May 2006 18:58:05 +0000 (18:58 +0000)]
Bugfix: NullPointerException in AreaAdditionUtil in a table-cell spanning multiple pages and with a marker.
Note: This is a hack to avoid the NPE. A problem remains. The markers will not be added if the first/last conditions cannot be determined.
Jeremias Maerki [Thu, 18 May 2006 15:54:17 +0000 (15:54 +0000)]
Bugzilla #39533:
Bugfix: NullPointerException in RTF output when a table does not contain table-columns.
The code now informs the user that he should explicitely define the table-columns.
Jeremias Maerki [Thu, 18 May 2006 12:44:15 +0000 (12:44 +0000)]
Extended PageViewport to carry foreign attributes.
Foreign attributes from simple-page-master are transferred to the PageViewport.
Added foreign attributes handling in AreaTreeParser.
Fixed proper generation of foreign attributes in XMLRenderer.
EvalCheck extended so it can use namespace prefix mappings in its context.
Test case for foreign attributes.
Paper source/tray support for PCL (pcl:paper-source="<tray-code>" on s-p-m)
Jeremias Maerki [Wed, 17 May 2006 15:06:42 +0000 (15:06 +0000)]
Several bug fixes in PCLRenderer (border painting mostly).
Option in AbstractGraphics2DAdapter to work with or without alpha.
Text Setup changed to the Java2D model. Custom font painting is now done through Java2D as bitmaps for all fonts which are not supported by the pre-defined set. This was done as a shortcut for full-fledged TrueType support which seems to be a little complicated in PCL. BTW, Microsoft PCL printer drivers do the same, i.e. paint text as bitmaps.
Image printing refined, but my attempt at handling bitmasked images (transparency) didn't work out. While the previewers did the expected thing, the printer hardware flat-out ignored it, so it's disabled now.
Jeremias Maerki [Tue, 16 May 2006 14:04:47 +0000 (14:04 +0000)]
Automatic support for all fonts available to the Java2D subsystem for all Java2D-descendant renderers (TIFF, PNG, print, AWT).
Improvements in the adapter for Java2D/AWT font metrics.
Jeremias Maerki [Tue, 16 May 2006 11:44:57 +0000 (11:44 +0000)]
Improved baseline detection in TTFReader for TrueType fonts. Ascender and descender values were sometimes not in line with FOP's expectations.
Changed some log output from debug to trace level.
Jeremias Maerki [Mon, 15 May 2006 09:59:59 +0000 (09:59 +0000)]
Bugfix: tables nested in inline elements caused a NullPointerException.
Furthermore, keep-together handling was not appropriate when a table is nested in an inline (fixes a ClassCastException).
Finally, TableContentPosition did not indicate that it generates area which made them be ignored by the InlineLM.
Jeremias Maerki [Wed, 10 May 2006 13:45:46 +0000 (13:45 +0000)]
Important improvements for the Java2DRenderer:
Support for letter- and word-spacing which also enables justified text.
Fix for font metric access. Fractional metrics was off. charWidth() only returned integers.
Removed the obscure 1.4 factor (Thanks to Chris Dail for the hint!)
Dispose of Graphics2D instance if no longer used to free up resources.
Jeremias Maerki [Sun, 7 May 2006 13:43:35 +0000 (13:43 +0000)]
The default sRGB color profile provided by the Java class library is no longer embedded if it is encountered. This should reduce the PDF size considerably.