MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / ttfGlyphLoader

Function ttfGlyphLoader

libraries/p5.js:2170–2183  ·  view source on GitHub ↗

* Generate a stub glyph that can be filled with all metadata *except* * the "points" and "path" properties, which must be loaded only once * the glyph's path is actually requested for text shaping.

(font, index, parseGlyph, data, position, buildPath)

Source from the content-addressed store, hash-verified

2168 */
2169
2170function ttfGlyphLoader(font, index, parseGlyph, data, position, buildPath) {
2171 return function() {
2172 var glyph = new _glyph.Glyph({index: index, font: font});
2173
2174 glyph.path = function() {
2175 parseGlyph(glyph, data, position);
2176 var path = buildPath(font.glyphs, glyph);
2177 path.unitsPerEm = font.unitsPerEm;
2178 return path;
2179 };
2180
2181 return glyph;
2182 };
2183}
2184
2185function cffGlyphLoader(font, index, parseCFFCharstring, charstring) {
2186 return function() {

Callers

nothing calls this directly

Calls 2

parseGlyphFunction · 0.85
buildPathFunction · 0.85

Tested by

no test coverage detected