xxxxxxxxxx
34
let font;
let th;
function preload() {
font = loadFont('IBMPlexMono.ttf');
}
function setup() {
createCanvas(400, 400);
textFont(font);
textSize(22);
th = textAscent() + textDescent();
print(textWidth(" "), th);
print(textLeading());
}
function draw() {
background(220);
noStroke();
for(let i = 0; i < 14; i++) {
fill(i * 19);
rect(i * textWidth(" "), 0, textWidth(" "), th);
fill(255 - i * 19);
rect(i * textWidth(" "), th, textWidth(" "), th);
fill(i * 19);
rect(i * textWidth(" "), 2*th, textWidth(" "), th);
}
fill(255);
rect(100, 130 - textAscent(), textWidth(" ") * 4, th);
fill(0);
text("hello, world!\n!#>}o, world2!\nasdinasdionfk", 0, textAscent());
text("Abcd", 100, 130);
}