Skip to content

Instantly share code, notes, and snippets.

@denkspuren
Created October 21, 2014 11:59
Show Gist options
  • Save denkspuren/e9d7771213c5ca7f98f8 to your computer and use it in GitHub Desktop.
Save denkspuren/e9d7771213c5ca7f98f8 to your computer and use it in GitHub Desktop.
Costs of loading a font for use in text()
// textFont(createDefaultFont(12));
println(millis());
text("Hello World!",10,15);
println(millis());
text("Hello again!",10,35);
println(millis());
/*
On my console the output is:
196
3244
3245
Initial loading of the font takes some time.
Using textFont() first (see comment) creates the delay
before actually using text() the first time.
3259
3299
3300
Thanks for the analysis to Christopher!
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment