From 42d7f17a86848408bba6d9345994cc5754b8ae8a Mon Sep 17 00:00:00 2001 From: Steven Spungin Date: Wed, 15 Mar 2017 13:39:57 -0400 Subject: [PATCH] Update font regular expression to handle more combinations --- plugins/context2d.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/context2d.js b/plugins/context2d.js index e97122a9b..918626e00 100644 --- a/plugins/context2d.js +++ b/plugins/context2d.js @@ -299,7 +299,6 @@ this.path = origPath; } - var scale; var scale; if (this.pdf.hotfix && this.pdf.hotfix.scale_text) { // We only use X axis as scale hint @@ -355,7 +354,6 @@ this.path = origPath; } - var scale; var scale; if (this.pdf.hotfix && this.pdf.hotfix.scale_text) { // We only use the X axis as scale hint @@ -475,7 +473,7 @@ this.pdf.setFont(jsPdfFontName, style); } else { - var rx = /(\d+)(pt|px|em)\s+(\w+)\s*(\w+)?/; + var rx = /\s*(\d+)(pt|px|em)\s+([\w "]+)\s*([\w "]+)?/; var m = rx.exec(font); if (m != null) { var size = m[1];