]> git.parisson.com Git - pdf.js.git/commitdiff
Merge branch 'refs/heads/master' into issue-1049
authorArtur Adib <arturadib@gmail.com>
Tue, 31 Jan 2012 18:20:05 +0000 (13:20 -0500)
committerArtur Adib <arturadib@gmail.com>
Tue, 31 Jan 2012 18:20:05 +0000 (13:20 -0500)
Conflicts:
src/canvas.js

1  2 
src/canvas.js
src/fonts.js
src/util.js
src/worker.js
test/test_manifest.json
web/viewer.js

diff --cc src/canvas.js
index 0a73e034c028d2cec8dc4aef9b87cd82e7899e4f,d0b0064f6b1d98ce6cecf8113266dbd613dbd086..f4815a655a1b677f9992205f64169bb98350af6b
@@@ -547,32 -546,12 +547,32 @@@ var CanvasGraphics = (function CanvasGr
      },
      setFont: function canvasGraphicsSetFont(fontRefName, size) {
        var fontObj = this.objs.get(fontRefName).fontObj;
 +      var current = this.current;
  
 -      if (!fontObj) {
 +      if (!fontObj)
-         throw 'Can\'t find font for ' + fontRefName;
+         error('Can\'t find font for ' + fontRefName);
 +
 +      // Slice-clone matrix so we can manipulate it without affecting original
 +      if (fontObj.fontMatrix)
 +        current.fontMatrix = fontObj.fontMatrix.slice(0);
 +      else
 +        current.fontMatrix = IDENTITY_MATRIX.slice(0);
 +
 +      // A valid matrix needs all main diagonal elements to be non-zero
 +      // This also ensures we bypass FF bugzilla bug #719844.
 +      if (current.fontMatrix[0] === 0 ||
 +          current.fontMatrix[3] === 0) {
 +        warn('Invalid font matrix for font ' + fontRefName);
        }
  
 -      var name = fontObj.loadedName || 'sans-serif';
 +      // The spec for Tf (setFont) says that 'size' specifies the font 'scale',
 +      // and in some docs this can be negative (inverted x-y axes).
 +      // We implement this condition with fontMatrix.
 +      if (size < 0) {
 +        size = -size;
 +        current.fontMatrix[0] *= -1;
 +        current.fontMatrix[3] *= -1;
 +      }
  
        this.current.font = fontObj;
        this.current.fontSize = size;
diff --cc src/fonts.js
Simple merge
diff --cc src/util.js
Simple merge
diff --cc src/worker.js
Simple merge
Simple merge
diff --cc web/viewer.js
Simple merge