xxxxxxxxxx
46
let myriad;
let gothic;
let grotesk;
let fontSize = 150;
let sample = .1;
let letterWidth = 1;
let letterHeight = 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(230,255,124);
stroke(210,255,104);
strokeWeight(2);
}
function draw() {
background(0);
let wordArray = gothic.textToPoints('what', width / 4, height / 2, fontSize, {
sampleFactor: sample
});
for (let i = 0; i < wordArray.length; i++) {
//letterWidth = random(-4,4);
letterHeight = i + random(-20,20);
rect(wordArray[i].x, wordArray[i].y, letterWidth, letterHeight);
text('what', width / 4, height / 2);
}
}