Skip to content

Instantly share code, notes, and snippets.

@notlion
Created October 23, 2011 04:37
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 notlion/1306882 to your computer and use it in GitHub Desktop.
Save notlion/1306882 to your computer and use it in GitHub Desktop.
Test case for Plask font cache issue
var chars = "abcdefghijklmnopqrstuvwxyz";
require("plask").simpleWindow({
init: function(){
this.paint.setFontFamily("Myriad Pro");
this.paint.setColor(255, 255, 255);
this.canvas.drawColor(0, 0, 0);
this.framerate(60);
},
draw: function(){
for(var i = 10; --i >= 0;){
this.paint.setTextSize(Math.random() * 20 + 10);
this.canvas.drawText(
this.paint,
chars.substr(Math.floor(Math.random() * chars.length), 1),
Math.random() * this.width,
Math.random() * this.height
);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment