xxxxxxxxxx
45
let myriad;
let gothic;
let grotesk;
const fontSize = 200;
let sample = 0.2;
let letterWidth = 0;
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(grotesk);
textSize(fontSize);
fill(0);
stroke(200);
strokeWeight(2);
}
function draw() {
background(255);
let wordArray = grotesk.textToPoints('go.', width / 2, height / 2 + 30, fontSize, {
sampleFactor: sample
});
for (let i = 0; i < wordArray.length; i++) {
letterWidth = random(-2,2);
letterHeight = random(-2,2);
rect(wordArray[i].x, wordArray[i].y, letterWidth, letterHeight);
text('go.', width / 2 - 50, height / 2 + 50);
}
}