Created
October 23, 2011 04:37
-
-
Save notlion/1306882 to your computer and use it in GitHub Desktop.
Test case for Plask font cache issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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