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