From: notmasteryet Date: Wed, 22 Feb 2012 00:23:00 +0000 (-0600) Subject: Merge remote-tracking branch 'mozilla/master' into bidi X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=a8cdbcf315e133828d6444961b7df739fbcc496d;p=pdf.js.git Merge remote-tracking branch 'mozilla/master' into bidi Conflicts: src/fonts.js --- a8cdbcf315e133828d6444961b7df739fbcc496d diff --cc src/fonts.js index 01e7a7c,f637fcf..e0890c6 --- a/src/fonts.js +++ b/src/fonts.js @@@ -1887,13 -1888,12 +1900,13 @@@ var Font = (function FontClosure() 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; } @@@ -1941,6 -1941,16 +1954,16 @@@ } } + // Moving all symbolic font glyphs into 0xF000 - 0xF0FF range. - this.symbolicGlyphsOffset = 0; + if (this.isSymbolicFont) { + for (var i = 0, ii = glyphs.length; i < ii; i++) { + var code = glyphs[i].unicode; - glyphs[i].unicode = kSymbolicFontGlyphOffset | (code & 0xFF); ++ code = kSymbolicFontGlyphOffset | (code & 0xFF); ++ glyphs[i].unicode = toFontChar[i] = code; + } - this.symbolicGlyphsOffset = kSymbolicFontGlyphOffset; ++ 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)