mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Don't use shadow() for spaceWidth as otherwise sendering the font over to the mainthread causes issues if the worker used the property and the main thread tries to assign the spaceWidth to the getter function
This commit is contained in:
parent
fdb6a013c9
commit
36d358fff8
1 changed files with 6 additions and 1 deletions
|
@ -3181,6 +3181,10 @@ var Font = (function FontClosure() {
|
|||
},
|
||||
|
||||
get spaceWidth() {
|
||||
if (this._shadowWidth !== undefined) {
|
||||
return this._shadowWidth;
|
||||
}
|
||||
|
||||
// trying to estimate space character width
|
||||
var possibleSpaceReplacements = ['space', 'minus', 'one', 'i'];
|
||||
var width;
|
||||
|
@ -3208,7 +3212,8 @@ var Font = (function FontClosure() {
|
|||
break; // the non-zero width found
|
||||
}
|
||||
width = (width || this.defaultWidth) * this.widthMultiplier;
|
||||
return shadow(this, 'spaceWidth', width);
|
||||
this._shadowWidth = width;
|
||||
return width;
|
||||
},
|
||||
|
||||
charToGlyph: function Font_charToGlyph(charcode) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue