mirror of
https://github.com/multipleof4/stain.otf.git
synced 2026-01-14 00:27:55 +00:00
Fix: ensure space/period glyphs added
This commit is contained in:
@@ -41,7 +41,27 @@ const ascender = 800;
|
|||||||
const descender = -200;
|
const descender = -200;
|
||||||
const defaultAdv = 600;
|
const defaultAdv = 600;
|
||||||
|
|
||||||
|
const mkGlyph = (name, unicode, adv, pathFn) =>
|
||||||
|
new opentype.Glyph({
|
||||||
|
name,
|
||||||
|
unicode,
|
||||||
|
advanceWidth: adv,
|
||||||
|
path: pathFn(new opentype.Path())
|
||||||
|
});
|
||||||
|
|
||||||
|
const glyphSpace = mkGlyph("space", " ".codePointAt(0), 260, (p) => p);
|
||||||
|
const glyphPeriod = mkGlyph("period", ".".codePointAt(0), 260, (p) => {
|
||||||
|
p.moveTo(80, 0);
|
||||||
|
p.lineTo(80, 120);
|
||||||
|
p.lineTo(180, 120);
|
||||||
|
p.lineTo(180, 0);
|
||||||
|
p.close();
|
||||||
|
return p;
|
||||||
|
});
|
||||||
|
|
||||||
const glyphList = [
|
const glyphList = [
|
||||||
|
glyphSpace,
|
||||||
|
glyphPeriod,
|
||||||
glyphA(opentype, defaultAdv),
|
glyphA(opentype, defaultAdv),
|
||||||
glypha(opentype, defaultAdv),
|
glypha(opentype, defaultAdv),
|
||||||
glyphB(opentype, defaultAdv),
|
glyphB(opentype, defaultAdv),
|
||||||
|
|||||||
Reference in New Issue
Block a user