Skip to content

Commit 392ec79

Browse files
authored
Merge pull request #1097 from Flamenco/hotfix_ie_malformed_font
Update font regular expression to handle initial spaces and quotes
2 parents 4bf79f0 + 42d7f17 commit 392ec79

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

plugins/context2d.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@
299299
this.path = origPath;
300300
}
301301

302-
var scale;
303302
var scale;
304303
if (this.pdf.hotfix && this.pdf.hotfix.scale_text) {
305304
// We only use X axis as scale hint
@@ -355,7 +354,6 @@
355354
this.path = origPath;
356355
}
357356

358-
var scale;
359357
var scale;
360358
if (this.pdf.hotfix && this.pdf.hotfix.scale_text) {
361359
// We only use the X axis as scale hint
@@ -475,7 +473,7 @@
475473

476474
this.pdf.setFont(jsPdfFontName, style);
477475
} else {
478-
var rx = /(\d+)(pt|px|em)\s+(\w+)\s*(\w+)?/;
476+
var rx = /\s*(\d+)(pt|px|em)\s+([\w "]+)\s*([\w "]+)?/;
479477
var m = rx.exec(font);
480478
if (m != null) {
481479
var size = m[1];

0 commit comments

Comments
 (0)