Fixup format
This commit is contained in:
parent
0b1452a3a7
commit
e6da99af60
15 changed files with 47 additions and 45 deletions
|
@ -1,4 +1,6 @@
|
||||||
# .prettierrc
|
# .prettierrc
|
||||||
printWidth: 100
|
printWidth: 100
|
||||||
useTabs: true
|
useTabs: true
|
||||||
tabWidth: 4
|
tabWidth: 4
|
||||||
|
trailingComma: none
|
||||||
|
arrowParens: avoid
|
|
@ -10,7 +10,7 @@ const { setFontMetrics } = require("../meta/aesthetics");
|
||||||
const regulateGlyphs = require("../support/regulate-glyph");
|
const regulateGlyphs = require("../support/regulate-glyph");
|
||||||
const gcFont = require("./gc");
|
const gcFont = require("./gc");
|
||||||
|
|
||||||
module.exports = function(para) {
|
module.exports = function (para) {
|
||||||
const font = EmptyFont();
|
const font = EmptyFont();
|
||||||
const gs = buildGlyphs(para);
|
const gs = buildGlyphs(para);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
module.exports = function() {
|
module.exports = function () {
|
||||||
return {
|
return {
|
||||||
head: {
|
head: {
|
||||||
checkSumAdjustment: 369537602,
|
checkSumAdjustment: 369537602,
|
||||||
|
|
|
@ -12,7 +12,7 @@ const formLigationData = require("../support/ligation-data");
|
||||||
const regulateGlyphs = require("../support/regulate-glyph");
|
const regulateGlyphs = require("../support/regulate-glyph");
|
||||||
const toml = require("toml");
|
const toml = require("toml");
|
||||||
|
|
||||||
main().catch((e) => {
|
main().catch(e => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
@ -57,7 +57,7 @@ async function getParameters(argv) {
|
||||||
version: argv.ver,
|
version: argv.ver,
|
||||||
weight: argv["menu-weight"] - 0,
|
weight: argv["menu-weight"] - 0,
|
||||||
width: argv["menu-width"] - 0,
|
width: argv["menu-width"] - 0,
|
||||||
slant: argv["menu-slant"],
|
slant: argv["menu-slant"]
|
||||||
};
|
};
|
||||||
|
|
||||||
return para;
|
return para;
|
||||||
|
@ -108,7 +108,7 @@ async function saveCharMap(font) {
|
||||||
glyph.name,
|
glyph.name,
|
||||||
glyph.unicode,
|
glyph.unicode,
|
||||||
typographicFeatures,
|
typographicFeatures,
|
||||||
glyph.featureSelector ? Object.keys(glyph.featureSelector) : [],
|
glyph.featureSelector ? Object.keys(glyph.featureSelector) : []
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
await fs.writeFile(argv.charmap, JSON.stringify(charMap), "utf8");
|
await fs.writeFile(argv.charmap, JSON.stringify(charMap), "utf8");
|
||||||
|
|
|
@ -30,7 +30,7 @@ exports.OffsetCurve = class OffsetCurve {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.curveToContour = function(curve, segments) {
|
exports.curveToContour = function (curve, segments) {
|
||||||
const z0 = curve.eval(0);
|
const z0 = curve.eval(0);
|
||||||
const z1 = curve.eval(1);
|
const z1 = curve.eval(1);
|
||||||
const offPoints = fixedCubify(curve, segments || 16);
|
const offPoints = fixedCubify(curve, segments || 16);
|
||||||
|
|
|
@ -350,9 +350,9 @@ function fairifyImpl(sourceCubicContour, gizmo, builder) {
|
||||||
return buildCurve(splitContour, gizmo, builder);
|
return buildCurve(splitContour, gizmo, builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.fairifyQuad = function(sourceCubicContour, gizmo) {
|
exports.fairifyQuad = function (sourceCubicContour, gizmo) {
|
||||||
return fairifyImpl(sourceCubicContour, gizmo, QuadBuilder);
|
return fairifyImpl(sourceCubicContour, gizmo, QuadBuilder);
|
||||||
};
|
};
|
||||||
exports.fairifySpiro = function(sourceCubicContour, gizmo) {
|
exports.fairifySpiro = function (sourceCubicContour, gizmo) {
|
||||||
return fairifyImpl(sourceCubicContour, gizmo, SpiroBuilder);
|
return fairifyImpl(sourceCubicContour, gizmo, SpiroBuilder);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
module.exports = function(xs, ys) {
|
module.exports = function (xs, ys) {
|
||||||
let i,
|
let i,
|
||||||
length = xs.length;
|
length = xs.length;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ module.exports = function(xs, ys) {
|
||||||
throw "Need an equal count of xs and ys.";
|
throw "Need an equal count of xs and ys.";
|
||||||
}
|
}
|
||||||
if (length === 0) {
|
if (length === 0) {
|
||||||
return function() {
|
return function () {
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ module.exports = function(xs, ys) {
|
||||||
// Impl: Precomputing the result prevents problems if ys is mutated later and allows garbage collection of ys
|
// Impl: Precomputing the result prevents problems if ys is mutated later and allows garbage collection of ys
|
||||||
// Impl: Unary plus properly converts values to numbers
|
// Impl: Unary plus properly converts values to numbers
|
||||||
let result = +ys[0];
|
let result = +ys[0];
|
||||||
return function() {
|
return function () {
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ module.exports = function(xs, ys) {
|
||||||
for (i = 0; i < length; i++) {
|
for (i = 0; i < length; i++) {
|
||||||
indexes.push(i);
|
indexes.push(i);
|
||||||
}
|
}
|
||||||
indexes.sort(function(a, b) {
|
indexes.sort(function (a, b) {
|
||||||
return xs[a] < xs[b] ? -1 : 1;
|
return xs[a] < xs[b] ? -1 : 1;
|
||||||
});
|
});
|
||||||
let oldXs = xs,
|
let oldXs = xs,
|
||||||
|
@ -82,7 +82,7 @@ module.exports = function(xs, ys) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return interpolant function
|
// Return interpolant function
|
||||||
return function(x) {
|
return function (x) {
|
||||||
// The rightmost point in the dataset should give an exact result
|
// The rightmost point in the dataset should give an exact result
|
||||||
let i = xs.length - 1;
|
let i = xs.length - 1;
|
||||||
if (x == xs[i]) {
|
if (x == xs[i]) {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
const blend = require("./monotonic-interpolate");
|
const blend = require("./monotonic-interpolate");
|
||||||
|
|
||||||
module.exports = function(aspect, hive, params, sink) {
|
module.exports = function (aspect, hive, params, sink) {
|
||||||
if (!hive || !hive.blend || !params) return;
|
if (!hive || !hive.blend || !params) return;
|
||||||
|
|
||||||
const block = hive.blend;
|
const block = hive.blend;
|
||||||
|
|
|
@ -62,7 +62,7 @@ function byGlyphPriority(a, b) {
|
||||||
return a.name < b.name ? -1 : a.name > b.name ? 1 : 0;
|
return a.name < b.name ? -1 : a.name > b.name ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = function(gs, skew) {
|
module.exports = function (gs, skew) {
|
||||||
const excludeUnicode = new Set();
|
const excludeUnicode = new Set();
|
||||||
excludeUnicode.add(0x80);
|
excludeUnicode.add(0x80);
|
||||||
for (let c = 0x2500; c <= 0x259f; c++) excludeUnicode.add(c);
|
for (let c = 0x2500; c <= 0x259f; c++) excludeUnicode.add(c);
|
||||||
|
|
|
@ -48,7 +48,7 @@ const ligationSamples = [
|
||||||
arrow("<-->"),
|
arrow("<-->"),
|
||||||
arrow("<--->"),
|
arrow("<--->"),
|
||||||
arrow("<---->"),
|
arrow("<---->"),
|
||||||
htmlComment("<!--"),
|
htmlComment("<!--")
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
arrow2("=<<"),
|
arrow2("=<<"),
|
||||||
|
@ -69,7 +69,7 @@ const ligationSamples = [
|
||||||
arrow("<==>"),
|
arrow("<==>"),
|
||||||
arrow("<===>"),
|
arrow("<===>"),
|
||||||
arrow("<====>"),
|
arrow("<====>"),
|
||||||
htmlComment("<!---"),
|
htmlComment("<!---")
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
arrow("<------"),
|
arrow("<------"),
|
||||||
|
@ -91,7 +91,7 @@ const ligationSamples = [
|
||||||
eqeqeq("==="),
|
eqeqeq("==="),
|
||||||
exeqeq("!=="),
|
exeqeq("!=="),
|
||||||
eqslasheq("=/="),
|
eqslasheq("=/="),
|
||||||
eqexeq("=!="),
|
eqexeq("=!=")
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
centerOps(":="),
|
centerOps(":="),
|
||||||
|
@ -114,8 +114,8 @@ const ligationSamples = [
|
||||||
plusplus("++"),
|
plusplus("++"),
|
||||||
plusplus("+++"),
|
plusplus("+++"),
|
||||||
logc("|-"),
|
logc("|-"),
|
||||||
logc("-|"),
|
logc("-|")
|
||||||
],
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
const ligationSamplesNarrow = [
|
const ligationSamplesNarrow = [
|
||||||
|
@ -129,7 +129,7 @@ const ligationSamplesNarrow = [
|
||||||
arrow("->>"),
|
arrow("->>"),
|
||||||
arrow("-->"),
|
arrow("-->"),
|
||||||
arrow("--->"),
|
arrow("--->"),
|
||||||
htmlComment("<!--"),
|
htmlComment("<!--")
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
arrow2("-<<"),
|
arrow2("-<<"),
|
||||||
|
@ -140,7 +140,7 @@ const ligationSamplesNarrow = [
|
||||||
arrow2(">>-"),
|
arrow2(">>-"),
|
||||||
arrow("<-->"),
|
arrow("<-->"),
|
||||||
arrow("<--->"),
|
arrow("<--->"),
|
||||||
arrow("<---->"),
|
arrow("<---->")
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
arrow("<=="),
|
arrow("<=="),
|
||||||
|
@ -152,7 +152,7 @@ const ligationSamplesNarrow = [
|
||||||
arrow("=>>"),
|
arrow("=>>"),
|
||||||
arrow("==>"),
|
arrow("==>"),
|
||||||
arrow("===>"),
|
arrow("===>"),
|
||||||
htmlComment("<!---"),
|
htmlComment("<!---")
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
arrow2("=<<"),
|
arrow2("=<<"),
|
||||||
|
@ -163,7 +163,7 @@ const ligationSamplesNarrow = [
|
||||||
arrow2(">>="),
|
arrow2(">>="),
|
||||||
arrow("<==>"),
|
arrow("<==>"),
|
||||||
arrow("<===>"),
|
arrow("<===>"),
|
||||||
arrow("<====>"),
|
arrow("<====>")
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
arrow("<-------"),
|
arrow("<-------"),
|
||||||
|
@ -172,7 +172,7 @@ const ligationSamplesNarrow = [
|
||||||
arrow("<~~"),
|
arrow("<~~"),
|
||||||
arrow("<~"),
|
arrow("<~"),
|
||||||
arrow("~>"),
|
arrow("~>"),
|
||||||
arrow("~~>"),
|
arrow("~~>")
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
logc("\\/"),
|
logc("\\/"),
|
||||||
|
@ -185,7 +185,7 @@ const ligationSamplesNarrow = [
|
||||||
eqeqeq("==="),
|
eqeqeq("==="),
|
||||||
exeqeq("!=="),
|
exeqeq("!=="),
|
||||||
eqslasheq("=/="),
|
eqslasheq("=/="),
|
||||||
eqexeq("=!="),
|
eqexeq("=!=")
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
centerOps(":="),
|
centerOps(":="),
|
||||||
|
@ -199,7 +199,7 @@ const ligationSamplesNarrow = [
|
||||||
trig("|>"),
|
trig("|>"),
|
||||||
centerOps("+:"),
|
centerOps("+:"),
|
||||||
centerOps("-:"),
|
centerOps("-:"),
|
||||||
centerOps("=:"),
|
centerOps("=:")
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
kernDotty("::"),
|
kernDotty("::"),
|
||||||
|
@ -211,18 +211,18 @@ const ligationSamplesNarrow = [
|
||||||
plusplus("++"),
|
plusplus("++"),
|
||||||
plusplus("+++"),
|
plusplus("+++"),
|
||||||
logc("|-"),
|
logc("|-"),
|
||||||
logc("-|"),
|
logc("-|")
|
||||||
],
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
module.exports = async function getLigationData() {
|
module.exports = async function getLigationData() {
|
||||||
const ligToml = await fs.readFile(path.join(__dirname, "../../ligation-set.toml"), "utf8");
|
const ligToml = await fs.readFile(path.join(__dirname, "../../ligation-set.toml"), "utf8");
|
||||||
const ligData = toml.parse(ligToml);
|
const ligData = toml.parse(ligToml);
|
||||||
|
|
||||||
const ligationSets = buildLigationSet(ligData, (comp) => comp.buildup.join(","));
|
const ligationSets = buildLigationSet(ligData, comp => comp.buildup.join(","));
|
||||||
const nonMergeLigationSets = buildLigationSet(
|
const nonMergeLigationSets = buildLigationSet(
|
||||||
ligData,
|
ligData,
|
||||||
(comp) => comp.tag + comp.buildup.join(",")
|
comp => comp.tag + comp.buildup.join(",")
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -231,13 +231,13 @@ module.exports = async function getLigationData() {
|
||||||
cherry: ligData.simple,
|
cherry: ligData.simple,
|
||||||
rawSets: ligData.composite,
|
rawSets: ligData.composite,
|
||||||
sets: [...ligationSets.values()],
|
sets: [...ligationSets.values()],
|
||||||
nonMergeSets: [...nonMergeLigationSets.values()],
|
nonMergeSets: [...nonMergeLigationSets.values()]
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
function buildLigationSet(ligData, getKey) {
|
function buildLigationSet(ligData, getKey) {
|
||||||
const ligationSets = new Map([
|
const ligationSets = new Map([
|
||||||
["*off", { tag: "calt", switch: "off", desc: "Ligation Off", brief: "Off", buildup: [] }],
|
["*off", { tag: "calt", switch: "off", desc: "Ligation Off", brief: "Off", buildup: [] }]
|
||||||
]);
|
]);
|
||||||
for (const sel in ligData.composite) {
|
for (const sel in ligData.composite) {
|
||||||
const comp = ligData.composite[sel];
|
const comp = ligData.composite[sel];
|
||||||
|
@ -250,7 +250,7 @@ function buildLigationSet(ligData, getKey) {
|
||||||
buildup: comp.buildup,
|
buildup: comp.buildup,
|
||||||
tagName: comp.tag,
|
tagName: comp.tag,
|
||||||
desc: comp.desc,
|
desc: comp.desc,
|
||||||
brief: comp.brief || comp.desc,
|
brief: comp.brief || comp.desc
|
||||||
};
|
};
|
||||||
ligationSets.set(key, item);
|
ligationSets.set(key, item);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -2,7 +2,7 @@ const fs = require("fs-extra");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const toml = require("toml");
|
const toml = require("toml");
|
||||||
|
|
||||||
module.exports = async function() {
|
module.exports = async function () {
|
||||||
const variantsToml = await fs.readFile(path.join(__dirname, "../../variants.toml"), "utf8");
|
const variantsToml = await fs.readFile(path.join(__dirname, "../../variants.toml"), "utf8");
|
||||||
const variants = toml.parse(variantsToml);
|
const variants = toml.parse(variantsToml);
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ module.exports = async function (charMapPath) {
|
||||||
...(exemplar.auxiliary || []),
|
...(exemplar.auxiliary || []),
|
||||||
...(exemplar.index || []),
|
...(exemplar.index || []),
|
||||||
...(exemplar.numbers || []),
|
...(exemplar.numbers || []),
|
||||||
...(exemplar.punctuation || []),
|
...(exemplar.punctuation || [])
|
||||||
].join("");
|
].join("");
|
||||||
|
|
||||||
let fullSupport = true;
|
let fullSupport = true;
|
||||||
|
@ -64,9 +64,9 @@ module.exports = async function (charMapPath) {
|
||||||
return {
|
return {
|
||||||
stats: {
|
stats: {
|
||||||
glyphCount: charMap.length,
|
glyphCount: charMap.length,
|
||||||
codePointCount: rawCoverage.size,
|
codePointCount: rawCoverage.size
|
||||||
},
|
},
|
||||||
unicodeCoverage: gatherCov(rawCoverage),
|
unicodeCoverage: gatherCov(rawCoverage),
|
||||||
languages: Array.from(supportLangSet).sort(),
|
languages: Array.from(supportLangSet).sort()
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
module.exports = function(output, family, hs, formats) {
|
module.exports = function (output, family, hs, formats) {
|
||||||
let ans = ``;
|
let ans = ``;
|
||||||
for (const term of hs) {
|
for (const term of hs) {
|
||||||
let src = formats
|
let src = formats
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const ttf2woff = require("ttf2woff");
|
const ttf2woff = require("ttf2woff");
|
||||||
|
|
||||||
module.exports = function(from, to) {
|
module.exports = function (from, to) {
|
||||||
const input = fs.readFileSync(from);
|
const input = fs.readFileSync(from);
|
||||||
const ttf = new Uint8Array(input);
|
const ttf = new Uint8Array(input);
|
||||||
const woff = Buffer.from(ttf2woff(ttf, {}).buffer);
|
const woff = Buffer.from(ttf2woff(ttf, {}).buffer);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const ttf2woff2 = require("ttf2woff2");
|
const ttf2woff2 = require("ttf2woff2");
|
||||||
|
|
||||||
module.exports = function(from, to) {
|
module.exports = function (from, to) {
|
||||||
const input = fs.readFileSync(from);
|
const input = fs.readFileSync(from);
|
||||||
const woff = ttf2woff2(input);
|
const woff = ttf2woff2(input);
|
||||||
fs.writeFileSync(to, woff);
|
fs.writeFileSync(to, woff);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue