mirror of
https://github.com/multipleof4/stain.otf.git
synced 2026-01-13 16:17:55 +00:00
Fix: Use glyphs array instead of addGlyph
This commit is contained in:
@@ -18,24 +18,24 @@ const ascender = 800;
|
||||
const descender = -200;
|
||||
const advanceWidth = 600;
|
||||
|
||||
const glyphs = [
|
||||
glyphA(opentype, advanceWidth),
|
||||
glypha(opentype, advanceWidth),
|
||||
glyphB(opentype, advanceWidth),
|
||||
glyphb(opentype, advanceWidth),
|
||||
glyphC(opentype, advanceWidth),
|
||||
glyphc(opentype, advanceWidth)
|
||||
];
|
||||
|
||||
const font = new opentype.Font({
|
||||
familyName,
|
||||
styleName: "Regular",
|
||||
unitsPerEm,
|
||||
ascender,
|
||||
descender,
|
||||
glyphs: []
|
||||
glyphs
|
||||
});
|
||||
|
||||
const addGlyph = (g) => font.addGlyph(g);
|
||||
|
||||
addGlyph(glyphA(opentype, advanceWidth));
|
||||
addGlyph(glypha(opentype, advanceWidth));
|
||||
addGlyph(glyphB(opentype, advanceWidth));
|
||||
addGlyph(glyphb(opentype, advanceWidth));
|
||||
addGlyph(glyphC(opentype, advanceWidth));
|
||||
addGlyph(glyphc(opentype, advanceWidth));
|
||||
|
||||
const otfBuffer = Buffer.from(font.toArrayBuffer());
|
||||
const baseName = "Stain";
|
||||
const otfPath = path.join(outDir, `${baseName}.otf`);
|
||||
|
||||
Reference in New Issue
Block a user