var toUnicode = dict.get('ToUnicode') ||
baseDict.get('ToUnicode');
if (toUnicode)
- properties.toUnicode = this.readToUnicode(toUnicode, xref);
+ properties.toUnicode = this.readToUnicode(toUnicode, xref, properties);
if (properties.composite) {
// CIDSystemInfo helps to match CID to glyphs
properties.hasEncoding = hasEncoding;
},
- readToUnicode: function PartialEvaluator_readToUnicode(toUnicode, xref) {
+ readToUnicode: function PartialEvaluator_readToUnicode(toUnicode, xref,
+ properties) {
var cmapObj = toUnicode;
var charToUnicode = [];
if (isName(cmapObj)) {
}
} else if (octet == 0x3E) {
if (token.length) {
+ // XXX guessing chars size by checking number size in the CMap
+ if (token.length <= 2 && properties.composite)
+ properties.wideChars = false;
+
if (token.length <= 4) {
// parsing hex number
tokens.push(parseInt(token, 16));
length1: length1,
length2: length2,
composite: composite,
+ wideChars: composite,
fixedPitch: false,
fontMatrix: dict.get('FontMatrix') || IDENTITY_MATRIX,
firstChar: firstChar || 0,
this.widths = properties.widths;
this.defaultWidth = properties.defaultWidth;
this.composite = properties.composite;
+ this.wideChars = properties.wideChars;
this.hasEncoding = properties.hasEncoding;
this.fontMatrix = properties.fontMatrix;
glyphs = [];
- if (this.composite) {
+ if (this.wideChars) {
// composite fonts have multi-byte strings convert the string from
// single-byte to multi-byte
// XXX assuming CIDFonts are two-byte - later need to extract the