// pacfont // -- a font experiment // // Scott "Jerry" Lawrence // http://www.cis.rit.edu/~jerry/Software/p5/ BFont myFont; void setup() { size( 200, 200 ); background( 0 ); noStroke(); hint(NONE); // set up our custom font myFont = loadFont( "pac.fbf" ); setFont( myFont ); } // just draw some text in the loop. nothing special there. void loop() { r(); cText( "Hello There!", 100, 40 ); r(); cText( "The font used for this", 100, 70 ); r(); cText( "sketch was converted", 100, 85 ); r(); cText( "from a .pgm image using", 100, 100 ); r(); cText( "a perl script included ", 100, 115 ); r(); cText( "in the .jar file.", 100, 130 ); r(); cText( "The readme.txt file", 100, 160 ); r(); cText( "explains how to make", 100, 175 ); r(); cText( "your own font too.", 100, 190 ); } // r and rc fill with a random brightish color void r() { fill( rc(), rc(), rc() ); } int rc() { return( 100 + (int) random(155) ); } // cText will center text horizontally on the [x] passed in void cText( String data, int x, int y ) { int w = 0; /* this doesn't work... for( int c=0 ; c