1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Merge pull request #2127 from jviereck/text-algo-3

Use the text extracted in the getTextContent function for the divs of the textLayer.
This commit is contained in:
Julian Viereck 2012-09-25 05:52:46 -07:00
commit e98eba1b11
7 changed files with 233 additions and 96 deletions

View file

@ -3886,6 +3886,10 @@ 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'];
var width;
@ -3913,7 +3917,10 @@ var Font = (function FontClosure() {
break; // the non-zero width found
}
width = (width || this.defaultWidth) * this.widthMultiplier;
return shadow(this, 'spaceWidth', width);
// Do not shadow the property here. See discussion:
// https://github.com/mozilla/pdf.js/pull/2127#discussion_r1662280
this._shadowWidth = width;
return width;
},
charToGlyph: function Font_charToGlyph(charcode) {