]> git.parisson.com Git - pdf.js.git/commitdiff
Fix a small broking mistake in fonts.js
authorVivien Nicolas <21@vingtetun.org>
Mon, 17 Oct 2011 23:34:44 +0000 (01:34 +0200)
committerVivien Nicolas <21@vingtetun.org>
Mon, 17 Oct 2011 23:34:44 +0000 (01:34 +0200)
fonts.js

index bcec5d2acf35b9aeb0fb7d43d842fd7f7b8dd7c2..2bcfa5e6ef7e0e3900b7f91487b904b2aca0b60b 100644 (file)
--- a/fonts.js
+++ b/fonts.js
@@ -2613,14 +2613,13 @@ var Type2CFF = (function type2CFF() {
         var glyph = charsets[i];
         var code = glyphMap[glyph] || 0;
 
-        var mapping = glyphs[code] || glyphs[glyph] || {};
+        var mapping = glyphs[code] || glyphs[glyph] || { width: defaultWidth };
         var unicode = mapping.unicode;
 
         if (unicode <= 0x1f || (unicode >= 127 && unicode <= 255))
           unicode += kCmapGlyphOffset;
 
-        var width = ('width' in mapping) && isNum(mapping.width) ? mapping.width
-                                                                 : defaultWidth;
+        var width = isNum(mapping.width) ? mapping.width : defaultWidth;
         properties.encoding[code] = {
           unicode: unicode,
           width: width