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