MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / appendOutlineFont

Method appendOutlineFont

tools/mcmanifest.js:2293–2308  ·  view source on GitHub ↗
(name, path, include, suffix, query)

Source from the content-addressed store, hash-verified

2291 this.count++;
2292 }
2293 appendOutlineFont(name, path, include, suffix, query) {
2294 const tool = this.tool;
2295 let file = this.appendFile(tool.outlineFontFiles, name + ".fnt", path, include);
2296 if (!file)
2297 file = tool.outlineFontFiles.find(file => file.source == path);
2298
2299 const face = {...query, suffix, name: query.name ?? name};
2300 if (!face.size)
2301 throw new Error(`missing required font size for "${face.name}"`);
2302
2303 if (file.faces?.find(item => (item.size === face.size) && (item.name === face.name)))
2304 throw new Error(`duplicate font "${face.name}", size ${face.size}`);
2305
2306 file.faces ??= [];
2307 file.faces.push(face);
2308 }
2309 appendSound(name, path, include, suffix) {
2310 var tool = this.tool;
2311 this.appendFile(tool.soundFiles, name + ".maud", path, include);

Callers 1

appendSourceMethod · 0.95

Calls 3

findMethod · 0.80
appendFileMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected