]> git.parisson.com Git - pdf.js.git/commitdiff
Merge with upstream
authorVivien Nicolas <21@vingtetun.org>
Sat, 10 Sep 2011 18:12:57 +0000 (20:12 +0200)
committerVivien Nicolas <21@vingtetun.org>
Sat, 10 Sep 2011 18:12:57 +0000 (20:12 +0200)
1  2 
fonts.js
pdf.js

diff --cc fonts.js
index a4e16dad5ed3db70b9f2d43d980c6cab52e28eea,f3178b37fc6cbe65e293f408443bedfb654ebfb1..cc353c03b3d5cca1ea2a0f13628fa0f57269b95f
+++ b/fonts.js
@@@ -409,12 -444,13 +409,12 @@@ var Font = (function Font() 
    var constructor = function font_constructor(name, file, properties) {
      this.name = name;
      this.encoding = properties.encoding;
 -    this.glyphs = properties.glyphs;
      this.sizes = [];
  
-     var names = name.split("+");
+     var names = name.split('+');
      names = names.length > 1 ? names[1] : names[0];
      names = names.split(/[-,_]/g)[0];
 -    this.serif = serifFonts[names] || (name.indexOf('Serif') != -1);
 +    this.serif = serifFonts[names] || (name.search(/serif/gi) != -1);
  
      // If the font is to be ignored, register it like an already loaded font
      // to avoid the cost of waiting for it be be loaded by the platform.
                if (index) {
                  deltas.push(index);
  
 -                var code = encoding[index];
 -                for (var glyph in properties.glyphs) {
 -                  if (properties.glyphs[glyph] == code)
 -                    break;
 -                }
 -
                  var unicode = j + kCmapGlyphOffset;
 -                properties.glyphs[glyph] = encoding[j] = unicode;
 -                glyphs.push({ glyph: glyph, unicode: unicode });
 +                var mapping = encoding[j] || {};
 +                mapping.unicode = unicode;
 +                encoding[j] = mapping;
 +                glyphs.push({ unicode: unicode });
                }
              }
-             
              return cmap.data = createCMapTable(glyphs, deltas);
            } else if (format == 6) {
              // Format 6 is a 2-bytes dense mapping, which means the font data
diff --cc pdf.js
Simple merge