Jeremias Maerki [Tue, 19 Feb 2008 15:47:48 +0000 (15:47 +0000)]
Added support for reading the OS/2 table's usWeightClass value which supports the same font weight values as we use in XSL-FO.
However, in my tests these values proved to be unreliable (like ExtraBlack fonts returning 400). I just hooked the whole thing in so this work isn't lost if anyone has an idea to make it work. The FontInfoFinder will continue to only use guessed font weights for now.
Jeremias Maerki [Tue, 19 Feb 2008 13:08:39 +0000 (13:08 +0000)]
Bugzilla #44451:
The patch fixes two problems:
- If distinct fonts declare the same font family name, the resulting font mapping is currently arbitrary; now, a name-similarity heuristic is used to prioritize the font mappings.
- "Medium" and "demi" fonts are now recognized as "bold", solving several real-world problems (although this solution may be an oversimplification).
Submitted by: Justus Piater <justus-bulk.at.piater.name>
Patch modified by jeremias:
- Style fixes (tab chars)
- Refined font weight identification: medium -> 500, semi/demi -> 600
Jeremias Maerki [Mon, 18 Feb 2008 15:02:39 +0000 (15:02 +0000)]
fop-rgb-icc() function did not make the round-trip which caused an error in the color_1.xml test case (intermediate format tests). Added a unit test to test the parsing and round-trip.
Documented the cmyk() function.
Jeremias Maerki [Mon, 18 Feb 2008 09:41:03 +0000 (09:41 +0000)]
Extract original exception in BasePDFTestCase.java. They are normally embedded in a TransformerException and sometimes additionally in a SAXException (depending on the JAXP implementation).
Restore validation for Base14 font check when PDF/A is active. Got lost when I refactored to generic structures in the PDF library.
Jeremias Maerki [Sat, 16 Feb 2008 12:28:48 +0000 (12:28 +0000)]
Extracted most of the code in CodePointMapping (generated by XSLT) into a base class for easier maintenance and proper Javadocs.
Deprecated FOP's copy of Glyphs.java.
Took a different approach at handling mapping alternatives for single-byte fonts. The AFM now only lists the main character. Substitution is done through Glyphs.java later in CodePointMapping.
Fixed a problem in Type1FontLoader where the PFM overrides asc/desc/cap/x even though the AFM provides the values. It showed itself because the URW Symbol font has wrong values in the PFM.
Added a note to myself in Type1FontLoader to implement the "Flags" value. The whole thing still seems to work without that part.
Added a glyph name list to the CodePointMapping so we can work with the original list from the AFM. Otherwise, various mapping operations to and from resulted in unwanted mappings (because the mappings are not necessarily 1:1) and in the end the PDF received an incorrect Encoding map. Now there's no such problem anymore.
rowStarted doesn't need to be set in the signalNewRow method. If it is, it will prevent the startTablePart event from being triggered on RowGroupBuilder, in addChildNode. This will lead to a NPE being thrown in CollapsingBorderResolver because it would be improperly set up.
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.