aho_09_text.pde
// To use this code, first use the "Sketch > Show sketch folder"
// menu command. Create a folder called "data" inside your sketch
// folder, then find the Processing root directory. In the "fonts"
// subdirectory you will find the files "Meta.vlw.gz" and
// "RotisSer.vlw.gz". Copy these to your "data" folder.
BFont fontRotis,fontMeta;
void setup() {
size(400,400);
background(200,240,255);
framerate(10);
fontMeta=loadFont("Meta.vlw.gz");
fontRotis=loadFont("RotisSer.vlw.gz");
}
void loop() {
background(200,240,255);
noStroke();
fill(0,100,150);
textFont(fontMeta,36);
text("This is Meta.\n"+
"abcdefghijklmnopqrstuvwxyz",20,50);
fill(0,40,60);
textFont(fontRotis,36);
text("This is Rotis Serif.\n"+
"abcdefghijklmnopqrstuvwxyz",20,122);
for(int i=0; i<10; i++) {
if(random(100)>50) textFont(fontMeta, random(18)+18);
else textFont(fontMeta, random(18)+18);
fill(60,30,0);
translate(20+random(300),200+random(150));
rotate(radians(random(60)-30));
text("Hello!",0,0);
}
}
|