From: Vivien Nicolas <21@vingtetun.org> Date: Fri, 1 Jul 2011 01:39:55 +0000 (+0200) Subject: Merge branch 'master' of https://github.com/andreasgal/pdf.js X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=697aa0f15ebe66f5181854371159271332019525;p=pdf.js.git Merge branch 'master' of https://github.com/andreasgal/pdf.js --- 697aa0f15ebe66f5181854371159271332019525 diff --cc fonts.js index 0c6545f,9782fc9..a3cb05a --- a/fonts.js +++ b/fonts.js @@@ -34,11 -36,14 +36,14 @@@ var kDisableFonts = false * http://cgit.freedesktop.org/poppler/poppler/tree/poppler/GfxFont.cc#n65 */ -var Fonts = (function () { +var Fonts = (function Fonts() { var kScalePrecision = 40; - var fonts = Object.create(null); - var ctx = document.createElement("canvas").getContext("2d"); - ctx.scale(1 / kScalePrecision, 1); + var fonts = Object.create(null); + + if (!isWorker) { + var ctx = document.createElement("canvas").getContext("2d"); + ctx.scale(1 / kScalePrecision, 1); + } function Font(name, data, properties) { this.name = name;