xxxxxxxxxx
37
let font;
let fSize // font size
let points = [] // store path data
let yoff = 0;
let xoff = 0;
function preload() {
font = loadFont("fonts/Roboto-Bold.ttf");
}
function setup() {
createCanvas(800, 500)
points = font.textToPoints("HELLO", 0, 0, 250, {
sampleFactor: 0.2, // increase for more points
simplifyThreshold: 0.0 // increase to remove collinear points
})
}
function draw() {
background(220);
translate(20, 300);
fill(255);
// noFill();
beginShape();
// xoff = 0;
for(let i =0; i< points.length; i++){
let offset = map(noise(xoff + yoff), 0, 1, -50, 50);
// vertex(points[i].x + offset, points[i].y + offset);
vertex(points[i].x, points[i].y);
// xoff += 0.1;
}
endShape();
// yoff += 0.01;
}