From e6da99af6015c7486e4b92b46990f01c3fe56e7b Mon Sep 17 00:00:00 2001 From: Belleve Invis Date: Sun, 12 Apr 2020 00:10:12 -0700 Subject: [PATCH] Fixup format --- .prettierrc.yaml | 10 +++--- gen/build-font.js | 2 +- gen/empty-font.js | 2 +- gen/generator.js | 6 ++-- support/curve-util.js | 2 +- support/fairify.js | 4 +-- support/monotonic-interpolate.js | 10 +++--- support/param-blend.js | 2 +- support/regulate-glyph.js | 2 +- utility/export-data/ligation-data.js | 38 +++++++++++----------- utility/export-data/parse-variants-data.js | 2 +- utility/export-data/supported-languages.js | 6 ++-- utility/make-webfont-css.js | 2 +- utility/ttf-to-woff.js | 2 +- utility/ttf-to-woff2.js | 2 +- 15 files changed, 47 insertions(+), 45 deletions(-) diff --git a/.prettierrc.yaml b/.prettierrc.yaml index 19f7e471a..1f455f2c3 100644 --- a/.prettierrc.yaml +++ b/.prettierrc.yaml @@ -1,4 +1,6 @@ -# .prettierrc -printWidth: 100 -useTabs: true -tabWidth: 4 \ No newline at end of file +# .prettierrc +printWidth: 100 +useTabs: true +tabWidth: 4 +trailingComma: none +arrowParens: avoid \ No newline at end of file diff --git a/gen/build-font.js b/gen/build-font.js index c2c44487d..641d91f69 100644 --- a/gen/build-font.js +++ b/gen/build-font.js @@ -10,7 +10,7 @@ const { setFontMetrics } = require("../meta/aesthetics"); const regulateGlyphs = require("../support/regulate-glyph"); const gcFont = require("./gc"); -module.exports = function(para) { +module.exports = function (para) { const font = EmptyFont(); const gs = buildGlyphs(para); diff --git a/gen/empty-font.js b/gen/empty-font.js index f5b2061f0..000423444 100644 --- a/gen/empty-font.js +++ b/gen/empty-font.js @@ -1,6 +1,6 @@ "use strict"; -module.exports = function() { +module.exports = function () { return { head: { checkSumAdjustment: 369537602, diff --git a/gen/generator.js b/gen/generator.js index 184c9d30f..f827673ab 100644 --- a/gen/generator.js +++ b/gen/generator.js @@ -12,7 +12,7 @@ const formLigationData = require("../support/ligation-data"); const regulateGlyphs = require("../support/regulate-glyph"); const toml = require("toml"); -main().catch((e) => { +main().catch(e => { console.error(e); process.exit(1); }); @@ -57,7 +57,7 @@ async function getParameters(argv) { version: argv.ver, weight: argv["menu-weight"] - 0, width: argv["menu-width"] - 0, - slant: argv["menu-slant"], + slant: argv["menu-slant"] }; return para; @@ -108,7 +108,7 @@ async function saveCharMap(font) { glyph.name, glyph.unicode, typographicFeatures, - glyph.featureSelector ? Object.keys(glyph.featureSelector) : [], + glyph.featureSelector ? Object.keys(glyph.featureSelector) : [] ]); } await fs.writeFile(argv.charmap, JSON.stringify(charMap), "utf8"); diff --git a/support/curve-util.js b/support/curve-util.js index d60f92dcb..67b7eb237 100644 --- a/support/curve-util.js +++ b/support/curve-util.js @@ -30,7 +30,7 @@ exports.OffsetCurve = class OffsetCurve { } }; -exports.curveToContour = function(curve, segments) { +exports.curveToContour = function (curve, segments) { const z0 = curve.eval(0); const z1 = curve.eval(1); const offPoints = fixedCubify(curve, segments || 16); diff --git a/support/fairify.js b/support/fairify.js index cc4b0271b..323124a47 100644 --- a/support/fairify.js +++ b/support/fairify.js @@ -350,9 +350,9 @@ function fairifyImpl(sourceCubicContour, gizmo, builder) { return buildCurve(splitContour, gizmo, builder); } -exports.fairifyQuad = function(sourceCubicContour, gizmo) { +exports.fairifyQuad = function (sourceCubicContour, gizmo) { return fairifyImpl(sourceCubicContour, gizmo, QuadBuilder); }; -exports.fairifySpiro = function(sourceCubicContour, gizmo) { +exports.fairifySpiro = function (sourceCubicContour, gizmo) { return fairifyImpl(sourceCubicContour, gizmo, SpiroBuilder); }; diff --git a/support/monotonic-interpolate.js b/support/monotonic-interpolate.js index adf01f8a8..4ac2e1003 100644 --- a/support/monotonic-interpolate.js +++ b/support/monotonic-interpolate.js @@ -1,6 +1,6 @@ "use strict"; -module.exports = function(xs, ys) { +module.exports = function (xs, ys) { let i, length = xs.length; @@ -9,7 +9,7 @@ module.exports = function(xs, ys) { throw "Need an equal count of xs and ys."; } if (length === 0) { - return function() { + return function () { 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: Unary plus properly converts values to numbers let result = +ys[0]; - return function() { + return function () { return result; }; } @@ -27,7 +27,7 @@ module.exports = function(xs, ys) { for (i = 0; i < length; i++) { indexes.push(i); } - indexes.sort(function(a, b) { + indexes.sort(function (a, b) { return xs[a] < xs[b] ? -1 : 1; }); let oldXs = xs, @@ -82,7 +82,7 @@ module.exports = function(xs, ys) { } // Return interpolant function - return function(x) { + return function (x) { // The rightmost point in the dataset should give an exact result let i = xs.length - 1; if (x == xs[i]) { diff --git a/support/param-blend.js b/support/param-blend.js index ab1b9c3a2..630447346 100644 --- a/support/param-blend.js +++ b/support/param-blend.js @@ -2,7 +2,7 @@ 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; const block = hive.blend; diff --git a/support/regulate-glyph.js b/support/regulate-glyph.js index 30f183a4f..ca3365062 100644 --- a/support/regulate-glyph.js +++ b/support/regulate-glyph.js @@ -62,7 +62,7 @@ function byGlyphPriority(a, b) { 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(); excludeUnicode.add(0x80); for (let c = 0x2500; c <= 0x259f; c++) excludeUnicode.add(c); diff --git a/utility/export-data/ligation-data.js b/utility/export-data/ligation-data.js index cb76bca4f..60bac1c43 100644 --- a/utility/export-data/ligation-data.js +++ b/utility/export-data/ligation-data.js @@ -48,7 +48,7 @@ const ligationSamples = [ arrow("<-->"), arrow("<--->"), arrow("<---->"), - htmlComment(""), arrow("--->"), - htmlComment(""), arrow("<--->"), - arrow("<---->"), + arrow("<---->") ], [ arrow("<=="), @@ -152,7 +152,7 @@ const ligationSamplesNarrow = [ arrow("=>>"), arrow("==>"), arrow("===>"), - htmlComment("