xxxxxxxxxx
41
/*
This template shows where to install fonts.
Click the index.html file and put the font embed links in the <head> font link </head> tag there.
*/
function setup() {
createCanvas(600, 400);
//Once the font is linked to the p5js sketch
//use textFont() to use it in the sketch
textFont('Turret Road')
}
function draw() {
background(220);
textSize(20)
// visualize text wrapping in a rectangle
//rect(50, 10, 400, 200)
text('A \nB C \nD E F \nG H I J \n\'K\' \nL M N O \\P \nQ R S T U V W \nX Y Z - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ', 50, 10, 400, 200)
/*
text('words',x,y)
\n breaks the text to new line
\ allows you insert special characters within the text
Notice \ was used many times below to escape extra quotation ' within the text
*/
// textSize(18)
// text('Juliet: \'Tis but thy name that is my enemy. \n Thou art thyself, though not a Montague. \n What\'s Montague? it is nor hand, nor foot, \n Nor arm, nor face, nor any other part \n Belonging to a man. O, be some other name! \n What\'s in a name? That which we call a rose \n By any other name would smell as sweet.\n So Romeo would, were he not Romeo call\'d,\n Retain that dear perfection which he owes \n Without that title. Romeo, doff thy name; \n\n ----- from Romeo and Juliet by Shakespeare', 50, 100, 500, 300);
}