Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Improved patch for high resolution devices #185

Merged
merged 1 commit into from

2 participants

Michal Krause Simo Kinnunen
Michal Krause

Latest version of highres device rendering patch - hope you'll be happy with it :)

Simo Kinnunen sorccu merged commit 87045f4 into from
Simo Kinnunen
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 0 deletions.
  1. +6 −0 js/cufon.js
6 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);
Something went wrong with that request. Please try again.