// Example that shows how to use Fonts, text sizes, and text alignment PFont arial;
void setup() { size(800, 600); background(255); noLoop(); // Create font arial = createFont("Arial", 36); textFont(arial); } // setup()
void draw() { background(0); fill(255, 117, 21); textSize(36); textAlign(CENTER, BOTTOM); float tw = textWidth("Happy Halloween!"); println("Width = " + tw); text("Happy Halloween!", width/2, height/2); noFill(); stroke(255); rect(width/2-tw/2, height/2-36, tw, 36); line(width/2, 0, width/2, height); } // draw()