Fixup format

This commit is contained in:
Belleve Invis 2020-04-12 00:10:12 -07:00
parent 0b1452a3a7
commit e6da99af60
15 changed files with 47 additions and 45 deletions

View file

@ -2,3 +2,5 @@
printWidth: 100 printWidth: 100
useTabs: true useTabs: true
tabWidth: 4 tabWidth: 4
trailingComma: none
arrowParens: avoid

View file

@ -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");

View file

@ -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 {

View file

@ -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()
}; };
}; };