From: notmasteryet Date: Sun, 18 Sep 2011 14:11:53 +0000 (-0500) Subject: Merge branch 'master' of https://github.com/andreasgal/pdf.js.git into charstoglyphs X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=e59a36a0151738f0ebb59daee51c96dca8915caa;p=pdf.js.git Merge branch 'master' of https://github.com/andreasgal/pdf.js.git into charstoglyphs --- e59a36a0151738f0ebb59daee51c96dca8915caa diff --cc pdf.js index 5c3102b,1ee56e7..3b17992 --- a/pdf.js +++ b/pdf.js @@@ -4361,12 -4362,17 +4361,18 @@@ var PartialEvaluator = (function() // merge in the differences var firstChar = properties.firstChar; var lastChar = properties.lastChar; + var widths = properties.widths || []; var glyphs = {}; for (var i = firstChar; i <= lastChar; i++) { - var glyph = differences[i] || baseEncoding[i]; + var glyph = differences[i]; + if (!glyph) { + glyph = baseEncoding[i]; + // skipping already specified by difference glyphs + if (differences.indexOf(glyph) >= 0) + continue; + } var index = GlyphsUnicode[glyph] || i; - var width = properties.widths[i] || properties.widths[glyph]; + var width = widths[i] || widths[glyph]; map[i] = { unicode: index, width: IsNum(width) ? width : properties.defaultWidth