TUTORIAL QUICK LINKS



Letter Design by Yeohyun Ahn and layout design by John Page Corrigan by using Ricard Marxer's Caligraft


How to Repeat
:
We use the function for( ) to create a series of repetitions, here, a repetitive horizontal line formed by an uppercase letter “T”. The distance between each letter is even and controlled by the values we add to for( ). The for() function needs a beginning, middle and end, called: for(initiate; test; update), which are divided by a semicolon (;). In this case, initiate is the beginning point (i equals 0 i=0), test sees if the value of i is less than 250 i<250, if it is, the function then goes to update, to which we have given the value of i equals i plus 5 i=i+5, so the value of i is increased by 5. By using this changing value i, we can have the letter “T” displayed 5 pixels apart across the screen. We need to use the text() function to do this text(”T”, i,40). This calls the letter “T” and uses the variable i to control the x coordinate, while the y coordinate has a constant value of 40, creating a horizontal line running off the canvas size window, which is 250 by 250 pixels. The y coordinate value places the line of “T”s high up on the canvas.



PFont myFont;
void setup()
{
size(250,250);
myFont = createFont("Univers",48);
textFont(myFont,10);
background(255);
//for(initiate;test;update)
for(int i=0;i<250;i=i+5)
{
fill(0,0,0);
//textFont(font,size)
textFont(myFont, 22);
//text(letter,i:x ,40:y)
text("T",i,40);
}
}

For more information: the book, TYPE+CODE Processing for Graphic designers.