Permalink
Browse files

rendering improved on high resolution devices like iPhone 4

  • Loading branch information...
michalkrause committed May 23, 2011
1 parent 735b29d commit 9a0000e7228b56c02cb0ec46c593e3b4dbdf8592
Showing with 6 additions and 0 deletions.
  1. +6 −0 js/cufon.js
View
@@ -1386,6 +1386,12 @@ Cufon.registerEngine('canvas', (function() {
}
var g = canvas.getContext('2d'), scale = height / viewBox.height;
+ var pixelRatio = window.devicePixelRatio || 1;
+ if (pixelRatio != 1) {
+ canvas.width = canvasWidth * pixelRatio;
+ canvas.height = canvasHeight * pixelRatio;
+ g.scale(pixelRatio, pixelRatio);
+ }
// proper horizontal scaling is performed later
g.scale(scale, scale * roundingFactor);

0 comments on commit 9a0000e

Please sign in to comment.