]> git.parisson.com Git - pdf.js.git/commitdiff
Merge branch 'master' of https://github.com/andreasgal/pdf.js
authorVivien Nicolas <21@vingtetun.org>
Fri, 1 Jul 2011 01:39:55 +0000 (03:39 +0200)
committerVivien Nicolas <21@vingtetun.org>
Fri, 1 Jul 2011 01:39:55 +0000 (03:39 +0200)
1  2 
fonts.js

diff --cc fonts.js
index 0c6545f0c2cc6de3eb357114ccc987fd228b5932,9782fc9a1ceaeb791db79c0b408d9af008793a64..a3cb05a9fcfe481e16b871a19c60e2407c93d6e5
+++ 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;