Improved patch for high resolution devices #185

Merged
merged 1 commit into from May 24, 2011
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);