]> git.parisson.com Git - pdf.js.git/commitdiff
type3 font.coded comment; proper geometery for showText; glyph name
authornotmasteryet <async.processingjs@yahoo.com>
Wed, 14 Dec 2011 00:28:02 +0000 (18:28 -0600)
committernotmasteryet <async.processingjs@yahoo.com>
Wed, 14 Dec 2011 00:28:02 +0000 (18:28 -0600)
src/canvas.js
src/fonts.js

index 5005d6e2347fad92eb33adf9bc5a1eba878b3904..4aaf75508f4e0eb0d946b01a0902e364c7b07e4f 100644 (file)
@@ -687,8 +687,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
 
         if (textSelection) {
           this.save();
-          ctx.scale(fontSize, fontSize);
-          ctx.transform.apply(ctx, fontMatrix);
+          ctx.scale(1, -1);
           text.geom = this.getTextGeometry();
           this.restore();
         }
@@ -785,6 +784,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
 
       if (textSelection) {
         ctx.save();
+        // Type3 fonts - each glyph is a "mini-PDF" (see also showText)
         if (font.coded) {
           ctx.transform.apply(ctx, current.textMatrix);
           ctx.scale(1, -1);
index 731363a67abb4437dbbc4c41dbddcfc9c4f7ceed..83ce4abaabd4488dd8d16cfec079c46ece79204c 100644 (file)
@@ -2103,7 +2103,7 @@ var Font = (function FontClosure() {
 
     get spaceWidth() {
       // trying to estimate space character width
-      var possibleSpaceReplacements = ['space', 'minus', '1', 'i'];
+      var possibleSpaceReplacements = ['space', 'minus', 'one', 'i'];
       var width;
       for (var i = 0, ii = possibleSpaceReplacements.length; i < ii; i++) {
         var glyphName = possibleSpaceReplacements[i];