Skip to content

Commit

Permalink
prototype ttp
Browse files Browse the repository at this point in the history
  • Loading branch information
dhowe committed Nov 19, 2024
1 parent 19f9a82 commit 9cdb0aa
Show file tree
Hide file tree
Showing 4 changed files with 3,091 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/type/p5.Font.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,28 @@ function font(p5, fn) {
return await Array.from(document.fonts);
}

constructor(p, name, path, descriptors) { // remove p
constructor(p, font, name, path) { // remove p
//console.log('p5.Font', 'constructor', name, path, descriptors);
this.pInst = p;
this.font = font;
this.name = name;
this.path = path;

// if (name instanceof FontFace) {
// this.font = name;
// this.name = name.family;
// this.path = name.src;
// return;
// }
// if (!path.startsWith('url(')) {
// path = `url(${path})`; // hmm
// }
// this.name = name;
// this.path = path;
// this.font = new FontFace(name, path, descriptors);
}

constructorx(p, name, path, descriptors) { // remove p
//console.log('p5.Font', 'constructor', name, path, descriptors);
if (!(p instanceof p5)) {
throw Error('p5 instance is required');
Expand Down
Loading

0 comments on commit 9cdb0aa

Please sign in to comment.