Skip to content

Instantly share code, notes, and snippets.

@notmasteryet
Created February 4, 2012 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notmasteryet/1739377 to your computer and use it in GitHub Desktop.
Save notmasteryet/1739377 to your computer and use it in GitHub Desktop.
Minimal test case for mininal font problem
<canvas id="c1"></canvas><br>
<script>
var c1 = document.getElementById("c1");
var ctx = c1.getContext("2d");
ctx.font = "12px serif";
ctx.fillText("test", 10, 25);
</script>
<canvas id="c2"></canvas><br>
<script>
var c2 = document.getElementById("c2");
var ctx = c2.getContext("2d");
ctx.font = "2px serif";
ctx.scale(6,6);
ctx.fillText("test", 10/6, 25/6);
</script>
<canvas id="c3"></canvas><br>
<script>
var c3 = document.getElementById("c3");
var ctx = c3.getContext("2d");
ctx.font = "0.2px serif";
ctx.scale(60,60);
ctx.fillText("test", 10/60, 25/60);
</script>
@notmasteryet
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment