From: notmasteryet Date: Tue, 11 Oct 2011 02:14:40 +0000 (-0500) Subject: Fixing standard font name resolution (#649) X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=04e467793b79f8403d499748dc33f1f9f58ee09f;p=pdf.js.git Fixing standard font name resolution (#649) --- diff --git a/fonts.js b/fonts.js index 2ab3a90..7aef5ec 100644 --- a/fonts.js +++ b/fonts.js @@ -441,7 +441,7 @@ var Font = (function Font() { if (!file) { // The file data is not specified. Trying to fix the font name // to be used with the canvas.font. - var fontName = stdFontMap[name] || name.replace('_', '-'); + var fontName = stdFontMap[name.replace('-', '_')] || name.replace('_', '-'); this.bold = (fontName.search(/bold/gi) != -1); this.italic = (fontName.search(/oblique/gi) != -1) || (fontName.search(/italic/gi) != -1);