mirror of
https://github.com/multipleof4/stain.otf.git
synced 2026-01-14 00:27:55 +00:00
Fix: Rename glyphs array to glyphList
This commit is contained in:
@@ -20,13 +20,13 @@ import { glyphO, glypho } from "../src/glyphs/O.js";
|
|||||||
import { glyphP, glyphp } from "../src/glyphs/P.js";
|
import { glyphP, glyphp } from "../src/glyphs/P.js";
|
||||||
import { glyphQ, glyphq } from "../src/glyphs/Q.js";
|
import { glyphQ, glyphq } from "../src/glyphs/Q.js";
|
||||||
import { glyphR, glyphr } from "../src/glyphs/R.js";
|
import { glyphR, glyphr } from "../src/glyphs/R.js";
|
||||||
import { glyphS, glyphs } from "../src/glyphs/S.js";
|
import { glyphS, glyphs as glyphsLowerS } from "../src/glyphs/S.js";
|
||||||
import { glyphT, glypht } from "../src/glyphs/T.js";
|
import { glyphT, glypht } from "../src/glyphs/T.js";
|
||||||
import { glyphU, glyphu } from "../src/glyphs/U.js";
|
import { glyphU, glyphu } from "../src/glyphs/U.js";
|
||||||
import { glyphV, glyphv } from "../src/glyphs/V.js";
|
import { glyphV, glyphv } from "../src/glyphs/V.js";
|
||||||
import { glyphW, glyphw } from "../src/glyphs/W.js";
|
import { glyphW, glyphw } from "../src/glyphs/W.js";
|
||||||
import { glyphX, glyphx } from "../src/glyphs/X.js";
|
import { glyphX, glyphx } from "../src/glyphs/X.js";
|
||||||
import { glyphY, glyphy } from "../src/glyphs/Y.js";
|
import { glyphY, glypthy as glyphy } from "../src/glyphs/Y.js";
|
||||||
import { glyphZ, glyphz } from "../src/glyphs/Z.js";
|
import { glyphZ, glyphz } from "../src/glyphs/Z.js";
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
@@ -39,61 +39,61 @@ const familyName = "Stain";
|
|||||||
const unitsPerEm = 1000;
|
const unitsPerEm = 1000;
|
||||||
const ascender = 800;
|
const ascender = 800;
|
||||||
const descender = -200;
|
const descender = -200;
|
||||||
const advanceWidth = 600;
|
const defaultAdv = 600;
|
||||||
|
|
||||||
const glyphs = [
|
const glyphList = [
|
||||||
glyphA(opentype, advanceWidth),
|
glyphA(opentype, defaultAdv),
|
||||||
glypha(opentype, advanceWidth),
|
glypha(opentype, defaultAdv),
|
||||||
glyphB(opentype, advanceWidth),
|
glyphB(opentype, defaultAdv),
|
||||||
glyphb(opentype, advanceWidth),
|
glyphb(opentype, defaultAdv),
|
||||||
glyphC(opentype, advanceWidth),
|
glyphC(opentype, defaultAdv),
|
||||||
glyphc(opentype, advanceWidth),
|
glyphc(opentype, defaultAdv),
|
||||||
glyphD(opentype, advanceWidth),
|
glyphD(opentype, defaultAdv),
|
||||||
glyphd(opentype, advanceWidth),
|
glyphd(opentype, defaultAdv),
|
||||||
glyphE(opentype, advanceWidth),
|
glyphE(opentype, defaultAdv),
|
||||||
glyphe(opentype, advanceWidth),
|
glyphe(opentype, defaultAdv),
|
||||||
glyphF(opentype, advanceWidth),
|
glyphF(opentype, defaultAdv),
|
||||||
glyphf(opentype, advanceWidth),
|
glyphf(opentype, defaultAdv),
|
||||||
glyphG(opentype, advanceWidth),
|
glyphG(opentype, defaultAdv),
|
||||||
glyphg(opentype, advanceWidth),
|
glyphg(opentype, defaultAdv),
|
||||||
glyphH(opentype, advanceWidth),
|
glyphH(opentype, defaultAdv),
|
||||||
glyphh(opentype, advanceWidth),
|
glyphh(opentype, defaultAdv),
|
||||||
glyphI(opentype, advanceWidth),
|
glyphI(opentype, defaultAdv),
|
||||||
glyphi(opentype, advanceWidth),
|
glyphi(opentype, defaultAdv),
|
||||||
glyphJ(opentype, advanceWidth),
|
glyphJ(opentype, defaultAdv),
|
||||||
glyphj(opentype, advanceWidth),
|
glyphj(opentype, defaultAdv),
|
||||||
glyphK(opentype, advanceWidth),
|
glyphK(opentype, defaultAdv),
|
||||||
glyphk(opentype, advanceWidth),
|
glyphk(opentype, defaultAdv),
|
||||||
glyphL(opentype, advanceWidth),
|
glyphL(opentype, defaultAdv),
|
||||||
glyphl(opentype, advanceWidth),
|
glyphl(opentype, defaultAdv),
|
||||||
glyphM(opentype, 740),
|
glyphM(opentype, 740),
|
||||||
glyphm(opentype, 740),
|
glyphm(opentype, 740),
|
||||||
glyphN(opentype, advanceWidth),
|
glyphN(opentype, defaultAdv),
|
||||||
glyphn(opentype, advanceWidth),
|
glyphn(opentype, defaultAdv),
|
||||||
glyphO(opentype, advanceWidth),
|
glyphO(opentype, defaultAdv),
|
||||||
glypho(opentype, advanceWidth),
|
glypho(opentype, defaultAdv),
|
||||||
glyphP(opentype, advanceWidth),
|
glyphP(opentype, defaultAdv),
|
||||||
glyphp(opentype, advanceWidth),
|
glyphp(opentype, defaultAdv),
|
||||||
glyphQ(opentype, advanceWidth),
|
glyphQ(opentype, defaultAdv),
|
||||||
glyphq(opentype, advanceWidth),
|
glyphq(opentype, defaultAdv),
|
||||||
glyphR(opentype, advanceWidth),
|
glyphR(opentype, defaultAdv),
|
||||||
glyphr(opentype, advanceWidth),
|
glyphr(opentype, defaultAdv),
|
||||||
glyphS(opentype, advanceWidth),
|
glyphS(opentype, defaultAdv),
|
||||||
glyphs(opentype, advanceWidth),
|
glyphsLowerS(opentype, defaultAdv),
|
||||||
glyphT(opentype, advanceWidth),
|
glyphT(opentype, defaultAdv),
|
||||||
glypht(opentype, advanceWidth),
|
glypht(opentype, defaultAdv),
|
||||||
glyphU(opentype, advanceWidth),
|
glyphU(opentype, defaultAdv),
|
||||||
glyphu(opentype, advanceWidth),
|
glyphu(opentype, defaultAdv),
|
||||||
glyphV(opentype, advanceWidth),
|
glyphV(opentype, defaultAdv),
|
||||||
glyphv(opentype, advanceWidth),
|
glyphv(opentype, defaultAdv),
|
||||||
glyphW(opentype, 760),
|
glyphW(opentype, 760),
|
||||||
glyphw(opentype, 660),
|
glyphw(opentype, 660),
|
||||||
glyphX(opentype, advanceWidth),
|
glyphX(opentype, defaultAdv),
|
||||||
glyphx(opentype, advanceWidth),
|
glyphx(opentype, defaultAdv),
|
||||||
glyphY(opentype, advanceWidth),
|
glyphY(opentype, defaultAdv),
|
||||||
glypthy(opentype, advanceWidth),
|
glyphy(opentype, defaultAdv),
|
||||||
glyphZ(opentype, advanceWidth),
|
glyphZ(opentype, defaultAdv),
|
||||||
glyphz(opentype, advanceWidth)
|
glyphz(opentype, defaultAdv)
|
||||||
];
|
];
|
||||||
|
|
||||||
const font = new opentype.Font({
|
const font = new opentype.Font({
|
||||||
@@ -102,12 +102,10 @@ const font = new opentype.Font({
|
|||||||
unitsPerEm,
|
unitsPerEm,
|
||||||
ascender,
|
ascender,
|
||||||
descender,
|
descender,
|
||||||
glyphs
|
glyphs: glyphList
|
||||||
});
|
});
|
||||||
|
|
||||||
const otfBuffer = Buffer.from(font.toArrayBuffer());
|
const buf = Buffer.from(font.toArrayBuffer());
|
||||||
const baseName = "Stain";
|
const outPath = path.join(outDir, "Stain.otf");
|
||||||
const otfPath = path.join(outDir, `${baseName}.otf`);
|
fs.writeFileSync(outPath, buf);
|
||||||
fs.writeFileSync(otfPath, otfBuffer);
|
console.log(`Built ${outPath}`);
|
||||||
|
|
||||||
console.log(`Built ${otfPath}`);
|
|
||||||
|
|||||||
Reference in New Issue
Block a user