-
Notifications
You must be signed in to change notification settings - Fork 44
Closed
Description
The objects in the arrays returned by getGlyphInfos() and getGlyphPositions() contain private properties: mask, var1, var2 and var respectively.
This makes these object cumbersome to work with in some cases. For example, in Fontra I want a single object per glyph, representing both glyph infos and positioning. I naively thought of doing that like this:
const glyphInfos = buffer.getGlyphInfos();
const glyphPositions = buffer.getGlyphPositions();
const glyphs = [];
for (let i = 0; i < glyphInfos.length; i++) {
glyphs.push({ ...glyphInfos[i], ...glyphPositions[i] });
}But that doesn't work for the private properties (that I need), because they are not enumerated with the spread syntax.
Ideally I'd really want a combined getGlyphInfos()/getGlyphPositions() api, equivalent to buffer.json(), but including the private fields. But even doing that externally is currently harder than needed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels