Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #185 from michal-krause/master

Improved rendering on high resolution devices (e.g. iPhone 4).
  • Loading branch information...
commit 87045f418bef9f8705580f835f14fccb8019adeb 2 parents 735b29d + 9a0000e
@sorccu authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 js/cufon.js
View
6 js/cufon.js
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.