xxxxxxxxxx
39
var fontfile = "data/knewave.otf";
var font;
function preload() {
font = loadFont(fontfile);
}
function setup() {
createCanvas(200, 200);
textFont(font);
}
function draw() {
background(200, 200, 0);
draw_fps();
draw_text();
}
function draw_fps() {
push();
textSize(15);
fill(0,0,200);
noStroke();
text(nf(frameRate(), 1, 1) + " fps", width-70, 20);
pop();
}
function draw_text() {
push();
textSize(20);
text("file: \nknewave.otf",20,20);
textSize(50);
stroke(200, 0, 0);
strokeWeight(8); // comes out as about half of it
fill(0, 200, 0);
textAlign(CENTER, CENTER);
text("T E S T", width / 2, height / 2);
pop();
}