Skip to content

Commit be90be8

Browse files
committed
Grab last font to match Google Font conventions
1 parent 3f910f6 commit be90be8

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/type/p5.Font.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,17 +1033,13 @@ function font(p5, fn) {
10331033
}
10341034
fontData = await fn.parseFontData(url);
10351035
}
1036-
} catch (_e) {
1037-
console.log(
1038-
'This font can only be drawn and will not work with textToPoints/Contours/Model.'
1039-
);
1040-
}
1036+
} catch (_e) {}
10411037
return create(this, name, src, fontDescriptors, fontData)
10421038
})());
10431039
}
10441040
}
10451041
const fonts = await Promise.all(fontPromises);
1046-
return fonts.find(f => f.data) || fonts[0]; // TODO: handle multiple faces?
1042+
return fonts.findLast(f => f.data) || fonts[0]; // TODO: handle multiple faces?
10471043
}
10481044

10491045
let pfont;

0 commit comments

Comments
 (0)