MCPcopy Create free account
hub / github.com/processing/p5.js / create

Function create

src/type/p5.Font.js:1021–1036  ·  view source on GitHub ↗
(pInst, name, path, descriptors, rawFont)

Source from the content-addressed store, hash-verified

1019}
1020
1021async function create(pInst, name, path, descriptors, rawFont) {
1022
1023 let face = createFontFace(name, path, descriptors, rawFont);
1024
1025 // load if we need to
1026 if (face.status !== 'loaded') await face.load();
1027
1028 // add it to the document
1029 document.fonts.add(face);
1030
1031 // ensure the font is ready to be rendered
1032 await document.fonts.ready;
1033
1034 // return a new p5.Font
1035 return new Font(pInst, face, name, path, rawFont);
1036}
1037
1038
1039function sanitizeFontName(name) {

Callers 1

fontFunction · 0.85

Calls 2

createFontFaceFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected