]> git.parisson.com Git - pdf.js.git/commitdiff
Merge remote-tracking branch 'mozilla/master' into bidi
authornotmasteryet <async.processingjs@yahoo.com>
Wed, 22 Feb 2012 00:23:00 +0000 (18:23 -0600)
committernotmasteryet <async.processingjs@yahoo.com>
Wed, 22 Feb 2012 00:23:00 +0000 (18:23 -0600)
Conflicts:
src/fonts.js

1  2 
src/fonts.js

diff --cc src/fonts.js
index 01e7a7c9fa9004cbb8c46afaf82dd8404f05302c,f637fcf09de035f6f865b8ca41952298505e0dc4..e0890c6fa0863e2c29d1ed59c2fe07aa9f14556d
@@@ -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;
                }
            }
          }
  
 -        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)