diff --git a/src/core/fonts.js b/src/core/fonts.js index 391ce45db..00a721aa9 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -3158,10 +3158,6 @@ var Font = (function FontClosure() { }, get spaceWidth() { - if ("_shadowWidth" in this) { - return this._shadowWidth; - } - // trying to estimate space character width var possibleSpaceReplacements = ["space", "minus", "one", "i", "I"]; var width; @@ -3176,10 +3172,8 @@ var Font = (function FontClosure() { var glyphUnicode = glyphsUnicodeMap[glyphName]; // finding the charcode via unicodeToCID map var charcode = 0; - if (this.composite) { - if (this.cMap.contains(glyphUnicode)) { - charcode = this.cMap.lookup(glyphUnicode); - } + if (this.composite && this.cMap.contains(glyphUnicode)) { + charcode = this.cMap.lookup(glyphUnicode); } // ... via toUnicode map if (!charcode && this.toUnicode) { @@ -3196,10 +3190,7 @@ var Font = (function FontClosure() { } } width = width || this.defaultWidth; - // Do not shadow the property here. See discussion: - // https://github.com/mozilla/pdf.js/pull/2127#discussion_r1662280 - this._shadowWidth = width; - return width; + return shadow(this, "spaceWidth", width); }, charToGlyph: function Font_charToGlyph(charcode, isSpace) {