diff --git a/fonts.js b/fonts.js index 728bc5c68..381d37c09 100644 --- a/fonts.js +++ b/fonts.js @@ -64,8 +64,15 @@ var Fonts = { var unicode = encoding[charcode]; // Check if the glyph has already been converted - if (unicode instanceof Name) - unicode = encoding[unicode] = GlyphsUnicode[unicode.name]; + // if (unicode instanceof Name) + try { + if (!IsNum(unicode)) + // if ("name" in unicode) + unicode = encoding[unicode] = GlyphsUnicode[unicode.name]; + + } catch(e) { + console.log("FAIL"); + } // Handle surrogate pairs if (unicode > 0xFFFF) { @@ -165,6 +172,7 @@ var Font = (function () { warn("Font " + properties.type + " is not supported"); break; } + this.data = data; Fonts[name] = { data: data, diff --git a/pdf.js b/pdf.js index 3179f42ec..27ccc6c10 100644 --- a/pdf.js +++ b/pdf.js @@ -3819,6 +3819,9 @@ var CanvasGraphics = (function() { this.current.fontSize = size; this.ctx.font = this.current.fontSize +'px "' + fontName + '", Symbol'; + if (this.ctx.$setFont) { + this.ctx.$setFont(fontName); + } }, setTextRenderingMode: function(mode) { TODO("text rendering mode"); diff --git a/viewer_worker.html b/viewer_worker.html index 6443b22c1..fe3319d62 100644 --- a/viewer_worker.html +++ b/viewer_worker.html @@ -1,6 +1,9 @@ Simple pdf.js page worker viewer + + +