...
| Code Block |
|---|
PFont font;
size(200, 200);
String[] fontList = PFont.list();
printArray(fontList); // print out a list of all system fonts available.
font = createFont("Trebuchetcomic-BoldItalicsans", 5032);
textFont(font);
text("wordI (heart) Helvetica", 10, 50);
|
Font can be saved within the sketch folder to, incase the font isn't installed on the computer running the sketch.
| Code Block |
|---|
PFont font; // the .ttf file should be locatedsaved in the sketch folder font = createFont("comic-sans.ttf", 32); textFont(font, 32); text("word", 10, 50); textSize(70); text("I (heart) Helvetica"word", 10, 100); |
Alternatively fonts can be saved in a bitmap format that Processing uses.
| Code Block |
|---|
PFont font; size(200, 200); background(0); // The vlw file should be saved in the sketch folder font = loadFont("Trebuchet-BoldItalic-32.vlw"); textFont(font, 32); text("word", 10, 50); textSize(70); text("word", 10, 100); |