xxxxxxxxxx
82
let myFont;
let fontArray;
let sx = 0;
function preload(){
myFont = loadFont('Myriad.otf');
}
function setup() {
createCanvas(600, 600);
// colorMode(HSB);
textSize(180);
textFont(myFont); //loads font that has been uploaded
// blendMode(OVERLAY);
//frameRate(3);
}
function draw() {
background(255);
// blendMode(MULTIPLY);
// let fontArray = myFont.textToPoints("HOLO", 100
fontArray = myFont.textToPoints("HOLO",mouseX-300,mouseY );
//sampleFactor: 1
for ( let i =0; i < fontArray.length; i++){
strokeWeight(2);
stroke(255,0,0);
line(fontArray[i].x, fontArray[i].y, width/2+5, height+200);
}
fontArray = myFont.textToPoints("HOLO", mouseX-300,mouseY);
for ( let i =0; i < fontArray.length; i++){
strokeWeight(2);
stroke(0,0,255);
line(fontArray[i].x, fontArray[i].y, width/2, height+200);
}
fontArray = myFont.textToPoints("HOLO", mouseX-300,mouseY);
for ( let i =0; i < fontArray.length; i++){
stroke(0,0,255);
strokeWeight(2);
line(fontArray[i].x, fontArray[i].y, width/2-5, -200 )
}
fontArray = myFont.textToPoints("HOLO", mouseX-300,mouseY);
for ( let i =0; i < fontArray.length; i++){
stroke(255,0,0);
strokeWeight(2);
line(fontArray[i].x, fontArray[i].y, width/2, -200 )
}
fontArray = myFont.textToPoints("HOLO", mouseX-300,mouseY);
// sampleFactor: 0.1
// for ( let i =0; i < fontArray.length; i++){
// stroke(0);
// fill(0);
// strokeWeight(.2);
// ellipse(fontArray[i].x, fontArray[i].y, 2.5, 10 )
// }
}