Skip to content
This repository

Improved patch for high resolution devices #185

Merged
merged 1 commit into from about 3 years ago

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 sorccu closed this
Simo Kinnunen
Owner
sorccu commented
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

May 23, 2011
Michal Krause michalkrause rendering improved on high resolution devices like iPhone 4 9a0000e
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. +6 0 js/cufon.js
6 js/cufon.js
@@ -1386,6 +1386,12 @@ Cufon.registerEngine('canvas', (function() {
1386 1386 }
1387 1387
1388 1388 var g = canvas.getContext('2d'), scale = height / viewBox.height;
  1389 + var pixelRatio = window.devicePixelRatio || 1;
  1390 + if (pixelRatio != 1) {
  1391 + canvas.width = canvasWidth * pixelRatio;
  1392 + canvas.height = canvasHeight * pixelRatio;
  1393 + g.scale(pixelRatio, pixelRatio);
  1394 + }
1389 1395
1390 1396 // proper horizontal scaling is performed later
1391 1397 g.scale(scale, scale * roundingFactor);

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.