Continue ESM transform

This commit is contained in:
be5invis 2022-07-16 20:18:52 -07:00
parent b8205a63aa
commit 36835216f5
44 changed files with 1939 additions and 502 deletions

View file

@ -12,7 +12,7 @@
},
"sourceType": "module"
},
"extends": ["eslint:recommended", "prettier"],
"extends": ["eslint:recommended", "prettier", "plugin:import/recommended"],
"rules": {
"semi": ["error", "always"],
"no-var": "error",
@ -20,6 +20,17 @@
"no-constant-condition": ["error", { "checkLoops": false }],
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
"no-unused-vars": ["off"],
"complexity": ["warn", 16]
"complexity": ["warn", 16],
"import/newline-after-import": ["error", { "count": 1 }],
"import/no-unresolved": "off",
"import/order": [
"error",
{
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
"newlines-between": "always",
"alphabetize": { "order": "asc", "caseInsensitive": true }
}
]
}
}

View file

@ -1,11 +1,13 @@
import { CreateEmptyFont } from "./empty-font.mjs";
import { buildGlyphs } from "../glyphs/index.mjs";
import { copyFontMetrics } from "../meta/aesthetics.mjs";
import { assignFontNames } from "../meta/naming.mjs";
import { buildOtl } from "../otl/index.mjs";
import * as Caching from "./caching/index.mjs";
import { CreateEmptyFont } from "./empty-font.mjs";
import { finalizeFont } from "./finalize/index.mjs";
import { convertOtd } from "./otd-conv/index.mjs";
import * as Caching from "./caching/index.mjs";
import { buildOtl } from "../otl/index.mjs";
import { assignFontNames } from "../meta/naming.mjs";
import { copyFontMetrics } from "../meta/aesthetics.mjs";
("use strict");
export async function buildFont(argv, para) {
const gs = buildGlyphs(para);

View file

@ -1,5 +1,6 @@
import fs from "fs";
import zlib from "zlib";
import { encode, decode } from "@msgpack/msgpack";
const Edition = 20;
@ -75,8 +76,13 @@ class Cache {
export const load = async function (path, version, freshAgeKey) {
let cache = new Cache(freshAgeKey);
if (path && fs.existsSync(path)) {
try {
const buf = zlib.gunzipSync(await fs.promises.readFile(path));
cache.loadRep(version, decode(buf));
} catch (e) {
console.error("Error loading cache. Treat as empty.");
console.error(e);
}
}
return cache;
};

View file

@ -1,8 +1,9 @@
import * as TypoGeom from "typo-geom";
import * as CurveUtil from "../../support/geometry/curve-util.mjs";
import * as Geom from "../../support/geometry/index.mjs";
import { Point } from "../../support/geometry/point.mjs";
import { Transform } from "../../support/geometry/transform.mjs";
import * as CurveUtil from "../../support/geometry/curve-util.mjs";
///////////////////////////////////////////////////////////////////////////////////////////////////
function regulateGlyphStore(cache, skew, glyphStore) {

View file

@ -1,7 +1,8 @@
import { finalizeGlyphs } from "./glyphs.mjs";
import { gcFont } from "./gc.mjs";
import { Nwid, Wwid } from "../../support/gr.mjs";
import { gcFont } from "./gc.mjs";
import { finalizeGlyphs } from "./glyphs.mjs";
function assignGrAndCodeRank(glyphStore, ...flatteners) {
for (const g of glyphStore.glyphs()) {
g.codeRank = 0xffffffff;

View file

@ -1,4 +1,5 @@
import { Joining, AnyCv, TieMark, Nwid, Wwid } from "../../support/gr.mjs";
const ApplePostNames = new Map([
/* spell-checker: disable */
[0xd, "nonmarkingreturn"],

View file

@ -1,7 +1,10 @@
import { Ot } from "ot-builder";
import { Point } from "../../support/geometry/point.mjs";
import * as Gr from "../../support/gr.mjs";
import { byCode, bySpacing, byGr, byBuildOrder } from "./glyph-name.mjs";
function byRank([gna, a], [gnb, b]) {
return (
b.glyphRank - a.glyphRank ||

View file

@ -1,5 +1,6 @@
import { convertGlyphs } from "./glyphs.mjs";
import { convertGsub, convertGpos, convertGdef } from "./layout.mjs";
export function convertOtd(baseFont, otl, gs) {
const { glyphs, cmap } = convertGlyphs(gs);
const gsub = convertGsub(otl.GSUB, glyphs);

View file

@ -1,4 +1,5 @@
import { Ot } from "ot-builder";
class LookupStore {
constructor(handlers, glyphs) {
this.glyphs = glyphs;
@ -12,20 +13,16 @@ class LookupStore {
return this.m_mapping.get(id);
}
declare(id, otdLookup) {
if (this.m_mapping.has(id))
return;
if (this.m_mapping.has(id)) return;
const handler = this.m_handlers[otdLookup.type];
if (!handler)
return;
if (!handler) return;
this.m_mapping.set(id, handler.init());
}
fill(id, otdLookup) {
const dst = this.query(id);
const handler = this.m_handlers[otdLookup.type];
if (!dst || !handler)
return;
if (otdLookup.subtables)
throw new Error("Unreachable.");
if (!dst || !handler) return;
if (otdLookup.subtables) throw new Error("Unreachable.");
handler.fill(dst, otdLookup, this);
}
}
@ -38,8 +35,7 @@ const GsubSingleHandler = {
for (const k in st) {
const from = store.glyphs.queryByName(k);
const to = store.glyphs.queryByName(st[k]);
if (from && to)
dst.mapping.set(from, to);
if (from && to) dst.mapping.set(from, to);
}
}
};
@ -52,8 +48,7 @@ const GsubMultipleHandler = {
for (const k in st) {
const from = store.glyphs.queryByName(k);
const to = mapGlyphListAll(st[k], store);
if (!from || !to)
continue;
if (!from || !to) continue;
dst.mapping.set(from, to);
}
}
@ -73,8 +68,7 @@ const GsubLigatureHandler = {
for (const { from: _from, to: _to } of st) {
const to = store.glyphs.queryByName(_to);
const from = mapGlyphListAll(_from, store);
if (!from || !to)
continue;
if (!from || !to) continue;
dst.mapping.push({ from, to });
}
}
@ -88,8 +82,7 @@ const GsubChainingHandler = {
const match = [];
for (const m of st.match) {
const m1 = mapGlyphListSome(m, store);
if (!m1)
continue out;
if (!m1) continue out;
match.push(new Set(m1));
}
const inputBegins = st.inputBegins;
@ -97,8 +90,7 @@ const GsubChainingHandler = {
const applications = [];
for (const ap of st.apply) {
const lookup = store.query(ap.lookup);
if (!lookup)
continue out;
if (!lookup) continue out;
applications.push({ at: ap.at - inputBegins, apply: lookup });
}
dst.rules.push({ match, inputBegins, inputEnds, applications });
@ -119,23 +111,19 @@ const GsubReverseHandler = {
const m1 = new Set();
for (let k = 0; k < st.match[j].length; k++) {
const gFrom = store.glyphs.queryByName(st.match[j][k]);
if (gFrom)
m1.add(gFrom);
if (gFrom) m1.add(gFrom);
}
if (!m1.size)
continue out;
if (!m1.size) continue out;
match.push(m1);
}
if (j === doSubAt) {
for (let k = 0; k < st.match[j].length; k++) {
const gFrom = store.glyphs.queryByName(st.match[j][k]);
const gTo = store.glyphs.queryByName(st.to[k]);
if (!gFrom)
continue;
if (!gFrom) continue;
if (gTo) {
replacement.set(gFrom, gTo);
}
else {
} else {
replacement.set(gFrom, gFrom);
}
}
@ -149,8 +137,7 @@ function mapGlyphListAll(gl, store) {
const out = [];
for (const item of gl) {
const fg = store.glyphs.queryByName(item);
if (!fg)
return null;
if (!fg) return null;
out.push(fg);
}
return out;
@ -159,12 +146,10 @@ function mapGlyphListSome(gl, store) {
const out = [];
for (const item of gl) {
const fg = store.glyphs.queryByName(item);
if (!fg)
continue;
if (!fg) continue;
out.push(fg);
}
if (!out.length)
return null;
if (!out.length) return null;
return out;
}
const GsubHandlers = {
@ -212,8 +197,7 @@ function convertMarkRecords(marks, mm, store) {
for (const gn in marks) {
const mark = marks[gn];
const g = store.glyphs.queryByName(gn);
if (!g)
continue;
if (!g) continue;
let markAnchors = [];
markAnchors[mm.get(mark.class)] = { x: mark.x, y: mark.y };
out.set(g, { markAnchors: markAnchors });
@ -225,8 +209,7 @@ function convertBaseRecords(bases, mm, store) {
for (const gn in bases) {
const baseObj = bases[gn];
const g = store.glyphs.queryByName(gn);
if (!g)
continue;
if (!g) continue;
const baseArray = [];
for (const bkStr in baseObj) {
baseArray[mm.get(bkStr)] = baseObj[bkStr];
@ -255,8 +238,7 @@ class FeatureStore {
const lookups = [];
for (const lid of data) {
const lookup = this.lookupStore.query(lid);
if (lookup)
lookups.push(lookup);
if (lookup) lookups.push(lookup);
}
this.m_mapping.set(id, { tag, lookups });
}
@ -278,17 +260,14 @@ class ScriptLanguageStore {
this.m_scriptMapping.set(scriptTag, sr);
}
const lr = this.createLanguageRecord(data);
if (languageTag === "dflt" || languageTag === "DFLT")
sr.defaultLanguage = lr;
else
sr.languages.set(languageTag, lr);
if (languageTag === "dflt" || languageTag === "DFLT") sr.defaultLanguage = lr;
else sr.languages.set(languageTag, lr);
}
createLanguageRecord(data) {
const features = [];
for (const fid of data.features) {
const feature = this.featureStore.query(fid);
if (feature)
features.push(feature);
if (feature) features.push(feature);
}
return {
requiredFeature: this.featureStore.query(data.requiredFeature) || null,
@ -298,28 +277,22 @@ class ScriptLanguageStore {
}
function ConvertGsubGposT(handlers, T) {
return function (table, glyphs) {
if (!table)
return null;
if (!table) return null;
const ls = new LookupStore(handlers, glyphs);
if (table.lookups) {
if (table.lookupOrder) {
for (const l of table.lookupOrder)
ls.declare(l, table.lookups[l]);
for (const l of table.lookupOrder) ls.declare(l, table.lookups[l]);
}
for (const l in table.lookups)
ls.declare(l, table.lookups[l]);
for (const l in table.lookups)
ls.fill(l, table.lookups[l]);
for (const l in table.lookups) ls.declare(l, table.lookups[l]);
for (const l in table.lookups) ls.fill(l, table.lookups[l]);
}
const fs = new FeatureStore(ls);
if (table.features) {
for (const f in table.features)
fs.fill(f, table.features[f]);
for (const f in table.features) fs.fill(f, table.features[f]);
}
const ss = new ScriptLanguageStore(fs);
if (table.languages) {
for (const sl in table.languages)
ss.fill(sl, table.languages[sl]);
for (const sl in table.languages) ss.fill(sl, table.languages[sl]);
}
return new T(ss.extract(), fs.extract(), ls.extract());
};
@ -329,8 +302,7 @@ function convertGdef(otdGdef, glyphs) {
gdef.glyphClassDef = new Map();
for (const gn in otdGdef.glyphClassDef) {
const g = glyphs.queryByName(gn);
if (g)
gdef.glyphClassDef.set(g, otdGdef.glyphClassDef[gn]);
if (g) gdef.glyphClassDef.set(g, otdGdef.glyphClassDef[gn]);
}
return gdef;
}

View file

@ -1,16 +1,18 @@
import fs from "fs";
import path from "path";
import zlib from "zlib";
import * as url from "url";
import zlib from "zlib";
import * as Toml from "@iarna/toml";
import { encode } from "@msgpack/msgpack";
import { FontIo } from "ot-builder";
import * as Toml from "@iarna/toml";
import { buildFont } from "./gen/build-font.mjs";
import * as Parameters from "./support/parameters.mjs";
import { applyMetricOverride } from "./support/metric-override.mjs";
import * as VariantData from "./support/variant-data.mjs";
import { applyLigationData } from "./support/ligation-data.mjs";
import { createGrDisplaySheet } from "./support/gr.mjs";
import { applyLigationData } from "./support/ligation-data.mjs";
import { applyMetricOverride } from "./support/metric-override.mjs";
import * as Parameters from "./support/parameters.mjs";
import * as VariantData from "./support/variant-data.mjs";
const __filename = url.fileURLToPath(import.meta.url);
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));

View file

@ -1,41 +0,0 @@
import * as TypoGeom from "typo-geom";
import { BooleanGeometry, TransformedGeometry } from "../support/geometry/index.mjs";
///////////////////////////////////////////////////////////////////////////////////////////////////
class BooleImpl {
constructor(bindings, operator, operands) {
this.bindings = bindings;
this.operator = operator;
this.operands = operands;
}
applyToGlyph(glyph) {
const operandGeometries = [];
const forwardGizmo = glyph.gizmo || this.bindings.GlobalTransform;
const backwardGizmo = forwardGizmo.inverse();
for (const operand of this.operands) {
const g1 = new this.bindings.Glyph();
g1.gizmo = forwardGizmo;
g1.include(operand);
operandGeometries.push(new TransformedGeometry(g1.geometry, backwardGizmo));
}
return glyph.includeGeometry(
new TransformedGeometry(
new BooleanGeometry(this.operator, operandGeometries),
forwardGizmo
)
);
}
}
export const SetupBuilders = function (bindings) {
const union = (...operands) =>
new BooleImpl(bindings, TypoGeom.Boolean.ClipType.ctUnion, operands);
const intersection = (...operands) =>
new BooleImpl(bindings, TypoGeom.Boolean.ClipType.ctIntersection, operands);
const difference = (...operands) =>
new BooleImpl(bindings, TypoGeom.Boolean.ClipType.ctDifference, operands);
return {
union: union,
intersection: intersection,
difference: difference
};
};

View file

@ -1,4 +1,5 @@
import * as TypoGeom from "typo-geom";
import { BooleanGeometry, TransformedGeometry } from "../support/geometry/index.mjs";
///////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -1,7 +1,7 @@
import * as CurveUtil from "../support/geometry/curve-util.mjs";
import { SpiroGeometry, DiSpiroGeometry } from "../support/geometry/index.mjs";
import { BiKnotCollector } from "../support/geometry/spiro-expand.mjs";
import { fallback, mix, bez3 } from "../support/utils.mjs";
import { SpiroGeometry, DiSpiroGeometry } from "../support/geometry/index.mjs";
///////////////////////////////////////////////////////////////////////////////////////////////////
class DispiroImpl {

View file

@ -1,4 +1,5 @@
import * as TypoGeom from "typo-geom";
import { Point } from "./point.mjs";
import { Transform } from "./transform.mjs";

View file

@ -1,11 +1,14 @@
import crypto from "crypto";
import * as TypoGeom from "typo-geom";
import * as SpiroJs from "spiro";
import * as CurveUtil from "./curve-util.mjs";
import * as TypoGeom from "typo-geom";
import * as Format from "../util/formatter.mjs";
import * as CurveUtil from "./curve-util.mjs";
import { Point } from "./point.mjs";
import { Transform } from "./transform.mjs";
import { SpiroExpander } from "./spiro-expand.mjs";
import { Transform } from "./transform.mjs";
class GeometryBase {
asContours() {

View file

@ -1,6 +1,7 @@
import * as SpiroJs from "spiro";
import { linreg } from "../utils.mjs";
import * as Format from "../util/formatter.mjs";
import { linreg } from "../utils.mjs";
class BiKnot {
constructor(type, x, y, d1, d2) {

View file

@ -1,7 +1,7 @@
import { Transform } from "../geometry/transform.mjs";
import { Point } from "../geometry/point.mjs";
import { Anchor } from "../geometry/anchor.mjs";
import * as Geom from "../geometry/index.mjs";
import { Point } from "../geometry/point.mjs";
import { Transform } from "../geometry/transform.mjs";
export class Glyph {
constructor(_identifier) {

1415
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -24,6 +24,7 @@
"cldr": "^7.2.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"patel": "^0.38.0",
"prettier": "^2.7.1",
"verda": "^1.10.0",

View file

@ -1,8 +1,12 @@
import fs from "fs";
import path from "path";
import { parseVariantsData } from "../export-data/variants-data.mjs";
import * as url from "url";
import { parseLigationData } from "../export-data/ligation-data.mjs";
import { getCharMapAndSupportedLanguageList } from "../export-data/supported-languages.mjs";
import { parseVariantsData } from "../export-data/variants-data.mjs";
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
async function processSsOt(dirs) {
const variantsData = await parseVariantsData();

View file

@ -1,4 +1,5 @@
import ucdNames from "@unicode/unicode-14.0.0/Names";
import ucdNames from "@unicode/unicode-14.0.0/Names/index.js";
for (let i = 2; i < process.argv.length; i++) {
const lch = parseInt(process.argv[i], 16);
const name = ucdNames.get(lch);

View file

@ -1,5 +1,6 @@
import fs from "fs";
import crypto from "crypto";
import fs from "fs";
function hashFile(path) {
return new Promise((resolve, reject) => {
let sum = crypto.createHash("sha256");
@ -10,8 +11,7 @@ function hashFile(path) {
fileStream.on("data", chunk => {
try {
sum.update(chunk);
}
catch (ex) {
} catch (ex) {
return reject(ex);
}
});

View file

@ -1,4 +1,6 @@
import UnicodeDataIndex from "@unicode/unicode-14.0.0";
export async function collectBlockData() {
const BlockData = [
[[0xe0a0, 0xe0df], "Private Use Area — Powerline"],
[[0xee00, 0xee3f], "Private Use Area — Progress Bar"],
@ -6,10 +8,13 @@ const BlockData = [
[[0x1fa70, 0x1faff], "Symbols and Pictographs Extended-A "],
[[0x1fb00, 0x1fbff], "Symbols for Legacy Computing"]
];
for (const id of UnicodeDataIndex.Block) {
if (!id || /Private_Use_Area/.test(id) || /undefined/.test(id))
continue;
if (!id || /Private_Use_Area/.test(id) || /undefined/.test(id)) continue;
const rangesModule = await import(`@unicode/unicode-14.0.0/Block/${id}/ranges.js`);
const rg = rangesModule.default;
BlockData.push([[rg[0].begin, rg[0].end - 1], id.replace(/_/g, " ")]);
}
BlockData.sort((a, b) => a[0][0] - b[0][0]);
export { BlockData };
return BlockData;
}

View file

@ -1,6 +1,8 @@
import { BlockData } from "./block-data.mjs";
import ucdNames from "@unicode/unicode-14.0.0/Names";
import ugc from "@unicode/unicode-14.0.0/General_Category";
import ugc from "@unicode/unicode-14.0.0/General_Category/index.js";
import ucdNames from "@unicode/unicode-14.0.0/Names/index.js";
import { collectBlockData } from "./block-data.mjs";
function findFirstLastChar(lchBlockStart, lchBlockEnd, cov) {
let lchFirst = 0,
lchLast = 0;
@ -18,9 +20,9 @@ function findFirstLastChar(lchBlockStart, lchBlockEnd, cov) {
const lchEnd = ((lchLast >>> 4) << 4) + 0x10;
return [lchStart, lchEnd];
}
export const gatherCoverageData = function (covUpright, covItalic, covOblique) {
export async function gatherCoverageData(covUpright, covItalic, covOblique) {
const result = [];
for (const [[lchBlockStart, lchBlockEnd], block] of BlockData) {
for (const [[lchBlockStart, lchBlockEnd], block] of await collectBlockData()) {
let blockResults = [];
const [lchStart, lchEnd] = findFirstLastChar(lchBlockStart, lchBlockEnd, covUpright);
if (!lchStart || !lchEnd) continue;
@ -63,4 +65,4 @@ export const gatherCoverageData = function (covUpright, covItalic, covOblique) {
}
}
return result;
};
}

View file

@ -1,11 +1,19 @@
import fs from "fs";
import { parseVariantsData } from "./variants-data.mjs";
import path from "path";
import * as url from "url";
import { parseLigationData } from "./ligation-data.mjs";
import { getCharMapAndSupportedLanguageList } from "./supported-languages.mjs";
import package$0 from "../../package.json" assert { type: "json" };
import { parseVariantsData } from "./variants-data.mjs";
export default main;
async function main(argv) {
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
const packageJson = JSON.parse(
await fs.promises.readFile(path.join(__dirname, "../../package.json"))
);
const version = packageJson.version;
const version = package$0.version;
export default (async function main(argv) {
const variantsData = await parseVariantsData();
const ligationData = await parseLigationData();
const cl = await getCharMapAndSupportedLanguageList(
@ -32,4 +40,4 @@ export default (async function main(argv) {
argv.exportPathCov,
JSON.stringify({ version, ...cl }, { spaces: 2 })
);
});
}

View file

@ -1,5 +1,7 @@
import fs from "fs";
import path from "path";
import * as url from "url";
import * as toml from "@iarna/toml";
const ligationSamples = [
@ -217,6 +219,7 @@ function buildLigationSet(ligData, getKey) {
return ligationSets;
}
export const parseLigationData = async function () {
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
const ligToml = await fs.promises.readFile(
path.join(__dirname, "../../params/ligation-set.toml"),
"utf8"

View file

@ -1,7 +1,9 @@
import cldr from "cldr";
import fs from "fs";
import zlib from "zlib";
import { decode } from "@msgpack/msgpack";
import cldr from "cldr";
import { gatherCoverageData } from "./coverage-export/gather-coverage-data.mjs";
// List all the languages that Iosevka supports, but cannot inferred from CLDR data.
@ -74,11 +76,7 @@ function getRawCoverage(charMap) {
for (const u of codes) rawCoverage.set(u, [gn, tv, cv]);
return rawCoverage;
}
export const getCharMapAndSupportedLanguageList = async function (
cmpUpright,
cmpItalic,
cmpOblique
) {
export async function getCharMapAndSupportedLanguageList(cmpUpright, cmpItalic, cmpOblique) {
const charMap = await readMpCharMap(cmpUpright);
const charMapItalic = await readMpCharMap(cmpItalic);
const charMapOblique = await readMpCharMap(cmpOblique);
@ -90,7 +88,11 @@ export const getCharMapAndSupportedLanguageList = async function (
glyphCount: charMap.length,
codePointCount: rawCoverage.size
},
unicodeCoverage: gatherCoverageData(rawCoverage, rawCoverageItalic, rawCoverageOblique),
unicodeCoverage: await gatherCoverageData(
rawCoverage,
rawCoverageItalic,
rawCoverageOblique
),
languages: Array.from(getSupportedLanguageSet(rawCoverage)).sort()
};
};
}

View file

@ -1,6 +1,9 @@
import fs from "fs";
import path from "path";
import * as url from "url";
import * as toml from "@iarna/toml";
import * as VariantDataParser from "../../font-src/support/variant-data.mjs";
function getCvData(parsed) {
@ -138,6 +141,7 @@ function uniqueHotChars(cfgDefault, cfgSS) {
return Array.from(s);
}
export const parseVariantsData = async function () {
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
const variantsToml = await fs.promises.readFile(
path.join(__dirname, "../../params/variants.toml"),
"utf8"

View file

@ -1,8 +1,13 @@
import path from "path";
import fs from "fs";
import path from "path";
import * as url from "url";
import semver from "semver";
import { Output } from "./shared/index.mjs";
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
const ChangeFileDir = path.join(__dirname, "../../changes");
const ModifiedSinceVersion = "2.x";
async function GenerateChangeList(argv, out) {

View file

@ -1,7 +1,11 @@
import path from "path";
import fs from "fs";
import path from "path";
import * as url from "url";
import { Output } from "./shared/index.mjs";
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
///////////////////////////////////////////////////////////////////////////////////////////////////
// Copy Markdown
async function CopyMarkdown(out, name) {

View file

@ -1,8 +1,13 @@
import path from "path";
import fs from "fs";
import path from "path";
import * as url from "url";
import SemVer from "semver";
import { Output } from "./shared/index.mjs";
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
const ChangeFileDir = path.join(__dirname, "../../changes");
///////////////////////////////////////////////////////////////////////////////////////////////////
// CHANGE LIST

View file

@ -1,15 +1,17 @@
import fs from "fs";
import path from "path";
import { parseLigationData } from "../export-data/ligation-data.mjs";
import { parseVariantsData } from "../export-data/variants-data.mjs";
import Button from "./templates/button.mjs";
import CharVariant from "./templates/character-variant.mjs";
import GrandTitle from "./templates/grand-title.mjs";
import Languages from "./templates/languages.mjs";
import Weights from "./templates/weights.mjs";
import LigationSet from "./templates/ligation-set.mjs";
import Matrix from "./templates/matrix.mjs";
import StylisticSet from "./templates/stylistic-set.mjs";
import CharVariant from "./templates/character-variant.mjs";
import LigationSet from "./templates/ligation-set.mjs";
import { parseVariantsData } from "../export-data/variants-data.mjs";
import { parseLigationData } from "../export-data/ligation-data.mjs";
import Weights from "./templates/weights.mjs";
class Generator {
constructor(outputDir, fontFiles) {

View file

@ -1,4 +1,5 @@
import * as themes from "../themes/index.mjs";
export default (function (args) {
const theme = themes[args.theme];
const EM = 16;

View file

@ -1,4 +1,5 @@
import * as themes from "../themes/index.mjs";
export default (function (args) {
const theme = themes[args.theme];
const unitWidth = 128;

View file

@ -1,4 +1,5 @@
import * as themes from "../themes/index.mjs";
export default (function (args) {
const theme = themes[args.theme];
const EM = 240;

View file

@ -1,4 +1,5 @@
import * as themes from "../themes/index.mjs";
// prettier-ignore
const languages = [
{ lang: 'English', sample: 'Shaw, those twelve beige hooks are joined if I patch a young, gooey mouth.' },
@ -26,6 +27,7 @@ const languages = [
{ lang: 'Turkish', sample: 'Pijamalı hasta yağız şoföre çabucak güvendi.' },
{ lang: 'Ukrainian', sample: 'Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів!' }
];
export default (function (args) {
const theme = themes[args.theme];
const EM = 24;

View file

@ -1,4 +1,5 @@
import * as themes from "../themes/index.mjs";
function* makeSample(theme, args) {
const groupSet = new Set(args.ligSets);
for (const row of args.ligationSamples) {

View file

@ -1,4 +1,5 @@
import * as themes from "../themes/index.mjs";
export default (function (args) {
const theme = themes[args.theme];
const EM = 48;

View file

@ -1,4 +1,5 @@
import * as themes from "../themes/index.mjs";
const ssStrings = [
["ABC.DEF.GHI.JKL.MNO.PQRS.TUV.WXYZ", "abc.def.ghi.jkl.mno.pqrs.tuv.wxyz"],
["¢ ſß ΓΛΔ αδιλμξ КУЗЯЖэльфязычникж", "float il1[]={1-2/3.4,5+6=7/8%90};"],

View file

@ -1,4 +1,5 @@
import * as themes from "../themes/index.mjs";
export default (function (args) {
const theme = themes[args.theme];
const EM = 48;

View file

@ -1,4 +1,5 @@
import fs from "fs";
import * as wawoff from "wawoff2";
export default (async function (from, to) {

View file

@ -1,5 +1,6 @@
import path from "path";
import fs from "fs";
import path from "path";
import semver from "semver";
const ChangeFileDir = path.join(__dirname, "../../changes");

View file

@ -1,10 +1,11 @@
import * as FS from "fs";
import * as Path from "path";
import * as Verda from "verda";
import which from "which";
import * as toml from "@iarna/toml";
import semver from "semver";
import * as uuid from "uuid";
import * as Verda from "verda";
import which from "which";
///////////////////////////////////////////////////////////
@ -922,7 +923,7 @@ phony(`release`, async target => {
}
const [archiveFiles] = await target.need(goals);
// Create hash of packages
await target.need(fu`utility/create-sha-file.js`);
await target.need(fu`utility/create-sha-file.mjs`);
await node("utility/create-sha-file.mjs", "doc/packages-sha.txt", archiveFiles);
// Images and release notes
await target.need(SampleImages, Pages, AmendReadme, ReleaseNotes, ChangeLog);
@ -938,12 +939,11 @@ const ScriptsUnder = oracle.make(
(target, ext, dir) => FileList({ under: dir, pattern: `**/*.${ext}` })(target)
);
const UtilScriptFiles = computed("util-script-files", async target => {
const [js, ejs, md] = await target.need(
const [mjs, md] = await target.need(
ScriptsUnder("mjs", "utility"),
ScriptsUnder("ejs", "utility"),
ScriptsUnder("md", "utility")
);
return [...js, ...ejs, ...md];
return [...mjs, ...md];
});
const ScriptFiles = computed.group("script-files", async (target, ext) => {
const [ss] = await target.need(ScriptsUnder(ext, `font-src`));