Jeremias Maerki [Thu, 14 Feb 2008 10:41:26 +0000 (10:41 +0000)]
Fix problem with alternate Unicode code point overriding existing better ones in CodePointMapping (ex. a char code for NBSP was used in place of SPACE for non-standard encodings).
Made PFM completely optional if an AFM is available. Widths and Kerning are now also read from the AFM. Fallbacks for missing values are in place. If both AFM and PFM are available, both are used to get the best possible result for certain metrics.
Adrian Cumiskey [Thu, 14 Feb 2008 10:12:48 +0000 (10:12 +0000)]
When I first saw this it surprised me, it seems to have been here for quite some time.
The code block directly following this if/else condition was identical so I removed the copy/paste duplication and refactored it.
Jeremias Maerki [Thu, 14 Feb 2008 08:12:34 +0000 (08:12 +0000)]
Added support for Type 1 fonts which don't use the AdobeStandardEncoding for PDF and PS output. Details:
Added an Type 1 AFM parser (only basic ltr script fonts are properly supported).
Font loading changed slightly to allow loading an AFM in addition to a PFM.
Added some mapping functionality to CodePointMapping. Now we also build custom CodePointMapping instances from AFM files and use it in SingleByteFonts.
Changed more PDF object classes to make use of the generic PDFDictionary and PDFArray base classes.
Type 1 Fonts with a special encoding now register their encoding in the Encoding value of the font dictionary so the mapping is correct. For PS this isn't necessary as the interpreter just uses the font's default encoding.
Refactored CMap building code to it can also be used outside the PDF context. A CMap can now also be built from a single byte encoding.
Update of XML Graphics Commons snapshot.
Correction/Rectification of changes made in r617989:
* adjustment in ColorUtil to cater for the change
* added check to the color_1.xml testcase, checking for bug 43705
Some minor tweaks:
* added convenience shortcut to PropertyInfo to get to the user agent.
* replaced occurrences to use the shortcut in PropertyParser and RGBColorFunction.
* PropertyParser -> 0% of a length always yields FixedLength.ZERO_FIXED_LENGTH
Simon Pepping [Fri, 8 Feb 2008 19:20:27 +0000 (19:20 +0000)]
In addKnuthElementsForBorderPaddingXXX, if the returnlist is a
BlockKnuthSequence, the border and padding should be added to the
first or last paragraph inside it, but it is too late to do that
now. At least, avoid adding it to the bpd sequence.
Removed the 900 penalty mechanism which anyway almost always produced visually bad results. Now the first step for a row is computed so that each cell starting on it can contribute some content.
Used a similar mechanism to replace backtracking: the current row is now allowed to grow as long as there is not enough space on the current page to make the next row fit. The next row is "delayed", so this mechanism is called "row-delaying"
Tweak: modify PercentLength.toString() to return a value that facilitates debugging.
Moved the original code to a getString() implementation, which is now used by the fotree test suite.
Tweak: early percentage resolution by the parser (if the base is known and absolute). Reduces the number of PercentLength instances in favor of cached FixedLengths.
Jeremias Maerki [Thu, 7 Feb 2008 15:42:03 +0000 (15:42 +0000)]
Bugfix for date formatting with negative time zones in the PDF's Info object.
Update of xmlgraphics-commons-1.3.jar because of a similar bug with formatting dates in XMP.
Jeremias Maerki [Thu, 7 Feb 2008 14:02:44 +0000 (14:02 +0000)]
Added an option to disable the default sRGB profile in PDF output for those who don't care about color fidelity, but care about PDF file size. Note that this option is not possible if PDF/A, PDF/X or an output profile is used. Makes simple PDFs about 4KB smaller. Ha!
Jeremias Maerki [Wed, 6 Feb 2008 14:07:03 +0000 (14:07 +0000)]
Bugzilla #36391:
Fixed problem with positioning of content when reference-orientation="180" is used. CTM is now correct. It is updated after the height of the content is known. Instead of somehow inverting the element list, I've simply declared this case non-breakable, i.e. I generate one box.
Fixed a few other problems mostly occurring when rotating block-container content by 90 or 270 degrees plus a few remaining auto-height handling problems. This involved switching off some sometimes unwanted side-effects from auto-updating the BPD in some area classes.
Bugzilla 43705:
Fixed a bug when the rgb-icc() function was used before the fo:declarations,
or in documents without fo:declarations. Function now correctly (?) reverts
to the sRGB fallback in those cases.
Added very basic parsing for the xml:lang shorthand.
No validation of the specified value, but the language and country
properties now do take the shorthand into account to determine their
value.
Further cleanup/refinement of FixedLength:
* improve consistency in use of the PropertyCache
remove public constructor -> replaced by getInstance() in a handful of classes
* added a sourceResolution parameter to getInstance() and the private
constructor to allow better handling of device-dependent units (px)
Bugzilla 44343:
Fixed a bug when using relative (smaller/larger) font-sizes in combination with percentages.
Percentages now resolved as per the spec (XSL-FO 1.1 7.9.4):
"A percentage value specifies an absolute font size relative to the parent element's font-size."
Jeremias Maerki [Fri, 1 Feb 2008 16:02:33 +0000 (16:02 +0000)]
Move sRGB installation into the PDF library. That way it can be used in PDFDocumentGraphics2D, too (via AbstractImageAdapter).
Ensures correct handling of sRGB images in PDFTranscoder.
Jeremias Maerki [Fri, 1 Feb 2008 14:58:30 +0000 (14:58 +0000)]
AlphaRasterImage now knows how to deal with TYPE_INT Rasters.
Streamlined image handling in Graphics2D.
Support natively handling CCITT images in SVG images.
Add fallback to device RGB if sRGB isn't set up as the default color space in PDF.
Replaced testcases for forced break on table-row with more complete ones. Tests failing because of bug #44320 have been commented out and will need to be re-enabled once the bug is fixed
Jeremias Maerki [Mon, 28 Jan 2008 15:04:39 +0000 (15:04 +0000)]
Added support for the natural language indentifier ("Lang" in the document catalog) for PDF documents based on the language/country values on fo:page-sequence. This required a few changes in the AreaTreeModel and the Renderer interface because it didn't support passing through the PageSequence object, only its title. Now, we can put other values on the PageSequence and transport them to the renderers.
Jeremias Maerki [Mon, 28 Jan 2008 10:32:46 +0000 (10:32 +0000)]
Improve breaking for block-container and static-content so there are no more "breaking artifacts" (like additional border lines) in the overflowing part of the content anymore. This is done by removing all breaks from the result list prior to constructing the area tree. The presence of breaks simply indicates that there is an overflow.
Cleanup:
- renamed startRow/startCol into rowIndex/colIndex
- improved javadoc of PrimaryGridUnit.getRowIndex()
- moved colIndex from GridUnit into PrimaryGridUnit since it's only needed there
- simplified EmptyGridUnit constructor
Added support for conditional borders (and paddings) in tables.
The proper borders are not selected yet between the header/footer and the body. There might still be a few glitches in some cases
Jeremias Maerki [Tue, 22 Jan 2008 14:02:27 +0000 (14:02 +0000)]
Bugzilla #44160:
Fixed a possible IndexOutOfBoundsException that could happen with certain constellations when footnotes are used. Note: I haven't been able to come up with a scaled-down testcase for regression testing. Maybe someone more intimate with the footnote handling can.
Jeremias Maerki [Mon, 21 Jan 2008 10:33:10 +0000 (10:33 +0000)]
A name object can be encoded as a stand-along PDF object with object number and all, so extend from PDFObject. Fixes a possible ClassCastException with the PDF-in-PDF extension.
Jeremias Maerki [Thu, 17 Jan 2008 13:37:04 +0000 (13:37 +0000)]
Fixed logic error setting the transformation matrix for block-container viewports (applies to absolute and fixed block-containers only). The CTM now only rotates and shifts the content as necessary for reference-orientation and writing-mode. All the rest of the transformation is done by the renderer which allows to add additional transformations as made possible by fox:transform (see below).
Important: External renderer implementations need to adjust for the change and implement the new method concatenateTransformationMatrix(AffineTransform) if the renderer is derived from AbstractPathOrientedRenderer.
New extension attribute fox:transform on fo:block-container allows free-form transformation (rotation, scaling etc.) of absolute and fixed block-containers. Supported only for PDF, PS and Java2D-based renderers.
Added missing region background painting for PCL renderer.
Jeremias Maerki [Mon, 14 Jan 2008 11:01:11 +0000 (11:01 +0000)]
java.net.URI doesn't eat non-escaped URIs so I added an escaping method to URISpecification that should cover most cases. Usually, it's just about a space in a filename.