// Unicode Private Use Area
var kCmapGlyphOffset = 0xE000;
-
/**
* Hold a map of decoded fonts and of the standard fourteen Type1
* fonts and their acronyms.
break;
}
- glyphs.push({ glyph: glyph, unicode: j });
- }
- }
-
- if (properties.firstChar < 0x20) {
- for (var j = 0; j < glyphs.length; j++) {
- var glyph = glyphs[j];
- var code = glyph.unicode + kCmapGlyphOffset;
- properties.glyphs[glyph.glyph] = encoding[glyph.unicode] = code;
- glyph.unicode = code;
+ var unicode = j + kCmapGlyphOffset;
+ properties.glyphs[glyph] = encoding[j] = unicode;
+ glyphs.push({ glyph: glyph, unicode: unicode });
}
}
lastChar = diffEncoding.length || baseEncoding.length;
// merge in the differences
+ function isDisplayable(code) {
+ return code > 0x1f && (code < 128 || code > 255);
+ }
+
var glyphsMap = {};
for (var i = firstChar; i <= lastChar; i++) {
var glyph = diffEncoding[i] || baseEncoding[i];
var index = GlyphsUnicode[glyph] || i;
glyphsMap[glyph] = encodingMap[i] = index;
- if (index <= 0x1f || (index >= 127 && index <= 255))
+ if (!isDisplayable(index))
glyphsMap[glyph] = encodingMap[i] += kCmapGlyphOffset;
}