samsa-core

Samsa docs

SamsaGlyph object

Description

The SamsaGlyph object represents a glyph as either:

Constructor

SamsaGlyph()

Instance properties

Instance methods

Examples

// display the array of points for the glyph for the character "A"
const nodeBuffer = fs.readFileSync(filename);
const arrayBuffer = nodeBuffer.buffer;
const samsaBuffer = new SamsaBuffer(arrayBuffer);
const font = new SamsaFont(samsaBuffer);
const string = "A";
const glyphId = font.glyphIdFromUnicode(string.codePointAt(0));
const glyph = font.loadGlyphById(glyphId);
console.log(glyph.points);