Continue ESM transform
This commit is contained in:
parent
b8205a63aa
commit
36835216f5
44 changed files with 1939 additions and 502 deletions
|
@ -12,7 +12,7 @@
|
||||||
},
|
},
|
||||||
"sourceType": "module"
|
"sourceType": "module"
|
||||||
},
|
},
|
||||||
"extends": ["eslint:recommended", "prettier"],
|
"extends": ["eslint:recommended", "prettier", "plugin:import/recommended"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"semi": ["error", "always"],
|
"semi": ["error", "always"],
|
||||||
"no-var": "error",
|
"no-var": "error",
|
||||||
|
@ -20,6 +20,17 @@
|
||||||
"no-constant-condition": ["error", { "checkLoops": false }],
|
"no-constant-condition": ["error", { "checkLoops": false }],
|
||||||
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
|
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
|
||||||
"no-unused-vars": ["off"],
|
"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 }
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
import { CreateEmptyFont } from "./empty-font.mjs";
|
|
||||||
import { buildGlyphs } from "../glyphs/index.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 { finalizeFont } from "./finalize/index.mjs";
|
||||||
import { convertOtd } from "./otd-conv/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");
|
("use strict");
|
||||||
export async function buildFont(argv, para) {
|
export async function buildFont(argv, para) {
|
||||||
const gs = buildGlyphs(para);
|
const gs = buildGlyphs(para);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import zlib from "zlib";
|
import zlib from "zlib";
|
||||||
|
|
||||||
import { encode, decode } from "@msgpack/msgpack";
|
import { encode, decode } from "@msgpack/msgpack";
|
||||||
|
|
||||||
const Edition = 20;
|
const Edition = 20;
|
||||||
|
@ -75,8 +76,13 @@ class Cache {
|
||||||
export const load = async function (path, version, freshAgeKey) {
|
export const load = async function (path, version, freshAgeKey) {
|
||||||
let cache = new Cache(freshAgeKey);
|
let cache = new Cache(freshAgeKey);
|
||||||
if (path && fs.existsSync(path)) {
|
if (path && fs.existsSync(path)) {
|
||||||
|
try {
|
||||||
const buf = zlib.gunzipSync(await fs.promises.readFile(path));
|
const buf = zlib.gunzipSync(await fs.promises.readFile(path));
|
||||||
cache.loadRep(version, decode(buf));
|
cache.loadRep(version, decode(buf));
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Error loading cache. Treat as empty.");
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return cache;
|
return cache;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import * as TypoGeom from "typo-geom";
|
import * as TypoGeom from "typo-geom";
|
||||||
|
|
||||||
|
import * as CurveUtil from "../../support/geometry/curve-util.mjs";
|
||||||
import * as Geom from "../../support/geometry/index.mjs";
|
import * as Geom from "../../support/geometry/index.mjs";
|
||||||
import { Point } from "../../support/geometry/point.mjs";
|
import { Point } from "../../support/geometry/point.mjs";
|
||||||
import { Transform } from "../../support/geometry/transform.mjs";
|
import { Transform } from "../../support/geometry/transform.mjs";
|
||||||
import * as CurveUtil from "../../support/geometry/curve-util.mjs";
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
function regulateGlyphStore(cache, skew, glyphStore) {
|
function regulateGlyphStore(cache, skew, glyphStore) {
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import { finalizeGlyphs } from "./glyphs.mjs";
|
|
||||||
import { gcFont } from "./gc.mjs";
|
|
||||||
import { Nwid, Wwid } from "../../support/gr.mjs";
|
import { Nwid, Wwid } from "../../support/gr.mjs";
|
||||||
|
|
||||||
|
import { gcFont } from "./gc.mjs";
|
||||||
|
import { finalizeGlyphs } from "./glyphs.mjs";
|
||||||
|
|
||||||
function assignGrAndCodeRank(glyphStore, ...flatteners) {
|
function assignGrAndCodeRank(glyphStore, ...flatteners) {
|
||||||
for (const g of glyphStore.glyphs()) {
|
for (const g of glyphStore.glyphs()) {
|
||||||
g.codeRank = 0xffffffff;
|
g.codeRank = 0xffffffff;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { Joining, AnyCv, TieMark, Nwid, Wwid } from "../../support/gr.mjs";
|
import { Joining, AnyCv, TieMark, Nwid, Wwid } from "../../support/gr.mjs";
|
||||||
|
|
||||||
const ApplePostNames = new Map([
|
const ApplePostNames = new Map([
|
||||||
/* spell-checker: disable */
|
/* spell-checker: disable */
|
||||||
[0xd, "nonmarkingreturn"],
|
[0xd, "nonmarkingreturn"],
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
import { Ot } from "ot-builder";
|
import { Ot } from "ot-builder";
|
||||||
|
|
||||||
import { Point } from "../../support/geometry/point.mjs";
|
import { Point } from "../../support/geometry/point.mjs";
|
||||||
import * as Gr from "../../support/gr.mjs";
|
import * as Gr from "../../support/gr.mjs";
|
||||||
|
|
||||||
import { byCode, bySpacing, byGr, byBuildOrder } from "./glyph-name.mjs";
|
import { byCode, bySpacing, byGr, byBuildOrder } from "./glyph-name.mjs";
|
||||||
|
|
||||||
function byRank([gna, a], [gnb, b]) {
|
function byRank([gna, a], [gnb, b]) {
|
||||||
return (
|
return (
|
||||||
b.glyphRank - a.glyphRank ||
|
b.glyphRank - a.glyphRank ||
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { convertGlyphs } from "./glyphs.mjs";
|
import { convertGlyphs } from "./glyphs.mjs";
|
||||||
import { convertGsub, convertGpos, convertGdef } from "./layout.mjs";
|
import { convertGsub, convertGpos, convertGdef } from "./layout.mjs";
|
||||||
|
|
||||||
export function convertOtd(baseFont, otl, gs) {
|
export function convertOtd(baseFont, otl, gs) {
|
||||||
const { glyphs, cmap } = convertGlyphs(gs);
|
const { glyphs, cmap } = convertGlyphs(gs);
|
||||||
const gsub = convertGsub(otl.GSUB, glyphs);
|
const gsub = convertGsub(otl.GSUB, glyphs);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { Ot } from "ot-builder";
|
import { Ot } from "ot-builder";
|
||||||
|
|
||||||
class LookupStore {
|
class LookupStore {
|
||||||
constructor(handlers, glyphs) {
|
constructor(handlers, glyphs) {
|
||||||
this.glyphs = glyphs;
|
this.glyphs = glyphs;
|
||||||
|
@ -12,20 +13,16 @@ class LookupStore {
|
||||||
return this.m_mapping.get(id);
|
return this.m_mapping.get(id);
|
||||||
}
|
}
|
||||||
declare(id, otdLookup) {
|
declare(id, otdLookup) {
|
||||||
if (this.m_mapping.has(id))
|
if (this.m_mapping.has(id)) return;
|
||||||
return;
|
|
||||||
const handler = this.m_handlers[otdLookup.type];
|
const handler = this.m_handlers[otdLookup.type];
|
||||||
if (!handler)
|
if (!handler) return;
|
||||||
return;
|
|
||||||
this.m_mapping.set(id, handler.init());
|
this.m_mapping.set(id, handler.init());
|
||||||
}
|
}
|
||||||
fill(id, otdLookup) {
|
fill(id, otdLookup) {
|
||||||
const dst = this.query(id);
|
const dst = this.query(id);
|
||||||
const handler = this.m_handlers[otdLookup.type];
|
const handler = this.m_handlers[otdLookup.type];
|
||||||
if (!dst || !handler)
|
if (!dst || !handler) return;
|
||||||
return;
|
if (otdLookup.subtables) throw new Error("Unreachable.");
|
||||||
if (otdLookup.subtables)
|
|
||||||
throw new Error("Unreachable.");
|
|
||||||
handler.fill(dst, otdLookup, this);
|
handler.fill(dst, otdLookup, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,8 +35,7 @@ const GsubSingleHandler = {
|
||||||
for (const k in st) {
|
for (const k in st) {
|
||||||
const from = store.glyphs.queryByName(k);
|
const from = store.glyphs.queryByName(k);
|
||||||
const to = store.glyphs.queryByName(st[k]);
|
const to = store.glyphs.queryByName(st[k]);
|
||||||
if (from && to)
|
if (from && to) dst.mapping.set(from, to);
|
||||||
dst.mapping.set(from, to);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -52,8 +48,7 @@ const GsubMultipleHandler = {
|
||||||
for (const k in st) {
|
for (const k in st) {
|
||||||
const from = store.glyphs.queryByName(k);
|
const from = store.glyphs.queryByName(k);
|
||||||
const to = mapGlyphListAll(st[k], store);
|
const to = mapGlyphListAll(st[k], store);
|
||||||
if (!from || !to)
|
if (!from || !to) continue;
|
||||||
continue;
|
|
||||||
dst.mapping.set(from, to);
|
dst.mapping.set(from, to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,8 +68,7 @@ const GsubLigatureHandler = {
|
||||||
for (const { from: _from, to: _to } of st) {
|
for (const { from: _from, to: _to } of st) {
|
||||||
const to = store.glyphs.queryByName(_to);
|
const to = store.glyphs.queryByName(_to);
|
||||||
const from = mapGlyphListAll(_from, store);
|
const from = mapGlyphListAll(_from, store);
|
||||||
if (!from || !to)
|
if (!from || !to) continue;
|
||||||
continue;
|
|
||||||
dst.mapping.push({ from, to });
|
dst.mapping.push({ from, to });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,8 +82,7 @@ const GsubChainingHandler = {
|
||||||
const match = [];
|
const match = [];
|
||||||
for (const m of st.match) {
|
for (const m of st.match) {
|
||||||
const m1 = mapGlyphListSome(m, store);
|
const m1 = mapGlyphListSome(m, store);
|
||||||
if (!m1)
|
if (!m1) continue out;
|
||||||
continue out;
|
|
||||||
match.push(new Set(m1));
|
match.push(new Set(m1));
|
||||||
}
|
}
|
||||||
const inputBegins = st.inputBegins;
|
const inputBegins = st.inputBegins;
|
||||||
|
@ -97,8 +90,7 @@ const GsubChainingHandler = {
|
||||||
const applications = [];
|
const applications = [];
|
||||||
for (const ap of st.apply) {
|
for (const ap of st.apply) {
|
||||||
const lookup = store.query(ap.lookup);
|
const lookup = store.query(ap.lookup);
|
||||||
if (!lookup)
|
if (!lookup) continue out;
|
||||||
continue out;
|
|
||||||
applications.push({ at: ap.at - inputBegins, apply: lookup });
|
applications.push({ at: ap.at - inputBegins, apply: lookup });
|
||||||
}
|
}
|
||||||
dst.rules.push({ match, inputBegins, inputEnds, applications });
|
dst.rules.push({ match, inputBegins, inputEnds, applications });
|
||||||
|
@ -119,23 +111,19 @@ const GsubReverseHandler = {
|
||||||
const m1 = new Set();
|
const m1 = new Set();
|
||||||
for (let k = 0; k < st.match[j].length; k++) {
|
for (let k = 0; k < st.match[j].length; k++) {
|
||||||
const gFrom = store.glyphs.queryByName(st.match[j][k]);
|
const gFrom = store.glyphs.queryByName(st.match[j][k]);
|
||||||
if (gFrom)
|
if (gFrom) m1.add(gFrom);
|
||||||
m1.add(gFrom);
|
|
||||||
}
|
}
|
||||||
if (!m1.size)
|
if (!m1.size) continue out;
|
||||||
continue out;
|
|
||||||
match.push(m1);
|
match.push(m1);
|
||||||
}
|
}
|
||||||
if (j === doSubAt) {
|
if (j === doSubAt) {
|
||||||
for (let k = 0; k < st.match[j].length; k++) {
|
for (let k = 0; k < st.match[j].length; k++) {
|
||||||
const gFrom = store.glyphs.queryByName(st.match[j][k]);
|
const gFrom = store.glyphs.queryByName(st.match[j][k]);
|
||||||
const gTo = store.glyphs.queryByName(st.to[k]);
|
const gTo = store.glyphs.queryByName(st.to[k]);
|
||||||
if (!gFrom)
|
if (!gFrom) continue;
|
||||||
continue;
|
|
||||||
if (gTo) {
|
if (gTo) {
|
||||||
replacement.set(gFrom, gTo);
|
replacement.set(gFrom, gTo);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
replacement.set(gFrom, gFrom);
|
replacement.set(gFrom, gFrom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,8 +137,7 @@ function mapGlyphListAll(gl, store) {
|
||||||
const out = [];
|
const out = [];
|
||||||
for (const item of gl) {
|
for (const item of gl) {
|
||||||
const fg = store.glyphs.queryByName(item);
|
const fg = store.glyphs.queryByName(item);
|
||||||
if (!fg)
|
if (!fg) return null;
|
||||||
return null;
|
|
||||||
out.push(fg);
|
out.push(fg);
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
|
@ -159,12 +146,10 @@ function mapGlyphListSome(gl, store) {
|
||||||
const out = [];
|
const out = [];
|
||||||
for (const item of gl) {
|
for (const item of gl) {
|
||||||
const fg = store.glyphs.queryByName(item);
|
const fg = store.glyphs.queryByName(item);
|
||||||
if (!fg)
|
if (!fg) continue;
|
||||||
continue;
|
|
||||||
out.push(fg);
|
out.push(fg);
|
||||||
}
|
}
|
||||||
if (!out.length)
|
if (!out.length) return null;
|
||||||
return null;
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
const GsubHandlers = {
|
const GsubHandlers = {
|
||||||
|
@ -212,8 +197,7 @@ function convertMarkRecords(marks, mm, store) {
|
||||||
for (const gn in marks) {
|
for (const gn in marks) {
|
||||||
const mark = marks[gn];
|
const mark = marks[gn];
|
||||||
const g = store.glyphs.queryByName(gn);
|
const g = store.glyphs.queryByName(gn);
|
||||||
if (!g)
|
if (!g) continue;
|
||||||
continue;
|
|
||||||
let markAnchors = [];
|
let markAnchors = [];
|
||||||
markAnchors[mm.get(mark.class)] = { x: mark.x, y: mark.y };
|
markAnchors[mm.get(mark.class)] = { x: mark.x, y: mark.y };
|
||||||
out.set(g, { markAnchors: markAnchors });
|
out.set(g, { markAnchors: markAnchors });
|
||||||
|
@ -225,8 +209,7 @@ function convertBaseRecords(bases, mm, store) {
|
||||||
for (const gn in bases) {
|
for (const gn in bases) {
|
||||||
const baseObj = bases[gn];
|
const baseObj = bases[gn];
|
||||||
const g = store.glyphs.queryByName(gn);
|
const g = store.glyphs.queryByName(gn);
|
||||||
if (!g)
|
if (!g) continue;
|
||||||
continue;
|
|
||||||
const baseArray = [];
|
const baseArray = [];
|
||||||
for (const bkStr in baseObj) {
|
for (const bkStr in baseObj) {
|
||||||
baseArray[mm.get(bkStr)] = baseObj[bkStr];
|
baseArray[mm.get(bkStr)] = baseObj[bkStr];
|
||||||
|
@ -255,8 +238,7 @@ class FeatureStore {
|
||||||
const lookups = [];
|
const lookups = [];
|
||||||
for (const lid of data) {
|
for (const lid of data) {
|
||||||
const lookup = this.lookupStore.query(lid);
|
const lookup = this.lookupStore.query(lid);
|
||||||
if (lookup)
|
if (lookup) lookups.push(lookup);
|
||||||
lookups.push(lookup);
|
|
||||||
}
|
}
|
||||||
this.m_mapping.set(id, { tag, lookups });
|
this.m_mapping.set(id, { tag, lookups });
|
||||||
}
|
}
|
||||||
|
@ -278,17 +260,14 @@ class ScriptLanguageStore {
|
||||||
this.m_scriptMapping.set(scriptTag, sr);
|
this.m_scriptMapping.set(scriptTag, sr);
|
||||||
}
|
}
|
||||||
const lr = this.createLanguageRecord(data);
|
const lr = this.createLanguageRecord(data);
|
||||||
if (languageTag === "dflt" || languageTag === "DFLT")
|
if (languageTag === "dflt" || languageTag === "DFLT") sr.defaultLanguage = lr;
|
||||||
sr.defaultLanguage = lr;
|
else sr.languages.set(languageTag, lr);
|
||||||
else
|
|
||||||
sr.languages.set(languageTag, lr);
|
|
||||||
}
|
}
|
||||||
createLanguageRecord(data) {
|
createLanguageRecord(data) {
|
||||||
const features = [];
|
const features = [];
|
||||||
for (const fid of data.features) {
|
for (const fid of data.features) {
|
||||||
const feature = this.featureStore.query(fid);
|
const feature = this.featureStore.query(fid);
|
||||||
if (feature)
|
if (feature) features.push(feature);
|
||||||
features.push(feature);
|
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
requiredFeature: this.featureStore.query(data.requiredFeature) || null,
|
requiredFeature: this.featureStore.query(data.requiredFeature) || null,
|
||||||
|
@ -298,28 +277,22 @@ class ScriptLanguageStore {
|
||||||
}
|
}
|
||||||
function ConvertGsubGposT(handlers, T) {
|
function ConvertGsubGposT(handlers, T) {
|
||||||
return function (table, glyphs) {
|
return function (table, glyphs) {
|
||||||
if (!table)
|
if (!table) return null;
|
||||||
return null;
|
|
||||||
const ls = new LookupStore(handlers, glyphs);
|
const ls = new LookupStore(handlers, glyphs);
|
||||||
if (table.lookups) {
|
if (table.lookups) {
|
||||||
if (table.lookupOrder) {
|
if (table.lookupOrder) {
|
||||||
for (const l of table.lookupOrder)
|
for (const l of table.lookupOrder) ls.declare(l, table.lookups[l]);
|
||||||
ls.declare(l, table.lookups[l]);
|
|
||||||
}
|
}
|
||||||
for (const l in table.lookups)
|
for (const l in table.lookups) ls.declare(l, table.lookups[l]);
|
||||||
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.fill(l, table.lookups[l]);
|
|
||||||
}
|
}
|
||||||
const fs = new FeatureStore(ls);
|
const fs = new FeatureStore(ls);
|
||||||
if (table.features) {
|
if (table.features) {
|
||||||
for (const f in table.features)
|
for (const f in table.features) fs.fill(f, table.features[f]);
|
||||||
fs.fill(f, table.features[f]);
|
|
||||||
}
|
}
|
||||||
const ss = new ScriptLanguageStore(fs);
|
const ss = new ScriptLanguageStore(fs);
|
||||||
if (table.languages) {
|
if (table.languages) {
|
||||||
for (const sl in table.languages)
|
for (const sl in table.languages) ss.fill(sl, table.languages[sl]);
|
||||||
ss.fill(sl, table.languages[sl]);
|
|
||||||
}
|
}
|
||||||
return new T(ss.extract(), fs.extract(), ls.extract());
|
return new T(ss.extract(), fs.extract(), ls.extract());
|
||||||
};
|
};
|
||||||
|
@ -329,8 +302,7 @@ function convertGdef(otdGdef, glyphs) {
|
||||||
gdef.glyphClassDef = new Map();
|
gdef.glyphClassDef = new Map();
|
||||||
for (const gn in otdGdef.glyphClassDef) {
|
for (const gn in otdGdef.glyphClassDef) {
|
||||||
const g = glyphs.queryByName(gn);
|
const g = glyphs.queryByName(gn);
|
||||||
if (g)
|
if (g) gdef.glyphClassDef.set(g, otdGdef.glyphClassDef[gn]);
|
||||||
gdef.glyphClassDef.set(g, otdGdef.glyphClassDef[gn]);
|
|
||||||
}
|
}
|
||||||
return gdef;
|
return gdef;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import zlib from "zlib";
|
|
||||||
import * as url from "url";
|
import * as url from "url";
|
||||||
|
import zlib from "zlib";
|
||||||
|
|
||||||
|
import * as Toml from "@iarna/toml";
|
||||||
import { encode } from "@msgpack/msgpack";
|
import { encode } from "@msgpack/msgpack";
|
||||||
import { FontIo } from "ot-builder";
|
import { FontIo } from "ot-builder";
|
||||||
import * as Toml from "@iarna/toml";
|
|
||||||
import { buildFont } from "./gen/build-font.mjs";
|
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 { 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 __filename = url.fileURLToPath(import.meta.url);
|
||||||
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
||||||
|
|
|
@ -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
|
|
||||||
};
|
|
||||||
};
|
|
|
@ -1,4 +1,5 @@
|
||||||
import * as TypoGeom from "typo-geom";
|
import * as TypoGeom from "typo-geom";
|
||||||
|
|
||||||
import { BooleanGeometry, TransformedGeometry } from "../support/geometry/index.mjs";
|
import { BooleanGeometry, TransformedGeometry } from "../support/geometry/index.mjs";
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as CurveUtil from "../support/geometry/curve-util.mjs";
|
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 { BiKnotCollector } from "../support/geometry/spiro-expand.mjs";
|
||||||
import { fallback, mix, bez3 } from "../support/utils.mjs";
|
import { fallback, mix, bez3 } from "../support/utils.mjs";
|
||||||
import { SpiroGeometry, DiSpiroGeometry } from "../support/geometry/index.mjs";
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
class DispiroImpl {
|
class DispiroImpl {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import * as TypoGeom from "typo-geom";
|
import * as TypoGeom from "typo-geom";
|
||||||
|
|
||||||
import { Point } from "./point.mjs";
|
import { Point } from "./point.mjs";
|
||||||
import { Transform } from "./transform.mjs";
|
import { Transform } from "./transform.mjs";
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
import * as TypoGeom from "typo-geom";
|
|
||||||
import * as SpiroJs from "spiro";
|
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 Format from "../util/formatter.mjs";
|
||||||
|
|
||||||
|
import * as CurveUtil from "./curve-util.mjs";
|
||||||
import { Point } from "./point.mjs";
|
import { Point } from "./point.mjs";
|
||||||
import { Transform } from "./transform.mjs";
|
|
||||||
import { SpiroExpander } from "./spiro-expand.mjs";
|
import { SpiroExpander } from "./spiro-expand.mjs";
|
||||||
|
import { Transform } from "./transform.mjs";
|
||||||
|
|
||||||
class GeometryBase {
|
class GeometryBase {
|
||||||
asContours() {
|
asContours() {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import * as SpiroJs from "spiro";
|
import * as SpiroJs from "spiro";
|
||||||
import { linreg } from "../utils.mjs";
|
|
||||||
import * as Format from "../util/formatter.mjs";
|
import * as Format from "../util/formatter.mjs";
|
||||||
|
import { linreg } from "../utils.mjs";
|
||||||
|
|
||||||
class BiKnot {
|
class BiKnot {
|
||||||
constructor(type, x, y, d1, d2) {
|
constructor(type, x, y, d1, d2) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Transform } from "../geometry/transform.mjs";
|
|
||||||
import { Point } from "../geometry/point.mjs";
|
|
||||||
import { Anchor } from "../geometry/anchor.mjs";
|
import { Anchor } from "../geometry/anchor.mjs";
|
||||||
import * as Geom from "../geometry/index.mjs";
|
import * as Geom from "../geometry/index.mjs";
|
||||||
|
import { Point } from "../geometry/point.mjs";
|
||||||
|
import { Transform } from "../geometry/transform.mjs";
|
||||||
|
|
||||||
export class Glyph {
|
export class Glyph {
|
||||||
constructor(_identifier) {
|
constructor(_identifier) {
|
||||||
|
|
1415
package-lock.json
generated
1415
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -24,6 +24,7 @@
|
||||||
"cldr": "^7.2.0",
|
"cldr": "^7.2.0",
|
||||||
"eslint": "^8.18.0",
|
"eslint": "^8.18.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"patel": "^0.38.0",
|
"patel": "^0.38.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"verda": "^1.10.0",
|
"verda": "^1.10.0",
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
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 { parseLigationData } from "../export-data/ligation-data.mjs";
|
||||||
import { getCharMapAndSupportedLanguageList } from "../export-data/supported-languages.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) {
|
async function processSsOt(dirs) {
|
||||||
const variantsData = await parseVariantsData();
|
const variantsData = await parseVariantsData();
|
||||||
|
|
|
@ -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++) {
|
for (let i = 2; i < process.argv.length; i++) {
|
||||||
const lch = parseInt(process.argv[i], 16);
|
const lch = parseInt(process.argv[i], 16);
|
||||||
const name = ucdNames.get(lch);
|
const name = ucdNames.get(lch);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import fs from "fs";
|
|
||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
|
import fs from "fs";
|
||||||
|
|
||||||
function hashFile(path) {
|
function hashFile(path) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let sum = crypto.createHash("sha256");
|
let sum = crypto.createHash("sha256");
|
||||||
|
@ -10,8 +11,7 @@ function hashFile(path) {
|
||||||
fileStream.on("data", chunk => {
|
fileStream.on("data", chunk => {
|
||||||
try {
|
try {
|
||||||
sum.update(chunk);
|
sum.update(chunk);
|
||||||
}
|
} catch (ex) {
|
||||||
catch (ex) {
|
|
||||||
return reject(ex);
|
return reject(ex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import UnicodeDataIndex from "@unicode/unicode-14.0.0";
|
import UnicodeDataIndex from "@unicode/unicode-14.0.0";
|
||||||
|
|
||||||
|
export async function collectBlockData() {
|
||||||
const BlockData = [
|
const BlockData = [
|
||||||
[[0xe0a0, 0xe0df], "Private Use Area — Powerline"],
|
[[0xe0a0, 0xe0df], "Private Use Area — Powerline"],
|
||||||
[[0xee00, 0xee3f], "Private Use Area — Progress Bar"],
|
[[0xee00, 0xee3f], "Private Use Area — Progress Bar"],
|
||||||
|
@ -6,10 +8,13 @@ const BlockData = [
|
||||||
[[0x1fa70, 0x1faff], "Symbols and Pictographs Extended-A "],
|
[[0x1fa70, 0x1faff], "Symbols and Pictographs Extended-A "],
|
||||||
[[0x1fb00, 0x1fbff], "Symbols for Legacy Computing"]
|
[[0x1fb00, 0x1fbff], "Symbols for Legacy Computing"]
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const id of UnicodeDataIndex.Block) {
|
for (const id of UnicodeDataIndex.Block) {
|
||||||
if (!id || /Private_Use_Area/.test(id) || /undefined/.test(id))
|
if (!id || /Private_Use_Area/.test(id) || /undefined/.test(id)) continue;
|
||||||
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.push([[rg[0].begin, rg[0].end - 1], id.replace(/_/g, " ")]);
|
||||||
}
|
}
|
||||||
BlockData.sort((a, b) => a[0][0] - b[0][0]);
|
BlockData.sort((a, b) => a[0][0] - b[0][0]);
|
||||||
export { BlockData };
|
return BlockData;
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import { BlockData } from "./block-data.mjs";
|
import ugc from "@unicode/unicode-14.0.0/General_Category/index.js";
|
||||||
import ucdNames from "@unicode/unicode-14.0.0/Names";
|
import ucdNames from "@unicode/unicode-14.0.0/Names/index.js";
|
||||||
import ugc from "@unicode/unicode-14.0.0/General_Category";
|
|
||||||
|
import { collectBlockData } from "./block-data.mjs";
|
||||||
|
|
||||||
function findFirstLastChar(lchBlockStart, lchBlockEnd, cov) {
|
function findFirstLastChar(lchBlockStart, lchBlockEnd, cov) {
|
||||||
let lchFirst = 0,
|
let lchFirst = 0,
|
||||||
lchLast = 0;
|
lchLast = 0;
|
||||||
|
@ -18,9 +20,9 @@ function findFirstLastChar(lchBlockStart, lchBlockEnd, cov) {
|
||||||
const lchEnd = ((lchLast >>> 4) << 4) + 0x10;
|
const lchEnd = ((lchLast >>> 4) << 4) + 0x10;
|
||||||
return [lchStart, lchEnd];
|
return [lchStart, lchEnd];
|
||||||
}
|
}
|
||||||
export const gatherCoverageData = function (covUpright, covItalic, covOblique) {
|
export async function gatherCoverageData(covUpright, covItalic, covOblique) {
|
||||||
const result = [];
|
const result = [];
|
||||||
for (const [[lchBlockStart, lchBlockEnd], block] of BlockData) {
|
for (const [[lchBlockStart, lchBlockEnd], block] of await collectBlockData()) {
|
||||||
let blockResults = [];
|
let blockResults = [];
|
||||||
const [lchStart, lchEnd] = findFirstLastChar(lchBlockStart, lchBlockEnd, covUpright);
|
const [lchStart, lchEnd] = findFirstLastChar(lchBlockStart, lchBlockEnd, covUpright);
|
||||||
if (!lchStart || !lchEnd) continue;
|
if (!lchStart || !lchEnd) continue;
|
||||||
|
@ -63,4 +65,4 @@ export const gatherCoverageData = function (covUpright, covItalic, covOblique) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
}
|
||||||
|
|
|
@ -1,11 +1,19 @@
|
||||||
import fs from "fs";
|
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 { parseLigationData } from "./ligation-data.mjs";
|
||||||
import { getCharMapAndSupportedLanguageList } from "./supported-languages.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 variantsData = await parseVariantsData();
|
||||||
const ligationData = await parseLigationData();
|
const ligationData = await parseLigationData();
|
||||||
const cl = await getCharMapAndSupportedLanguageList(
|
const cl = await getCharMapAndSupportedLanguageList(
|
||||||
|
@ -32,4 +40,4 @@ export default (async function main(argv) {
|
||||||
argv.exportPathCov,
|
argv.exportPathCov,
|
||||||
JSON.stringify({ version, ...cl }, { spaces: 2 })
|
JSON.stringify({ version, ...cl }, { spaces: 2 })
|
||||||
);
|
);
|
||||||
});
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
import * as url from "url";
|
||||||
|
|
||||||
import * as toml from "@iarna/toml";
|
import * as toml from "@iarna/toml";
|
||||||
|
|
||||||
const ligationSamples = [
|
const ligationSamples = [
|
||||||
|
@ -217,6 +219,7 @@ function buildLigationSet(ligData, getKey) {
|
||||||
return ligationSets;
|
return ligationSets;
|
||||||
}
|
}
|
||||||
export const parseLigationData = async function () {
|
export const parseLigationData = async function () {
|
||||||
|
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
||||||
const ligToml = await fs.promises.readFile(
|
const ligToml = await fs.promises.readFile(
|
||||||
path.join(__dirname, "../../params/ligation-set.toml"),
|
path.join(__dirname, "../../params/ligation-set.toml"),
|
||||||
"utf8"
|
"utf8"
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
import cldr from "cldr";
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import zlib from "zlib";
|
import zlib from "zlib";
|
||||||
|
|
||||||
import { decode } from "@msgpack/msgpack";
|
import { decode } from "@msgpack/msgpack";
|
||||||
|
import cldr from "cldr";
|
||||||
|
|
||||||
import { gatherCoverageData } from "./coverage-export/gather-coverage-data.mjs";
|
import { gatherCoverageData } from "./coverage-export/gather-coverage-data.mjs";
|
||||||
|
|
||||||
// List all the languages that Iosevka supports, but cannot inferred from CLDR data.
|
// 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]);
|
for (const u of codes) rawCoverage.set(u, [gn, tv, cv]);
|
||||||
return rawCoverage;
|
return rawCoverage;
|
||||||
}
|
}
|
||||||
export const getCharMapAndSupportedLanguageList = async function (
|
export async function getCharMapAndSupportedLanguageList(cmpUpright, cmpItalic, cmpOblique) {
|
||||||
cmpUpright,
|
|
||||||
cmpItalic,
|
|
||||||
cmpOblique
|
|
||||||
) {
|
|
||||||
const charMap = await readMpCharMap(cmpUpright);
|
const charMap = await readMpCharMap(cmpUpright);
|
||||||
const charMapItalic = await readMpCharMap(cmpItalic);
|
const charMapItalic = await readMpCharMap(cmpItalic);
|
||||||
const charMapOblique = await readMpCharMap(cmpOblique);
|
const charMapOblique = await readMpCharMap(cmpOblique);
|
||||||
|
@ -90,7 +88,11 @@ export const getCharMapAndSupportedLanguageList = async function (
|
||||||
glyphCount: charMap.length,
|
glyphCount: charMap.length,
|
||||||
codePointCount: rawCoverage.size
|
codePointCount: rawCoverage.size
|
||||||
},
|
},
|
||||||
unicodeCoverage: gatherCoverageData(rawCoverage, rawCoverageItalic, rawCoverageOblique),
|
unicodeCoverage: await gatherCoverageData(
|
||||||
|
rawCoverage,
|
||||||
|
rawCoverageItalic,
|
||||||
|
rawCoverageOblique
|
||||||
|
),
|
||||||
languages: Array.from(getSupportedLanguageSet(rawCoverage)).sort()
|
languages: Array.from(getSupportedLanguageSet(rawCoverage)).sort()
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
import * as url from "url";
|
||||||
|
|
||||||
import * as toml from "@iarna/toml";
|
import * as toml from "@iarna/toml";
|
||||||
|
|
||||||
import * as VariantDataParser from "../../font-src/support/variant-data.mjs";
|
import * as VariantDataParser from "../../font-src/support/variant-data.mjs";
|
||||||
|
|
||||||
function getCvData(parsed) {
|
function getCvData(parsed) {
|
||||||
|
@ -138,6 +141,7 @@ function uniqueHotChars(cfgDefault, cfgSS) {
|
||||||
return Array.from(s);
|
return Array.from(s);
|
||||||
}
|
}
|
||||||
export const parseVariantsData = async function () {
|
export const parseVariantsData = async function () {
|
||||||
|
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
||||||
const variantsToml = await fs.promises.readFile(
|
const variantsToml = await fs.promises.readFile(
|
||||||
path.join(__dirname, "../../params/variants.toml"),
|
path.join(__dirname, "../../params/variants.toml"),
|
||||||
"utf8"
|
"utf8"
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
import path from "path";
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
import path from "path";
|
||||||
|
import * as url from "url";
|
||||||
|
|
||||||
import semver from "semver";
|
import semver from "semver";
|
||||||
|
|
||||||
import { Output } from "./shared/index.mjs";
|
import { Output } from "./shared/index.mjs";
|
||||||
|
|
||||||
|
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
||||||
|
|
||||||
const ChangeFileDir = path.join(__dirname, "../../changes");
|
const ChangeFileDir = path.join(__dirname, "../../changes");
|
||||||
const ModifiedSinceVersion = "2.x";
|
const ModifiedSinceVersion = "2.x";
|
||||||
async function GenerateChangeList(argv, out) {
|
async function GenerateChangeList(argv, out) {
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
import path from "path";
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
import path from "path";
|
||||||
|
import * as url from "url";
|
||||||
|
|
||||||
import { Output } from "./shared/index.mjs";
|
import { Output } from "./shared/index.mjs";
|
||||||
|
|
||||||
|
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Copy Markdown
|
// Copy Markdown
|
||||||
async function CopyMarkdown(out, name) {
|
async function CopyMarkdown(out, name) {
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
import path from "path";
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
import path from "path";
|
||||||
|
import * as url from "url";
|
||||||
|
|
||||||
import SemVer from "semver";
|
import SemVer from "semver";
|
||||||
|
|
||||||
import { Output } from "./shared/index.mjs";
|
import { Output } from "./shared/index.mjs";
|
||||||
|
|
||||||
|
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
||||||
|
|
||||||
const ChangeFileDir = path.join(__dirname, "../../changes");
|
const ChangeFileDir = path.join(__dirname, "../../changes");
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// CHANGE LIST
|
// CHANGE LIST
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
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 Button from "./templates/button.mjs";
|
||||||
|
import CharVariant from "./templates/character-variant.mjs";
|
||||||
import GrandTitle from "./templates/grand-title.mjs";
|
import GrandTitle from "./templates/grand-title.mjs";
|
||||||
import Languages from "./templates/languages.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 Matrix from "./templates/matrix.mjs";
|
||||||
import StylisticSet from "./templates/stylistic-set.mjs";
|
import StylisticSet from "./templates/stylistic-set.mjs";
|
||||||
import CharVariant from "./templates/character-variant.mjs";
|
import Weights from "./templates/weights.mjs";
|
||||||
import LigationSet from "./templates/ligation-set.mjs";
|
|
||||||
import { parseVariantsData } from "../export-data/variants-data.mjs";
|
|
||||||
import { parseLigationData } from "../export-data/ligation-data.mjs";
|
|
||||||
|
|
||||||
class Generator {
|
class Generator {
|
||||||
constructor(outputDir, fontFiles) {
|
constructor(outputDir, fontFiles) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import * as themes from "../themes/index.mjs";
|
import * as themes from "../themes/index.mjs";
|
||||||
|
|
||||||
export default (function (args) {
|
export default (function (args) {
|
||||||
const theme = themes[args.theme];
|
const theme = themes[args.theme];
|
||||||
const EM = 16;
|
const EM = 16;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import * as themes from "../themes/index.mjs";
|
import * as themes from "../themes/index.mjs";
|
||||||
|
|
||||||
export default (function (args) {
|
export default (function (args) {
|
||||||
const theme = themes[args.theme];
|
const theme = themes[args.theme];
|
||||||
const unitWidth = 128;
|
const unitWidth = 128;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import * as themes from "../themes/index.mjs";
|
import * as themes from "../themes/index.mjs";
|
||||||
|
|
||||||
export default (function (args) {
|
export default (function (args) {
|
||||||
const theme = themes[args.theme];
|
const theme = themes[args.theme];
|
||||||
const EM = 240;
|
const EM = 240;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import * as themes from "../themes/index.mjs";
|
import * as themes from "../themes/index.mjs";
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
const languages = [
|
const languages = [
|
||||||
{ lang: 'English', sample: 'Shaw, those twelve beige hooks are joined if I patch a young, gooey mouth.' },
|
{ 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: 'Turkish', sample: 'Pijamalı hasta yağız şoföre çabucak güvendi.' },
|
||||||
{ lang: 'Ukrainian', sample: 'Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів!' }
|
{ lang: 'Ukrainian', sample: 'Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів!' }
|
||||||
];
|
];
|
||||||
|
|
||||||
export default (function (args) {
|
export default (function (args) {
|
||||||
const theme = themes[args.theme];
|
const theme = themes[args.theme];
|
||||||
const EM = 24;
|
const EM = 24;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import * as themes from "../themes/index.mjs";
|
import * as themes from "../themes/index.mjs";
|
||||||
|
|
||||||
function* makeSample(theme, args) {
|
function* makeSample(theme, args) {
|
||||||
const groupSet = new Set(args.ligSets);
|
const groupSet = new Set(args.ligSets);
|
||||||
for (const row of args.ligationSamples) {
|
for (const row of args.ligationSamples) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import * as themes from "../themes/index.mjs";
|
import * as themes from "../themes/index.mjs";
|
||||||
|
|
||||||
export default (function (args) {
|
export default (function (args) {
|
||||||
const theme = themes[args.theme];
|
const theme = themes[args.theme];
|
||||||
const EM = 48;
|
const EM = 48;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import * as themes from "../themes/index.mjs";
|
import * as themes from "../themes/index.mjs";
|
||||||
|
|
||||||
const ssStrings = [
|
const ssStrings = [
|
||||||
["ABC.DEF.GHI.JKL.MNO.PQRS.TUV.WXYZ", "abc.def.ghi.jkl.mno.pqrs.tuv.wxyz"],
|
["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};"],
|
["¢ ſß ΓΛΔ αδιλμξ КУЗЯЖэльфязычникж", "float il1[]={1-2/3.4,5+6=7/8%90};"],
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import * as themes from "../themes/index.mjs";
|
import * as themes from "../themes/index.mjs";
|
||||||
|
|
||||||
export default (function (args) {
|
export default (function (args) {
|
||||||
const theme = themes[args.theme];
|
const theme = themes[args.theme];
|
||||||
const EM = 48;
|
const EM = 48;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
|
||||||
import * as wawoff from "wawoff2";
|
import * as wawoff from "wawoff2";
|
||||||
|
|
||||||
export default (async function (from, to) {
|
export default (async function (from, to) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import path from "path";
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
import path from "path";
|
||||||
|
|
||||||
import semver from "semver";
|
import semver from "semver";
|
||||||
|
|
||||||
const ChangeFileDir = path.join(__dirname, "../../changes");
|
const ChangeFileDir = path.join(__dirname, "../../changes");
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import * as FS from "fs";
|
import * as FS from "fs";
|
||||||
import * as Path from "path";
|
import * as Path from "path";
|
||||||
import * as Verda from "verda";
|
|
||||||
import which from "which";
|
|
||||||
import * as toml from "@iarna/toml";
|
import * as toml from "@iarna/toml";
|
||||||
import semver from "semver";
|
import semver from "semver";
|
||||||
import * as uuid from "uuid";
|
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);
|
const [archiveFiles] = await target.need(goals);
|
||||||
// Create hash of packages
|
// 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);
|
await node("utility/create-sha-file.mjs", "doc/packages-sha.txt", archiveFiles);
|
||||||
// Images and release notes
|
// Images and release notes
|
||||||
await target.need(SampleImages, Pages, AmendReadme, ReleaseNotes, ChangeLog);
|
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)
|
(target, ext, dir) => FileList({ under: dir, pattern: `**/*.${ext}` })(target)
|
||||||
);
|
);
|
||||||
const UtilScriptFiles = computed("util-script-files", async 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("mjs", "utility"),
|
||||||
ScriptsUnder("ejs", "utility"),
|
|
||||||
ScriptsUnder("md", "utility")
|
ScriptsUnder("md", "utility")
|
||||||
);
|
);
|
||||||
return [...js, ...ejs, ...md];
|
return [...mjs, ...md];
|
||||||
});
|
});
|
||||||
const ScriptFiles = computed.group("script-files", async (target, ext) => {
|
const ScriptFiles = computed.group("script-files", async (target, ext) => {
|
||||||
const [ss] = await target.need(ScriptsUnder(ext, `font-src`));
|
const [ss] = await target.need(ScriptsUnder(ext, `font-src`));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue