diff options
author | Jeremias Maerki <jeremias@apache.org> | 2008-02-16 12:28:48 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2008-02-16 12:28:48 +0000 |
commit | 57de10b2fdd6e6f0bbca3aac03bce84d82cfaba3 (patch) | |
tree | db31b6f70693085e182139ccb82345e556fee49b /src/java/org/apache/fop/pdf/PDFFactory.java | |
parent | 70d511b80f4099730738077cf15dc39a062df89a (diff) | |
download | xmlgraphics-fop-57de10b2fdd6e6f0bbca3aac03bce84d82cfaba3.tar.gz xmlgraphics-fop-57de10b2fdd6e6f0bbca3aac03bce84d82cfaba3.zip |
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.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@628280 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/pdf/PDFFactory.java')
-rw-r--r-- | src/java/org/apache/fop/pdf/PDFFactory.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/java/org/apache/fop/pdf/PDFFactory.java b/src/java/org/apache/fop/pdf/PDFFactory.java index a50ef2545..687b32016 100644 --- a/src/java/org/apache/fop/pdf/PDFFactory.java +++ b/src/java/org/apache/fop/pdf/PDFFactory.java @@ -40,7 +40,6 @@ import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.xmlgraphics.fonts.Glyphs; import org.apache.xmlgraphics.xmp.Metadata; import org.apache.fop.fonts.CIDFont; @@ -1252,15 +1251,17 @@ public class PDFFactory { PDFEncoding.DifferencesBuilder builder = pdfEncoding.createDifferencesBuilder(); int start = -1; + String[] winansiNames = winansi.getCharNameMap(); + String[] charNameMap = mapping.getCharNameMap(); for (int i = 0; i < 256; i++) { - char wac = winansi.getUnicodeForIndex(i); - char c = mapping.getUnicodeForIndex(i); - if (wac != c) { + String wac = winansiNames[i]; + String c = charNameMap[i]; + if (!wac.equals(c)) { if (start != i) { builder.addDifference(i); start = i; } - builder.addName(Glyphs.charToGlyphName(c)); + builder.addName(c); start++; } } |