diff options
author | Jeremias Maerki <jeremias@apache.org> | 2008-02-14 10:41:26 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2008-02-14 10:41:26 +0000 |
commit | e1c8b0065b1d5b8456546abbc9d7e040123c380a (patch) | |
tree | c079610893514bcdaf4cb2a2c956f95146484d63 /src/codegen | |
parent | 06e1fa6d243ec64dd675110e9344f34cabd566a3 (diff) | |
download | xmlgraphics-fop-e1c8b0065b1d5b8456546abbc9d7e040123c380a.tar.gz xmlgraphics-fop-e1c8b0065b1d5b8456546abbc9d7e040123c380a.zip |
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.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@627702 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/codegen')
-rw-r--r-- | src/codegen/fonts/code-point-mapping.xsl | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/codegen/fonts/code-point-mapping.xsl b/src/codegen/fonts/code-point-mapping.xsl index 80b62dd17..c82ca0104 100644 --- a/src/codegen/fonts/code-point-mapping.xsl +++ b/src/codegen/fonts/code-point-mapping.xsl @@ -63,14 +63,17 @@ public class CodePointMapping { unicodeMap = new char[256]; Arrays.fill(unicodeMap, CharUtilities.NOT_A_CHARACTER); for (int i = 0; i < table.length; i += 2) { - if (table[i + 1] < 256) { - latin1Map[table[i + 1]] = (char) table[i]; - } else { - ++nonLatin1; - } - if (unicodeMap[table[i]] == CharUtilities.NOT_A_CHARACTER) { - unicodeMap[table[i]] = (char)table[i + 1]; - } + char unicode = (char)table[i + 1]; + if (unicode < 256) { + if (latin1Map[unicode] == 0) { + latin1Map[unicode] = (char) table[i]; + } + } else { + ++nonLatin1; + } + if (unicodeMap[table[i]] == CharUtilities.NOT_A_CHARACTER) { + unicodeMap[table[i]] = unicode; + } } characters = new char[nonLatin1]; codepoints = new char[nonLatin1]; |