xxxxxxxxxx
54
let myriad;
let gothic;
let grotesk;
let fontSize = 200;
let sample = .2;
let letterWidth = 0;
let letterHeight = 0;
let strokeInt = 0;
function preload() {
myriad = loadFont('MyriadPro-Bold.otf');
gothic = loadFont('gothic.otf');
grotesk = loadFont('grotesk.otf');
}
function setup() {
fill(255);
createCanvas(600, 600);
textFont(grotesk);
textSize(fontSize);
fill(0);
stroke(strokeInt);
strokeWeight(2);
}
function draw() {
//background(255);
let wordArray = grotesk.textToPoints('go.', width / 4, height / 2 + 50, fontSize, {
sampleFactor: sample
});
fontSize-=0.5;
if (fontSize == 0) {
fontSize = 200;
strokeInt = 0;
background(255);
}
for (let i = 0; i < wordArray.length; i++) {
letterWidth = random(-4,4);
letterHeight = random(-4,4);
rect(wordArray[i].x, wordArray[i].y, letterWidth, letterHeight);
//text('go.', width / 2 - 50, height / 2 + 50);
}
}