mirror of
https://github.com/multipleof4/stain.otf.git
synced 2026-01-14 00:27:55 +00:00
Feat: Add basic author metadata to font
This commit is contained in:
@@ -36,6 +36,7 @@ const outDir = path.join(__dirname, "..", "dist");
|
||||
if(!fs.existsSync(outDir))fs.mkdirSync(outDir,{recursive:true});
|
||||
|
||||
const familyName="Stain";
|
||||
const styleName="Regular";
|
||||
const unitsPerEm=1000;
|
||||
const ascender=800;
|
||||
const descender=-200;
|
||||
@@ -49,8 +50,9 @@ const mkGlyph = (name, unicode, adv, pathFn) =>
|
||||
path:pathFn(new opentype.Path())
|
||||
});
|
||||
|
||||
const glyphSpace = mkGlyph("space", " ".codePointAt(0), 260, (p) => p);
|
||||
const glyphPeriod = mkGlyph("period", ".".codePointAt(0), 260, (p) => {
|
||||
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);
|
||||
@@ -118,11 +120,12 @@ const glyphList = [
|
||||
|
||||
const font=new opentype.Font({
|
||||
familyName,
|
||||
styleName: "Regular",
|
||||
styleName,
|
||||
unitsPerEm,
|
||||
ascender,
|
||||
descender,
|
||||
glyphs: glyphList
|
||||
glyphs:glyphList,
|
||||
copyright:"Author: Anon"
|
||||
});
|
||||
|
||||
const buf=Buffer.from(font.toArrayBuffer());
|
||||
|
||||
Reference in New Issue
Block a user