break;
}
}
- // if it is, replacing with meaningful toFontChar values
- if (isIdentity) {
+ // if it is, replacing with meaningful toUnicode values
+ if (isIdentity && !this.isSymbolicFont) {
var usedUnicodes = [], unassignedUnicodeItems = [];
for (var i = 0, ii = glyphs.length; i < ii; i++) {
- var unicode = toUnicode[i + 1];
- if (!unicode || unicode in usedUnicodes) {
+ var unicode = toFontChar[i + 1];
+ if (!unicode || typeof unicode !== 'number' ||
+ unicode in usedUnicodes) {
unassignedUnicodeItems.push(i);
continue;
}
}
}
- this.symbolicGlyphsOffset = 0;
+ // Moving all symbolic font glyphs into 0xF000 - 0xF0FF range.
- glyphs[i].unicode = kSymbolicFontGlyphOffset | (code & 0xFF);
+ if (this.isSymbolicFont) {
+ for (var i = 0, ii = glyphs.length; i < ii; i++) {
+ var code = glyphs[i].unicode;
- this.symbolicGlyphsOffset = kSymbolicFontGlyphOffset;
++ code = kSymbolicFontGlyphOffset | (code & 0xFF);
++ glyphs[i].unicode = toFontChar[i] = code;
+ }
++ this.useToFontChar = true;
+ }
+
// remove glyph references outside range of avaialable glyphs
for (var i = 0, ii = ids.length; i < ii; i++) {
if (ids[i] >= numGlyphs)