format and fix certain build breaks
This commit is contained in:
parent
12a3b8c244
commit
d5661093ff
65 changed files with 553 additions and 862 deletions
|
@ -13,7 +13,7 @@
|
||||||
"sourceType": "module"
|
"sourceType": "module"
|
||||||
},
|
},
|
||||||
"extends": ["eslint:recommended", "prettier", "plugin:import/recommended"],
|
"extends": ["eslint:recommended", "prettier", "plugin:import/recommended"],
|
||||||
"ignorePatterns": ["/font-src/glyphs", "/font-src/meta", "/font-src/otl"],
|
"ignorePatterns": ["packages/font-glyphs", "packages/font-otl"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"semi": ["error", "always"],
|
"semi": ["error", "always"],
|
||||||
"no-var": "error",
|
"no-var": "error",
|
||||||
|
|
|
@ -2,5 +2,4 @@
|
||||||
printWidth: 100
|
printWidth: 100
|
||||||
useTabs: true
|
useTabs: true
|
||||||
tabWidth: 4
|
tabWidth: 4
|
||||||
trailingComma: none
|
|
||||||
arrowParens: avoid
|
arrowParens: avoid
|
|
@ -53,7 +53,7 @@ glyph-block Symbol-Geometric-Sun-And-Gear : for-width-kinds WideWidth1
|
||||||
set-width Geom.Width
|
set-width Geom.Width
|
||||||
include : refer-glyph : MangleName 'gearWithoutHub'
|
include : refer-glyph : MangleName 'gearWithoutHub'
|
||||||
include : RingAt Geom.MidX Geom.MidY (0.4 * (gearRingRad - rayWidth))
|
include : RingAt Geom.MidX Geom.MidY (0.4 * (gearRingRad - rayWidth))
|
||||||
alias [MangleName 'lighthouseSymbol'] 0x26EF [MangleName 'gear']
|
alias [MangleName 'lighthouseSymbol'] [MangleUnicode 0x26EF] [MangleName 'gear']
|
||||||
|
|
||||||
create-glyph [MangleName 'helm'] [MangleUnicode 0x2388] : glyph-proc
|
create-glyph [MangleName 'helm'] [MangleUnicode 0x2388] : glyph-proc
|
||||||
set-width Geom.Width
|
set-width Geom.Width
|
||||||
|
|
|
@ -22,8 +22,8 @@ class BooleImpl {
|
||||||
return glyph.includeGeometry(
|
return glyph.includeGeometry(
|
||||||
new TransformedGeometry(
|
new TransformedGeometry(
|
||||||
new BooleanGeometry(this.operator, operandGeometries),
|
new BooleanGeometry(this.operator, operandGeometries),
|
||||||
forwardGizmo
|
forwardGizmo,
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,6 @@ export function SetupBuilders(bindings) {
|
||||||
return {
|
return {
|
||||||
union: union,
|
union: union,
|
||||||
intersection: intersection,
|
intersection: intersection,
|
||||||
difference: difference
|
difference: difference,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {
|
||||||
BiKnotCollector,
|
BiKnotCollector,
|
||||||
UserControlKnot,
|
UserControlKnot,
|
||||||
Interpolator,
|
Interpolator,
|
||||||
TerminateInstruction
|
TerminateInstruction,
|
||||||
} from "@iosevka/geometry/spiro-control";
|
} from "@iosevka/geometry/spiro-control";
|
||||||
import { bez3, fallback, mix } from "@iosevka/util";
|
import { bez3, fallback, mix } from "@iosevka/util";
|
||||||
|
|
||||||
|
@ -47,8 +47,8 @@ class SpiroOutlineImpl extends SpiroImplBase {
|
||||||
new SpiroGeometry(
|
new SpiroGeometry(
|
||||||
gizmo,
|
gizmo,
|
||||||
collector.closed,
|
collector.closed,
|
||||||
collector.controls.map(k => k.toMono())
|
collector.controls.map(k => k.toMono()),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ class DiSpiroProxy {
|
||||||
gizmo,
|
gizmo,
|
||||||
collector.contrast,
|
collector.contrast,
|
||||||
collector.closed,
|
collector.closed,
|
||||||
collector.controls
|
collector.controls,
|
||||||
);
|
);
|
||||||
this.m_origKnots = collector.controls;
|
this.m_origKnots = collector.controls;
|
||||||
}
|
}
|
||||||
|
@ -95,18 +95,18 @@ export function SetupBuilders(bindings) {
|
||||||
{ name: "up", x: 0, y: 1 },
|
{ name: "up", x: 0, y: 1 },
|
||||||
{ name: "down", x: 0, y: -1 },
|
{ name: "down", x: 0, y: -1 },
|
||||||
{ name: "left", x: -1, y: 0 },
|
{ name: "left", x: -1, y: 0 },
|
||||||
{ name: "right", x: 1, y: 0 }
|
{ name: "right", x: 1, y: 0 },
|
||||||
];
|
];
|
||||||
let adhesions = [
|
let adhesions = [
|
||||||
{ name: "start", l: 0, r: 0.01 },
|
{ name: "start", l: 0, r: 0.01 },
|
||||||
{ name: "mid", l: -0.005, r: 0.005 },
|
{ name: "mid", l: -0.005, r: 0.005 },
|
||||||
{ name: "end", l: -0.01, r: 0 }
|
{ name: "end", l: -0.01, r: 0 },
|
||||||
];
|
];
|
||||||
let knotTypes = [
|
let knotTypes = [
|
||||||
[g4, g4, g4],
|
[g4, g4, g4],
|
||||||
[g2, g2, g2],
|
[g2, g2, g2],
|
||||||
[corner, corner, corner],
|
[corner, corner, corner],
|
||||||
[straight, flat, curl]
|
[straight, flat, curl],
|
||||||
];
|
];
|
||||||
for (const [sink, kl, kr] of knotTypes) {
|
for (const [sink, kl, kr] of knotTypes) {
|
||||||
for (const d of directions) {
|
for (const d of directions) {
|
||||||
|
@ -114,7 +114,7 @@ export function SetupBuilders(bindings) {
|
||||||
for (const a of adhesions) {
|
for (const a of adhesions) {
|
||||||
sink[d.name][a.name] = (x, y, af) => [
|
sink[d.name][a.name] = (x, y, af) => [
|
||||||
kl(x + d.x * a.l, y + d.y * a.l, af),
|
kl(x + d.x * a.l, y + d.y * a.l, af),
|
||||||
kr(x + d.x * a.r, y + d.y * a.r, af)
|
kr(x + d.x * a.r, y + d.y * a.r, af),
|
||||||
];
|
];
|
||||||
sink[d.name][a.name].l = (x, y, af) => kl(x + d.x * a.l, y + d.y * a.l, af);
|
sink[d.name][a.name].l = (x, y, af) => kl(x + d.x * a.l, y + d.y * a.l, af);
|
||||||
sink[d.name][a.name].r = (x, y, af) => kr(x + d.x * a.r, y + d.y * a.r, af);
|
sink[d.name][a.name].r = (x, y, af) => kr(x + d.x * a.r, y + d.y * a.r, af);
|
||||||
|
@ -210,21 +210,21 @@ export function SetupBuilders(bindings) {
|
||||||
return g4(
|
return g4(
|
||||||
mix(before.x, after.x, args.rx),
|
mix(before.x, after.x, args.rx),
|
||||||
mix(before.y, after.y, args.ry),
|
mix(before.y, after.y, args.ry),
|
||||||
fallback(args.raf, unimportant)
|
fallback(args.raf, unimportant),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
function afInterpolateDelta(before, after, args) {
|
function afInterpolateDelta(before, after, args) {
|
||||||
return g4(
|
return g4(
|
||||||
mix(before.x, after.x, args.rx) + args.deltaX,
|
mix(before.x, after.x, args.rx) + args.deltaX,
|
||||||
mix(before.y, after.y, args.ry) + args.deltaY,
|
mix(before.y, after.y, args.ry) + args.deltaY,
|
||||||
fallback(args.raf, unimportant)
|
fallback(args.raf, unimportant),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
function afInterpolateG2(before, after, args) {
|
function afInterpolateG2(before, after, args) {
|
||||||
return g2(
|
return g2(
|
||||||
mix(before.x, after.x, args.rx),
|
mix(before.x, after.x, args.rx),
|
||||||
mix(before.y, after.y, args.ry),
|
mix(before.y, after.y, args.ry),
|
||||||
fallback(args.raf, unimportant)
|
fallback(args.raf, unimportant),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
function afInterpolateThem(before, after, args) {
|
function afInterpolateThem(before, after, args) {
|
||||||
|
@ -238,8 +238,8 @@ export function SetupBuilders(bindings) {
|
||||||
? args.raf.blend(rt)
|
? args.raf.blend(rt)
|
||||||
: args.raf
|
: args.raf
|
||||||
? args.raf
|
? args.raf
|
||||||
: unimportant
|
: unimportant,
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return innerKnots;
|
return innerKnots;
|
||||||
|
@ -255,8 +255,8 @@ export function SetupBuilders(bindings) {
|
||||||
? args.raf.blend(rt)
|
? args.raf.blend(rt)
|
||||||
: args.raf
|
: args.raf
|
||||||
? args.raf
|
? args.raf
|
||||||
: unimportant
|
: unimportant,
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return innerKnots;
|
return innerKnots;
|
||||||
|
@ -268,8 +268,8 @@ export function SetupBuilders(bindings) {
|
||||||
fallback(args.ty, g2)(
|
fallback(args.ty, g2)(
|
||||||
mix(before.x, after.x, args.raf.rx(rt)) + args.raf.deltaX(rt),
|
mix(before.x, after.x, args.raf.rx(rt)) + args.raf.deltaX(rt),
|
||||||
mix(before.y, after.y, args.raf.ry(rt)) + args.raf.deltaY(rt),
|
mix(before.y, after.y, args.raf.ry(rt)) + args.raf.deltaY(rt),
|
||||||
args.raf.modifier(rt)
|
args.raf.modifier(rt),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return innerKnots;
|
return innerKnots;
|
||||||
|
@ -300,7 +300,7 @@ export function SetupBuilders(bindings) {
|
||||||
rs.push([
|
rs.push([
|
||||||
bez3(0, x1, x2, 1, j / samples),
|
bez3(0, x1, x2, 1, j / samples),
|
||||||
bez3(0, y1, y2, 1, j / samples),
|
bez3(0, y1, y2, 1, j / samples),
|
||||||
j / samples
|
j / samples,
|
||||||
]);
|
]);
|
||||||
return alsoThruThem(rs, raf);
|
return alsoThruThem(rs, raf);
|
||||||
}
|
}
|
||||||
|
@ -314,7 +314,7 @@ export function SetupBuilders(bindings) {
|
||||||
mix(1, x1, 2 / 3),
|
mix(1, x1, 2 / 3),
|
||||||
mix(1, y1, 2 / 3),
|
mix(1, y1, 2 / 3),
|
||||||
fallback(_samples, 3),
|
fallback(_samples, 3),
|
||||||
raf
|
raf,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,6 +432,6 @@ export function SetupBuilders(bindings) {
|
||||||
arcvh,
|
arcvh,
|
||||||
dispiro,
|
dispiro,
|
||||||
"spiro-outline": spiroOutline,
|
"spiro-outline": spiroOutline,
|
||||||
CursiveBuilder
|
CursiveBuilder,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,7 @@ export : define [createGsubLookupFromGr gsub glyphStore gr] : begin
|
||||||
foreach { gnSrc glyph } [glyphStore.namedEntries] : begin
|
foreach { gnSrc glyph } [glyphStore.namedEntries] : begin
|
||||||
local gnDst : gr.get glyph
|
local gnDst : gr.get glyph
|
||||||
local glyphDst : glyphStore.queryByName gnDst
|
local glyphDst : glyphStore.queryByName gnDst
|
||||||
if (glyphDst && ([glyphStore.queryUnicodeOf glyph] || [glyphStore.queryUnicodeOf glyphDst]))
|
if glyphDst : set mapping.(gnSrc) gnDst
|
||||||
set mapping.(gnSrc) gnDst
|
|
||||||
|
|
||||||
return : gsub.createLookup {.type 'gsub_single' .substitutions mapping}
|
return : gsub.createLookup {.type 'gsub_single' .substitutions mapping}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ async function main(argv) {
|
||||||
case "fontconfig-mono":
|
case "fontconfig-mono":
|
||||||
case "fixed":
|
case "fixed":
|
||||||
CliProc.gcFont(font, Ot.ListGlyphStoreFactory);
|
CliProc.gcFont(font, Ot.ListGlyphStoreFactory);
|
||||||
|
validateFontConfigMono(font);
|
||||||
await saveTTF(argv.o, font);
|
await saveTTF(argv.o, font);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -68,18 +69,24 @@ async function deriveTerm(font) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// In FontConfig, a font is considered "monospace" if and only if all encoded non-combining
|
// Drop the following "long" characters.
|
||||||
// characters (AW > 0) have the same width. We use this method to validate whether our
|
|
||||||
// "Fixed" subfamilies are properly built.
|
|
||||||
async function deriveFixed_DropWideChars(font) {
|
async function deriveFixed_DropWideChars(font) {
|
||||||
const unitWidth = font.os2.xAvgCharWidth;
|
const longCharCodes = [
|
||||||
for (const [ch, g] of [...font.cmap.unicode.entries()]) {
|
0x27f5, // LONG LEFTWARDS ARROW
|
||||||
const advanceWidth = g.horizontal.end - g.horizontal.start;
|
0x27f6, // LONG RIGHTWARDS ARROW
|
||||||
if (!(advanceWidth === 0 || advanceWidth === unitWidth)) font.cmap.unicode.delete(ch);
|
0x27f7, // LONG LEFT RIGHT ARROW
|
||||||
}
|
0x27f8, // LONG LEFTWARDS DOUBLE ARROW
|
||||||
for (const [ch, vs, g] of [...font.cmap.vs.entries()]) {
|
0x27f9, // LONG RIGHTWARDS DOUBLE ARROW
|
||||||
const advanceWidth = g.horizontal.end - g.horizontal.start;
|
0x27fa, // LONG LEFT RIGHT DOUBLE ARROW
|
||||||
if (!(advanceWidth === 0 || advanceWidth === unitWidth)) font.cmap.vs.delete(ch, vs);
|
0x27fb, // LONG LEFTWARDS ARROW FROM BAR
|
||||||
|
0x27fc, // LONG RIGHTWARDS ARROW FROM BAR
|
||||||
|
0x27fd, // LONG LEFTWARDS DOUBLE ARROW FROM BAR
|
||||||
|
0x27fe, // LONG RIGHTWARDS DOUBLE ARROW FROM BAR
|
||||||
|
0x27ff, // LONG RIGHTWARDS SQUIGGLE ARROW
|
||||||
|
0x2b33, // LONG LEFTWARDS SQUIGGLE ARROW
|
||||||
|
];
|
||||||
|
for (const ch of longCharCodes) {
|
||||||
|
font.cmap.unicode.delete(ch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,3 +112,21 @@ async function deriveFixed_DropFeatures(font, argv, fFixed) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In FontConfig, a font is considered "monospace" if and only if all encoded non-combining
|
||||||
|
// characters (AW > 0) have the same width. We use this method to validate whether our
|
||||||
|
// "Fixed" subfamilies are properly built.
|
||||||
|
function validateFontConfigMono(font) {
|
||||||
|
let awSet = new Set();
|
||||||
|
for (const [ch, g] of [...font.cmap.unicode.entries()]) {
|
||||||
|
const aw = g.horizontal.end - g.horizontal.start;
|
||||||
|
if (aw > 0) awSet.add(aw);
|
||||||
|
}
|
||||||
|
for (const [ch, vs, g] of [...font.cmap.vs.entries()]) {
|
||||||
|
const aw = g.horizontal.end - g.horizontal.start;
|
||||||
|
if (aw > 0) awSet.add(aw);
|
||||||
|
}
|
||||||
|
if (awSet.size > 1) {
|
||||||
|
console.error("Fixed variant has wide characters");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ function sweepFeatures(table, accessibleLookupsIds) {
|
||||||
const featureFiltered = {
|
const featureFiltered = {
|
||||||
name: feature.name,
|
name: feature.name,
|
||||||
tag: feature.tag,
|
tag: feature.tag,
|
||||||
lookups: []
|
lookups: [],
|
||||||
};
|
};
|
||||||
for (const l of feature.lookups) {
|
for (const l of feature.lookups) {
|
||||||
if (accessibleLookupsIds.has(l)) featureFiltered.lookups.push(l);
|
if (accessibleLookupsIds.has(l)) featureFiltered.lookups.push(l);
|
||||||
|
@ -282,7 +282,7 @@ function collectAliasMap(aliasMap) {
|
||||||
if (!m) {
|
if (!m) {
|
||||||
m = {
|
m = {
|
||||||
representative: null,
|
representative: null,
|
||||||
aliases: new Map()
|
aliases: new Map(),
|
||||||
};
|
};
|
||||||
aliasResolution.set(terminal.glyph, m);
|
aliasResolution.set(terminal.glyph, m);
|
||||||
}
|
}
|
||||||
|
@ -319,7 +319,7 @@ function alterGeometryAndOptimize(collection) {
|
||||||
|
|
||||||
cluster.representative.glyph.geometry = new Geometry.TransformedGeometry(
|
cluster.representative.glyph.geometry = new Geometry.TransformedGeometry(
|
||||||
gT.geometry,
|
gT.geometry,
|
||||||
Transform.Translate(cluster.representative.x, cluster.representative.y)
|
Transform.Translate(cluster.representative.x, cluster.representative.y),
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const [g, tf] of cluster.aliases) {
|
for (const [g, tf] of cluster.aliases) {
|
||||||
|
@ -327,12 +327,12 @@ function alterGeometryAndOptimize(collection) {
|
||||||
g.geometry = new Geometry.ReferenceGeometry(
|
g.geometry = new Geometry.ReferenceGeometry(
|
||||||
cluster.representative.glyph,
|
cluster.representative.glyph,
|
||||||
tf.x - cluster.representative.x,
|
tf.x - cluster.representative.x,
|
||||||
tf.y - cluster.representative.y
|
tf.y - cluster.representative.y,
|
||||||
);
|
);
|
||||||
optimized.set(g, {
|
optimized.set(g, {
|
||||||
glyph: cluster.representative.glyph,
|
glyph: cluster.representative.glyph,
|
||||||
x: tf.x - cluster.representative.x,
|
x: tf.x - cluster.representative.x,
|
||||||
y: tf.y - cluster.representative.y
|
y: tf.y - cluster.representative.y,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -385,7 +385,7 @@ function rectifyGlyphAndMarkComponents(glyphStore, aliasMap, markedGlyphs, memo,
|
||||||
markedGlyphs,
|
markedGlyphs,
|
||||||
memo,
|
memo,
|
||||||
sr.glyph,
|
sr.glyph,
|
||||||
d + 0x10000
|
d + 0x10000,
|
||||||
);
|
);
|
||||||
parts.push(new Geometry.ReferenceGeometry(sr.glyph, sr.x, sr.y));
|
parts.push(new Geometry.ReferenceGeometry(sr.glyph, sr.x, sr.y));
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ function flattenSimpleGlyph(cache, skew, g) {
|
||||||
const tfForward = g.gizmo ? g.gizmo : new Transform(1, +skew, 0, 1, 0, 0);
|
const tfForward = g.gizmo ? g.gizmo : new Transform(1, +skew, 0, 1, 0, 0);
|
||||||
gSimplified = new Geom.TransformedGeometry(
|
gSimplified = new Geom.TransformedGeometry(
|
||||||
new Geom.SimplifyGeometry(new Geom.TransformedGeometry(g.geometry, tfBack)),
|
new Geom.SimplifyGeometry(new Geom.TransformedGeometry(g.geometry, tfBack)),
|
||||||
tfForward
|
tfForward,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
gSimplified = new Geom.SimplifyGeometry(g.geometry);
|
gSimplified = new Geom.SimplifyGeometry(g.geometry);
|
||||||
|
|
|
@ -9,7 +9,7 @@ export function CreateEmptyFont(argv) {
|
||||||
os2: new Ot.Os2.Table(4),
|
os2: new Ot.Os2.Table(4),
|
||||||
post: new Ot.Post.Table(argv.featureControl.exportGlyphNames ? 2 : 3, 0),
|
post: new Ot.Post.Table(argv.featureControl.exportGlyphNames ? 2 : 3, 0),
|
||||||
maxp: Ot.Maxp.Table.TrueType(),
|
maxp: Ot.Maxp.Table.TrueType(),
|
||||||
name: new Ot.Name.Table()
|
name: new Ot.Name.Table(),
|
||||||
};
|
};
|
||||||
if (process.env.SOURCE_DATE_EPOCH) {
|
if (process.env.SOURCE_DATE_EPOCH) {
|
||||||
font.head.created = new Date(process.env.SOURCE_DATE_EPOCH * 1000);
|
font.head.created = new Date(process.env.SOURCE_DATE_EPOCH * 1000);
|
||||||
|
@ -34,7 +34,7 @@ export function parseTTF(buf) {
|
||||||
export function buildTTF(font) {
|
export function buildTTF(font) {
|
||||||
const sfnt = FontIo.writeFont(font, {
|
const sfnt = FontIo.writeFont(font, {
|
||||||
glyphStore: { statOs2XAvgCharWidth: false },
|
glyphStore: { statOs2XAvgCharWidth: false },
|
||||||
generateDummyDigitalSignature: true
|
generateDummyDigitalSignature: true,
|
||||||
});
|
});
|
||||||
const buf = FontIo.writeSfntOtf(sfnt);
|
const buf = FontIo.writeSfntOtf(sfnt);
|
||||||
return buf;
|
return buf;
|
||||||
|
|
|
@ -2,477 +2,144 @@
|
||||||
// Machine generated. Do not modify。
|
// Machine generated. Do not modify。
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
"scriptTag": "latn",
|
scriptTag: "latn",
|
||||||
"featureTag": "dflt",
|
featureTag: "dflt",
|
||||||
"ranges": [
|
ranges: [
|
||||||
[
|
[0, 169],
|
||||||
0,
|
[171, 177],
|
||||||
169
|
[180, 184],
|
||||||
],
|
[187, 442],
|
||||||
[
|
[444, 447],
|
||||||
171,
|
[452, 452],
|
||||||
177
|
[454, 455],
|
||||||
],
|
[457, 458],
|
||||||
[
|
[460, 497],
|
||||||
180,
|
[499, 659],
|
||||||
184
|
[661, 687],
|
||||||
],
|
[7424, 7461],
|
||||||
[
|
[7531, 7543],
|
||||||
187,
|
[7545, 7578],
|
||||||
442
|
[7680, 7935],
|
||||||
],
|
[8192, 8303],
|
||||||
[
|
[8352, 8399],
|
||||||
444,
|
[8450, 8479],
|
||||||
447
|
[8483, 8506],
|
||||||
],
|
[8508, 8524],
|
||||||
[
|
[8526, 8527],
|
||||||
452,
|
[8579, 8580],
|
||||||
452
|
[11360, 11387],
|
||||||
],
|
[11390, 11391],
|
||||||
[
|
[11776, 11903],
|
||||||
454,
|
[42786, 42863],
|
||||||
455
|
[42865, 42887],
|
||||||
],
|
[42891, 42894],
|
||||||
[
|
[42896, 42954],
|
||||||
457,
|
[42960, 42961],
|
||||||
458
|
[42963, 42963],
|
||||||
],
|
[42965, 42969],
|
||||||
[
|
[42997, 42998],
|
||||||
460,
|
[43002, 43002],
|
||||||
497
|
[43824, 43866],
|
||||||
],
|
[43872, 43876],
|
||||||
[
|
[43878, 43880],
|
||||||
499,
|
[64256, 64262],
|
||||||
659
|
[122624, 122633],
|
||||||
],
|
[122635, 122654],
|
||||||
[
|
[122661, 122666],
|
||||||
661,
|
],
|
||||||
687
|
|
||||||
],
|
|
||||||
[
|
|
||||||
7424,
|
|
||||||
7461
|
|
||||||
],
|
|
||||||
[
|
|
||||||
7531,
|
|
||||||
7543
|
|
||||||
],
|
|
||||||
[
|
|
||||||
7545,
|
|
||||||
7578
|
|
||||||
],
|
|
||||||
[
|
|
||||||
7680,
|
|
||||||
7935
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8192,
|
|
||||||
8303
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8352,
|
|
||||||
8399
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8450,
|
|
||||||
8479
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8483,
|
|
||||||
8506
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8508,
|
|
||||||
8524
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8526,
|
|
||||||
8527
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8579,
|
|
||||||
8580
|
|
||||||
],
|
|
||||||
[
|
|
||||||
11360,
|
|
||||||
11387
|
|
||||||
],
|
|
||||||
[
|
|
||||||
11390,
|
|
||||||
11391
|
|
||||||
],
|
|
||||||
[
|
|
||||||
11776,
|
|
||||||
11903
|
|
||||||
],
|
|
||||||
[
|
|
||||||
42786,
|
|
||||||
42863
|
|
||||||
],
|
|
||||||
[
|
|
||||||
42865,
|
|
||||||
42887
|
|
||||||
],
|
|
||||||
[
|
|
||||||
42891,
|
|
||||||
42894
|
|
||||||
],
|
|
||||||
[
|
|
||||||
42896,
|
|
||||||
42954
|
|
||||||
],
|
|
||||||
[
|
|
||||||
42960,
|
|
||||||
42961
|
|
||||||
],
|
|
||||||
[
|
|
||||||
42963,
|
|
||||||
42963
|
|
||||||
],
|
|
||||||
[
|
|
||||||
42965,
|
|
||||||
42969
|
|
||||||
],
|
|
||||||
[
|
|
||||||
42997,
|
|
||||||
42998
|
|
||||||
],
|
|
||||||
[
|
|
||||||
43002,
|
|
||||||
43002
|
|
||||||
],
|
|
||||||
[
|
|
||||||
43824,
|
|
||||||
43866
|
|
||||||
],
|
|
||||||
[
|
|
||||||
43872,
|
|
||||||
43876
|
|
||||||
],
|
|
||||||
[
|
|
||||||
43878,
|
|
||||||
43880
|
|
||||||
],
|
|
||||||
[
|
|
||||||
64256,
|
|
||||||
64262
|
|
||||||
],
|
|
||||||
[
|
|
||||||
122624,
|
|
||||||
122633
|
|
||||||
],
|
|
||||||
[
|
|
||||||
122635,
|
|
||||||
122654
|
|
||||||
],
|
|
||||||
[
|
|
||||||
122661,
|
|
||||||
122666
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"scriptTag": "latp",
|
scriptTag: "latp",
|
||||||
"featureTag": "dflt",
|
featureTag: "dflt",
|
||||||
"ranges": [
|
ranges: [
|
||||||
[
|
[170, 170],
|
||||||
170,
|
[178, 179],
|
||||||
170
|
[185, 186],
|
||||||
],
|
[688, 696],
|
||||||
[
|
[736, 740],
|
||||||
178,
|
[890, 890],
|
||||||
179
|
[7468, 7521],
|
||||||
],
|
[7544, 7544],
|
||||||
[
|
[7579, 7615],
|
||||||
185,
|
[8304, 8305],
|
||||||
186
|
[8308, 8319],
|
||||||
],
|
[11389, 11389],
|
||||||
[
|
[42623, 42623],
|
||||||
688,
|
[42652, 42653],
|
||||||
696
|
[42864, 42864],
|
||||||
],
|
[42994, 42996],
|
||||||
[
|
[43000, 43001],
|
||||||
736,
|
[43868, 43871],
|
||||||
740
|
[43881, 43881],
|
||||||
],
|
[67456, 67461],
|
||||||
[
|
[67463, 67504],
|
||||||
890,
|
[67506, 67514],
|
||||||
890
|
[122928, 122960],
|
||||||
],
|
[122987, 122989],
|
||||||
[
|
],
|
||||||
7468,
|
|
||||||
7521
|
|
||||||
],
|
|
||||||
[
|
|
||||||
7544,
|
|
||||||
7544
|
|
||||||
],
|
|
||||||
[
|
|
||||||
7579,
|
|
||||||
7615
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8304,
|
|
||||||
8305
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8308,
|
|
||||||
8319
|
|
||||||
],
|
|
||||||
[
|
|
||||||
11389,
|
|
||||||
11389
|
|
||||||
],
|
|
||||||
[
|
|
||||||
42623,
|
|
||||||
42623
|
|
||||||
],
|
|
||||||
[
|
|
||||||
42652,
|
|
||||||
42653
|
|
||||||
],
|
|
||||||
[
|
|
||||||
42864,
|
|
||||||
42864
|
|
||||||
],
|
|
||||||
[
|
|
||||||
42994,
|
|
||||||
42996
|
|
||||||
],
|
|
||||||
[
|
|
||||||
43000,
|
|
||||||
43001
|
|
||||||
],
|
|
||||||
[
|
|
||||||
43868,
|
|
||||||
43871
|
|
||||||
],
|
|
||||||
[
|
|
||||||
43881,
|
|
||||||
43881
|
|
||||||
],
|
|
||||||
[
|
|
||||||
67456,
|
|
||||||
67461
|
|
||||||
],
|
|
||||||
[
|
|
||||||
67463,
|
|
||||||
67504
|
|
||||||
],
|
|
||||||
[
|
|
||||||
67506,
|
|
||||||
67514
|
|
||||||
],
|
|
||||||
[
|
|
||||||
122928,
|
|
||||||
122960
|
|
||||||
],
|
|
||||||
[
|
|
||||||
122987,
|
|
||||||
122989
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"scriptTag": "grek",
|
scriptTag: "grek",
|
||||||
"featureTag": "dflt",
|
featureTag: "dflt",
|
||||||
"ranges": [
|
ranges: [
|
||||||
[
|
[880, 883],
|
||||||
880,
|
[886, 887],
|
||||||
883
|
[891, 893],
|
||||||
],
|
[895, 895],
|
||||||
[
|
[902, 902],
|
||||||
886,
|
[904, 906],
|
||||||
887
|
[908, 908],
|
||||||
],
|
[910, 929],
|
||||||
[
|
[931, 993],
|
||||||
891,
|
[1008, 1013],
|
||||||
893
|
[1015, 1023],
|
||||||
],
|
[7462, 7466],
|
||||||
[
|
[7936, 7957],
|
||||||
895,
|
[7960, 7965],
|
||||||
895
|
[7968, 8005],
|
||||||
],
|
[8008, 8013],
|
||||||
[
|
[8016, 8023],
|
||||||
902,
|
[8025, 8025],
|
||||||
902
|
[8027, 8027],
|
||||||
],
|
[8029, 8029],
|
||||||
[
|
[8031, 8061],
|
||||||
904,
|
[8064, 8071],
|
||||||
906
|
[8080, 8087],
|
||||||
],
|
[8096, 8103],
|
||||||
[
|
[8112, 8116],
|
||||||
908,
|
[8118, 8123],
|
||||||
908
|
[8126, 8126],
|
||||||
],
|
[8130, 8132],
|
||||||
[
|
[8134, 8139],
|
||||||
910,
|
[8144, 8147],
|
||||||
929
|
[8150, 8155],
|
||||||
],
|
[8160, 8172],
|
||||||
[
|
[8178, 8180],
|
||||||
931,
|
[8182, 8187],
|
||||||
993
|
[43877, 43877],
|
||||||
],
|
],
|
||||||
[
|
|
||||||
1008,
|
|
||||||
1013
|
|
||||||
],
|
|
||||||
[
|
|
||||||
1015,
|
|
||||||
1023
|
|
||||||
],
|
|
||||||
[
|
|
||||||
7462,
|
|
||||||
7466
|
|
||||||
],
|
|
||||||
[
|
|
||||||
7936,
|
|
||||||
7957
|
|
||||||
],
|
|
||||||
[
|
|
||||||
7960,
|
|
||||||
7965
|
|
||||||
],
|
|
||||||
[
|
|
||||||
7968,
|
|
||||||
8005
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8008,
|
|
||||||
8013
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8016,
|
|
||||||
8023
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8025,
|
|
||||||
8025
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8027,
|
|
||||||
8027
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8029,
|
|
||||||
8029
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8031,
|
|
||||||
8061
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8064,
|
|
||||||
8071
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8080,
|
|
||||||
8087
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8096,
|
|
||||||
8103
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8112,
|
|
||||||
8116
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8118,
|
|
||||||
8123
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8126,
|
|
||||||
8126
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8130,
|
|
||||||
8132
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8134,
|
|
||||||
8139
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8144,
|
|
||||||
8147
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8150,
|
|
||||||
8155
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8160,
|
|
||||||
8172
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8178,
|
|
||||||
8180
|
|
||||||
],
|
|
||||||
[
|
|
||||||
8182,
|
|
||||||
8187
|
|
||||||
],
|
|
||||||
[
|
|
||||||
43877,
|
|
||||||
43877
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"scriptTag": "cyrl",
|
scriptTag: "cyrl",
|
||||||
"featureTag": "dflt",
|
featureTag: "dflt",
|
||||||
"ranges": [
|
ranges: [
|
||||||
[
|
[1024, 1153],
|
||||||
1024,
|
[1162, 1327],
|
||||||
1153
|
[7296, 7304],
|
||||||
],
|
[7467, 7467],
|
||||||
[
|
[42560, 42605],
|
||||||
1162,
|
[42624, 42651],
|
||||||
1327
|
],
|
||||||
],
|
|
||||||
[
|
|
||||||
7296,
|
|
||||||
7304
|
|
||||||
],
|
|
||||||
[
|
|
||||||
7467,
|
|
||||||
7467
|
|
||||||
],
|
|
||||||
[
|
|
||||||
42560,
|
|
||||||
42605
|
|
||||||
],
|
|
||||||
[
|
|
||||||
42624,
|
|
||||||
42651
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"scriptTag": "latb",
|
scriptTag: "latb",
|
||||||
"featureTag": "dflt",
|
featureTag: "dflt",
|
||||||
"ranges": [
|
ranges: [
|
||||||
[
|
[7522, 7530],
|
||||||
7522,
|
[8320, 8334],
|
||||||
7530
|
[8336, 8348],
|
||||||
],
|
[11388, 11388],
|
||||||
[
|
[122961, 122986],
|
||||||
8320,
|
],
|
||||||
8334
|
},
|
||||||
],
|
|
||||||
[
|
|
||||||
8336,
|
|
||||||
8348
|
|
||||||
],
|
|
||||||
[
|
|
||||||
11388,
|
|
||||||
11388
|
|
||||||
],
|
|
||||||
[
|
|
||||||
122961,
|
|
||||||
122986
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -46,8 +46,8 @@ export async function buildCompatLigatures(para, font) {
|
||||||
ligature.geometry.items.push(
|
ligature.geometry.items.push(
|
||||||
new Ot.Glyph.TtReference(
|
new Ot.Glyph.TtReference(
|
||||||
glyphList.at(component.g),
|
glyphList.at(component.g),
|
||||||
Ot.Glyph.Transform2X3.Translate(x, y)
|
Ot.Glyph.Transform2X3.Translate(x, y),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
xCursor += component.ax;
|
xCursor += component.ax;
|
||||||
|
|
|
@ -50,7 +50,7 @@ async function getParameters(argv) {
|
||||||
await tryParseToml(WEIGHTS_TOML),
|
await tryParseToml(WEIGHTS_TOML),
|
||||||
await tryParseToml(WIDTHS_TOML),
|
await tryParseToml(WIDTHS_TOML),
|
||||||
await tryParseToml(SLOPES_TOML),
|
await tryParseToml(SLOPES_TOML),
|
||||||
fs.existsSync(PRIVATE_TOML) ? await tryParseToml(PRIVATE_TOML) : {}
|
fs.existsSync(PRIVATE_TOML) ? await tryParseToml(PRIVATE_TOML) : {},
|
||||||
);
|
);
|
||||||
const rawVariantsData = await tryParseToml(VARIANTS_TOML);
|
const rawVariantsData = await tryParseToml(VARIANTS_TOML);
|
||||||
const rawLigationData = await tryParseToml(LIGATIONS_TOML);
|
const rawLigationData = await tryParseToml(LIGATIONS_TOML);
|
||||||
|
@ -63,7 +63,7 @@ async function getParameters(argv) {
|
||||||
if (argv.metricOverride) applyMetricOverride(para, argv.metricOverride, argv);
|
if (argv.metricOverride) applyMetricOverride(para, argv.metricOverride, argv);
|
||||||
para.naming = {
|
para.naming = {
|
||||||
miscNames: para.naming,
|
miscNames: para.naming,
|
||||||
...createNamingDictFromArgv(argv)
|
...createNamingDictFromArgv(argv),
|
||||||
};
|
};
|
||||||
return para;
|
return para;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ async function tryParseToml(str) {
|
||||||
return Toml.parse(await fs.promises.readFile(str, "utf-8"));
|
return Toml.parse(await fs.promises.readFile(str, "utf-8"));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Failed to parse configuration file ${str}.\nPlease validate whether there's syntax error.\n${e}`
|
`Failed to parse configuration file ${str}.\nPlease validate whether there's syntax error.\n${e}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ async function saveCharMap(argv, glyphStore) {
|
||||||
charMap.push([
|
charMap.push([
|
||||||
gn,
|
gn,
|
||||||
Array.from(glyphStore.queryUnicodeOfName(gn) || []),
|
Array.from(glyphStore.queryUnicodeOfName(gn) || []),
|
||||||
...createGrDisplaySheet(glyphStore, gn)
|
...createGrDisplaySheet(glyphStore, gn),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
await fs.promises.writeFile(argv.oCharMap, zlib.gzipSync(encode(charMap)));
|
await fs.promises.writeFile(argv.oCharMap, zlib.gzipSync(encode(charMap)));
|
||||||
|
|
|
@ -7,7 +7,7 @@ export function createNamingDictFromArgv(argv) {
|
||||||
version: argv.menu.version,
|
version: argv.menu.version,
|
||||||
weight: argv.menu.weight - 0,
|
weight: argv.menu.weight - 0,
|
||||||
width: argv.menu.width - 0,
|
width: argv.menu.width - 0,
|
||||||
slope: argv.menu.slope
|
slope: argv.menu.slope,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ export function assignFontNames(font, naming, isQuasiProportional) {
|
||||||
[Ot.Head.Flags.LeftSidebearingAtX0, true],
|
[Ot.Head.Flags.LeftSidebearingAtX0, true],
|
||||||
[Ot.Head.Flags.InstructionsMayDependOnPointSize, true],
|
[Ot.Head.Flags.InstructionsMayDependOnPointSize, true],
|
||||||
[Ot.Head.Flags.ForcePpemToBeInteger, true],
|
[Ot.Head.Flags.ForcePpemToBeInteger, true],
|
||||||
[Ot.Head.Flags.InstructionMayAlterAdvanceWidth, true]
|
[Ot.Head.Flags.InstructionMayAlterAdvanceWidth, true],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ function getStyleLinkedStyles(weight, width, slope) {
|
||||||
return {
|
return {
|
||||||
style: getStyle(linkWeight, 5, linkSlope),
|
style: getStyle(linkWeight, 5, linkSlope),
|
||||||
familySuffix: getStyle(nameSuffixWeight, nameSuffixWidth, nameSuffixSlope),
|
familySuffix: getStyle(nameSuffixWeight, nameSuffixWidth, nameSuffixSlope),
|
||||||
familySuffixShort: getShortStyle(nameSuffixWeight, nameSuffixWidth, nameSuffixSlope)
|
familySuffixShort: getShortStyle(nameSuffixWeight, nameSuffixWidth, nameSuffixSlope),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ const weightToMenuStyleMap = {
|
||||||
600: "Semibold",
|
600: "Semibold",
|
||||||
700: "Bold",
|
700: "Bold",
|
||||||
800: "Extrabold",
|
800: "Extrabold",
|
||||||
900: "Heavy"
|
900: "Heavy",
|
||||||
};
|
};
|
||||||
const widthToMenuStyleMap = {
|
const widthToMenuStyleMap = {
|
||||||
1: "Ultra-Condensed",
|
1: "Ultra-Condensed",
|
||||||
|
@ -196,12 +196,12 @@ const widthToMenuStyleMap = {
|
||||||
6: "Semi-Extended",
|
6: "Semi-Extended",
|
||||||
7: "Extended",
|
7: "Extended",
|
||||||
8: "Extra-Extended",
|
8: "Extra-Extended",
|
||||||
9: "Ultra-Extended"
|
9: "Ultra-Extended",
|
||||||
};
|
};
|
||||||
const slopeToMenuStyleMap = {
|
const slopeToMenuStyleMap = {
|
||||||
normal: "",
|
normal: "",
|
||||||
italic: "Italic",
|
italic: "Italic",
|
||||||
oblique: "Oblique"
|
oblique: "Oblique",
|
||||||
};
|
};
|
||||||
const weightToMenuStyleMapShort = {
|
const weightToMenuStyleMapShort = {
|
||||||
100: "Th",
|
100: "Th",
|
||||||
|
@ -214,7 +214,7 @@ const weightToMenuStyleMapShort = {
|
||||||
600: "SmBd",
|
600: "SmBd",
|
||||||
700: "Bd",
|
700: "Bd",
|
||||||
800: "XBd",
|
800: "XBd",
|
||||||
900: "Hv"
|
900: "Hv",
|
||||||
};
|
};
|
||||||
const widthToMenuStyleMapShort = {
|
const widthToMenuStyleMapShort = {
|
||||||
1: "UltCn",
|
1: "UltCn",
|
||||||
|
@ -225,12 +225,12 @@ const widthToMenuStyleMapShort = {
|
||||||
6: "SmEx",
|
6: "SmEx",
|
||||||
7: "Ex",
|
7: "Ex",
|
||||||
8: "XEx",
|
8: "XEx",
|
||||||
9: "UltEx"
|
9: "UltEx",
|
||||||
};
|
};
|
||||||
const slopeToMenuStyleMapShort = {
|
const slopeToMenuStyleMapShort = {
|
||||||
normal: "",
|
normal: "",
|
||||||
italic: "It",
|
italic: "It",
|
||||||
oblique: "Obl"
|
oblique: "Obl",
|
||||||
};
|
};
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -257,7 +257,7 @@ const ApplePostNames = new Map([
|
||||||
[0x107, "cacute"],
|
[0x107, "cacute"],
|
||||||
[0x10c, "Ccaron"],
|
[0x10c, "Ccaron"],
|
||||||
[0x10d, "ccaron"],
|
[0x10d, "ccaron"],
|
||||||
[0x111, "dcroat"]
|
[0x111, "dcroat"],
|
||||||
/* spell-checker: enable */
|
/* spell-checker: enable */
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ class MappedGlyphStore {
|
||||||
let rev = new Map();
|
let rev = new Map();
|
||||||
for (const [u, g] of this.m_primaryUnicodeMapping) rev.set(g, u);
|
for (const [u, g] of this.m_primaryUnicodeMapping) rev.set(g, u);
|
||||||
const glyphsInBuildOrder = Array.from(this.m_mapping).sort(
|
const glyphsInBuildOrder = Array.from(this.m_mapping).sort(
|
||||||
([a], [b]) => a.subRank - b.subRank
|
([a], [b]) => a.subRank - b.subRank,
|
||||||
);
|
);
|
||||||
for (const [gSrc, gOt] of glyphsInBuildOrder) gOt.name = undefined;
|
for (const [gSrc, gOt] of glyphsInBuildOrder) gOt.name = undefined;
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ class MappedGlyphStore {
|
||||||
gSrcBase,
|
gSrcBase,
|
||||||
gOtBase,
|
gOtBase,
|
||||||
this.m_nameMapping,
|
this.m_nameMapping,
|
||||||
conflictSet
|
conflictSet,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} while (nNewNames > 0);
|
} while (nNewNames > 0);
|
||||||
|
@ -114,7 +114,7 @@ class MappedGlyphStore {
|
||||||
gSrcBase,
|
gSrcBase,
|
||||||
gOtBase,
|
gOtBase,
|
||||||
this.m_nameMapping,
|
this.m_nameMapping,
|
||||||
conflictSet
|
conflictSet,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} while (nNewNames > 0);
|
} while (nNewNames > 0);
|
||||||
|
@ -162,8 +162,8 @@ class MappedGlyphStore {
|
||||||
z.y,
|
z.y,
|
||||||
z.type === Point.Type.Quadratic
|
z.type === Point.Type.Quadratic
|
||||||
? Ot.Glyph.PointType.Quad
|
? Ot.Glyph.PointType.Quad
|
||||||
: Ot.Glyph.PointType.Corner
|
: Ot.Glyph.PointType.Corner,
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
cs.contours.push(c1);
|
cs.contours.push(c1);
|
||||||
|
|
|
@ -89,7 +89,7 @@ class ScriptLanguageStore {
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
requiredFeature: this.featureStore.query(data.requiredFeature) || null,
|
requiredFeature: this.featureStore.query(data.requiredFeature) || null,
|
||||||
features: features
|
features: features,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ const GsubSingleHandler = {
|
||||||
const to = store.glyphs.queryByName(st[k]);
|
const to = store.glyphs.queryByName(st[k]);
|
||||||
if (from && to) dst.mapping.set(from, to);
|
if (from && to) dst.mapping.set(from, to);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
const GsubMultipleHandler = {
|
const GsubMultipleHandler = {
|
||||||
init() {
|
init() {
|
||||||
|
@ -176,13 +176,13 @@ const GsubMultipleHandler = {
|
||||||
if (!from || !to) continue;
|
if (!from || !to) continue;
|
||||||
dst.mapping.set(from, to);
|
dst.mapping.set(from, to);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
const GsubAlternateHandler = {
|
const GsubAlternateHandler = {
|
||||||
init() {
|
init() {
|
||||||
return new Ot.Gsub.Alternate();
|
return new Ot.Gsub.Alternate();
|
||||||
},
|
},
|
||||||
fill: GsubMultipleHandler.fill
|
fill: GsubMultipleHandler.fill,
|
||||||
};
|
};
|
||||||
const GsubLigatureHandler = {
|
const GsubLigatureHandler = {
|
||||||
init() {
|
init() {
|
||||||
|
@ -196,7 +196,7 @@ const GsubLigatureHandler = {
|
||||||
if (!from || !to) continue;
|
if (!from || !to) continue;
|
||||||
dst.mapping.push({ from, to });
|
dst.mapping.push({ from, to });
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
const GsubChainingHandler = {
|
const GsubChainingHandler = {
|
||||||
init() {
|
init() {
|
||||||
|
@ -221,7 +221,7 @@ const GsubChainingHandler = {
|
||||||
}
|
}
|
||||||
dst.rules.push({ match, inputBegins, inputEnds, applications });
|
dst.rules.push({ match, inputBegins, inputEnds, applications });
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
const GsubReverseHandler = {
|
const GsubReverseHandler = {
|
||||||
init() {
|
init() {
|
||||||
|
@ -257,7 +257,7 @@ const GsubReverseHandler = {
|
||||||
}
|
}
|
||||||
dst.rules.push({ match, doSubAt, replacement });
|
dst.rules.push({ match, doSubAt, replacement });
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function mapGlyphListAll(gl, store) {
|
function mapGlyphListAll(gl, store) {
|
||||||
|
@ -285,7 +285,7 @@ const GsubHandlers = {
|
||||||
gsub_alternate: GsubAlternateHandler,
|
gsub_alternate: GsubAlternateHandler,
|
||||||
gsub_ligature: GsubLigatureHandler,
|
gsub_ligature: GsubLigatureHandler,
|
||||||
gsub_chaining: GsubChainingHandler,
|
gsub_chaining: GsubChainingHandler,
|
||||||
gsub_reverse: GsubReverseHandler
|
gsub_reverse: GsubReverseHandler,
|
||||||
};
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -298,7 +298,7 @@ const GposMarkToBaseHandler = {
|
||||||
const mm = collectClassMap(src.marks);
|
const mm = collectClassMap(src.marks);
|
||||||
dst.marks = convertMarkRecords(src.marks, mm, store);
|
dst.marks = convertMarkRecords(src.marks, mm, store);
|
||||||
dst.bases = convertBaseRecords(src.bases, mm, store);
|
dst.bases = convertBaseRecords(src.bases, mm, store);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
const GposMarkToMarkHandler = {
|
const GposMarkToMarkHandler = {
|
||||||
init() {
|
init() {
|
||||||
|
@ -308,7 +308,7 @@ const GposMarkToMarkHandler = {
|
||||||
const mm = collectClassMap(src.marks);
|
const mm = collectClassMap(src.marks);
|
||||||
dst.marks = convertMarkRecords(src.marks, mm, store);
|
dst.marks = convertMarkRecords(src.marks, mm, store);
|
||||||
dst.baseMarks = convertBaseRecords(src.bases, mm, store);
|
dst.baseMarks = convertBaseRecords(src.bases, mm, store);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
function collectClassMap(marks) {
|
function collectClassMap(marks) {
|
||||||
let n = 0;
|
let n = 0;
|
||||||
|
@ -350,5 +350,5 @@ function convertBaseRecords(bases, mm, store) {
|
||||||
}
|
}
|
||||||
const GposHandlers = {
|
const GposHandlers = {
|
||||||
gpos_mark_to_base: GposMarkToBaseHandler,
|
gpos_mark_to_base: GposMarkToBaseHandler,
|
||||||
gpos_mark_to_mark: GposMarkToMarkHandler
|
gpos_mark_to_mark: GposMarkToMarkHandler,
|
||||||
};
|
};
|
||||||
|
|
|
@ -68,7 +68,7 @@ class Alignment {
|
||||||
Gr.Texture.ExtLR,
|
Gr.Texture.ExtLR,
|
||||||
Gr.Texture.ShrL,
|
Gr.Texture.ShrL,
|
||||||
Gr.Texture.ShrR,
|
Gr.Texture.ShrR,
|
||||||
Gr.Texture.ShrLR
|
Gr.Texture.ShrLR,
|
||||||
];
|
];
|
||||||
for (const gr of cvs) {
|
for (const gr of cvs) {
|
||||||
const gnLinked = gr.get(go);
|
const gnLinked = gr.get(go);
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Cache {
|
||||||
return {
|
return {
|
||||||
version: version + "@" + Edition,
|
version: version + "@" + Edition,
|
||||||
ageKeys: mergedAgeKeys,
|
ageKeys: mergedAgeKeys,
|
||||||
gf: gfRep
|
gf: gfRep,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
isEmpty() {
|
isEmpty() {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
import { mix } from "@iosevka/util";
|
||||||
import * as TypoGeom from "typo-geom";
|
import * as TypoGeom from "typo-geom";
|
||||||
|
|
||||||
import { Point, Vec2 } from "./point.mjs";
|
import { Point, Vec2 } from "./point.mjs";
|
||||||
import { Transform } from "./transform.mjs";
|
import { Transform } from "./transform.mjs";
|
||||||
import { mix } from "@iosevka/util";
|
|
||||||
|
|
||||||
function contourToRep(contour) {
|
function contourToRep(contour) {
|
||||||
let c = [];
|
let c = [];
|
||||||
|
@ -30,8 +30,8 @@ function convertContourToArcs(contour) {
|
||||||
z0,
|
z0,
|
||||||
Point.from(Point.Type.CubicStart, z1),
|
Point.from(Point.Type.CubicStart, z1),
|
||||||
Point.from(Point.Type.CubicEnd, z2),
|
Point.from(Point.Type.CubicEnd, z2),
|
||||||
Point.from(Point.Type.Corner, z3)
|
Point.from(Point.Type.Corner, z3),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
z0 = z3;
|
z0 = z3;
|
||||||
j += 2;
|
j += 2;
|
||||||
|
@ -47,8 +47,8 @@ function convertContourToArcs(contour) {
|
||||||
z0,
|
z0,
|
||||||
Point.from(Point.Type.CubicStart, z0).mix(2 / 3, zc),
|
Point.from(Point.Type.CubicStart, z0).mix(2 / 3, zc),
|
||||||
Point.from(Point.Type.CubicEnd, zf).mix(2 / 3, zc),
|
Point.from(Point.Type.CubicEnd, zf).mix(2 / 3, zc),
|
||||||
Point.from(Point.Type.Corner, zf)
|
Point.from(Point.Type.Corner, zf),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
z0 = zf;
|
z0 = zf;
|
||||||
if (zfIsCorner) j++;
|
if (zfIsCorner) j++;
|
||||||
|
@ -57,8 +57,8 @@ function convertContourToArcs(contour) {
|
||||||
default: {
|
default: {
|
||||||
newContour.push(
|
newContour.push(
|
||||||
TypoGeom.Arcs.Bez3.fromStraightSegment(
|
TypoGeom.Arcs.Bez3.fromStraightSegment(
|
||||||
new TypoGeom.Arcs.StraightSegment(z0, Point.from(Point.Type.Corner, z))
|
new TypoGeom.Arcs.StraightSegment(z0, Point.from(Point.Type.Corner, z)),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
z0 = z;
|
z0 = z;
|
||||||
break;
|
break;
|
||||||
|
@ -88,7 +88,7 @@ export function derivativeFromFiniteDifference(c, t) {
|
||||||
(2 / 3) * backward1.y +
|
(2 / 3) * backward1.y +
|
||||||
(2 / 3) * forward1.y -
|
(2 / 3) * forward1.y -
|
||||||
(1 / 12) * forward2.y) /
|
(1 / 12) * forward2.y) /
|
||||||
DELTA
|
DELTA,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ export class OffsetCurve {
|
||||||
const absD = Math.hypot(d.x, d.y);
|
const absD = Math.hypot(d.x, d.y);
|
||||||
return {
|
return {
|
||||||
x: c.x - (d.y / absD) * this.offset * this.contrast,
|
x: c.x - (d.y / absD) * this.offset * this.contrast,
|
||||||
y: c.y + (d.x / absD) * this.offset
|
y: c.y + (d.x / absD) * this.offset,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
derivative(t) {
|
derivative(t) {
|
||||||
|
@ -189,7 +189,7 @@ export class RoundCapCurve {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
x: centerX + r * Math.cos(theta) * this.contrast,
|
x: centerX + r * Math.cos(theta) * this.contrast,
|
||||||
y: centerY + r * Math.sin(theta)
|
y: centerY + r * Math.sin(theta),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ export class ContourSetGeometry extends GeometryBase {
|
||||||
toShapeStringOrNull() {
|
toShapeStringOrNull() {
|
||||||
return Format.struct(
|
return Format.struct(
|
||||||
`ContourSetGeometry`,
|
`ContourSetGeometry`,
|
||||||
Format.list(this.m_contours.map(c => Format.list(c.map(Format.typedPoint))))
|
Format.list(this.m_contours.map(c => Format.list(c.map(Format.typedPoint)))),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ export class SpiroGeometry extends GeometryBase {
|
||||||
"SpiroGeometry",
|
"SpiroGeometry",
|
||||||
Format.gizmo(this.m_gizmo),
|
Format.gizmo(this.m_gizmo),
|
||||||
this.m_closed,
|
this.m_closed,
|
||||||
Format.list(this.m_knots.map(k => k.toShapeString()))
|
Format.list(this.m_knots.map(k => k.toShapeString())),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ export class DiSpiroGeometry extends GeometryBase {
|
||||||
if (this.m_closed) {
|
if (this.m_closed) {
|
||||||
outlineGeometry = new CombineGeometry([
|
outlineGeometry = new CombineGeometry([
|
||||||
new SpiroGeometry(this.m_gizmo, true, lhs),
|
new SpiroGeometry(this.m_gizmo, true, lhs),
|
||||||
new SpiroGeometry(this.m_gizmo, true, rhs)
|
new SpiroGeometry(this.m_gizmo, true, rhs),
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
lhs[0].type = lhs[lhs.length - 1].type = "corner";
|
lhs[0].type = lhs[lhs.length - 1].type = "corner";
|
||||||
|
@ -155,7 +155,7 @@ export class DiSpiroGeometry extends GeometryBase {
|
||||||
this.m_gizmo,
|
this.m_gizmo,
|
||||||
this.m_contrast,
|
this.m_contrast,
|
||||||
this.m_closed,
|
this.m_closed,
|
||||||
this.m_biKnots
|
this.m_biKnots,
|
||||||
);
|
);
|
||||||
expander.initializeNormals();
|
expander.initializeNormals();
|
||||||
expander.iterateNormals();
|
expander.iterateNormals();
|
||||||
|
@ -187,7 +187,7 @@ export class DiSpiroGeometry extends GeometryBase {
|
||||||
Format.gizmo(this.m_gizmo),
|
Format.gizmo(this.m_gizmo),
|
||||||
Format.n(this.m_contrast),
|
Format.n(this.m_contrast),
|
||||||
this.m_closed,
|
this.m_closed,
|
||||||
Format.list(this.m_biKnots.map(z => z.toShapeString()))
|
Format.list(this.m_biKnots.map(z => z.toShapeString())),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ export class ReferenceGeometry extends GeometryBase {
|
||||||
unwrap() {
|
unwrap() {
|
||||||
return new TransformedGeometry(
|
return new TransformedGeometry(
|
||||||
this.m_glyph.geometry,
|
this.m_glyph.geometry,
|
||||||
Transform.Translate(this.m_x, this.m_y)
|
Transform.Translate(this.m_x, this.m_y),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
toContours() {
|
toContours() {
|
||||||
|
@ -317,8 +317,8 @@ export class TransformedGeometry extends GeometryBase {
|
||||||
unwrapped.m_geom,
|
unwrapped.m_geom,
|
||||||
Transform.Translate(
|
Transform.Translate(
|
||||||
this.m_transform.tx + unwrapped.m_transform.tx,
|
this.m_transform.tx + unwrapped.m_transform.tx,
|
||||||
this.m_transform.ty + unwrapped.m_transform.ty
|
this.m_transform.ty + unwrapped.m_transform.ty,
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return new TransformedGeometry(unwrapped, this.m_transform);
|
return new TransformedGeometry(unwrapped, this.m_transform);
|
||||||
|
@ -467,7 +467,7 @@ export class BooleanGeometry extends GeometryBase {
|
||||||
sink.push({
|
sink.push({
|
||||||
type: "operand",
|
type: "operand",
|
||||||
fillType: TypoGeom.Boolean.PolyFillType.pftNonZero,
|
fillType: TypoGeom.Boolean.PolyFillType.pftNonZero,
|
||||||
shape: []
|
shape: [],
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -480,7 +480,7 @@ export class BooleanGeometry extends GeometryBase {
|
||||||
sink.push({
|
sink.push({
|
||||||
type: "operand",
|
type: "operand",
|
||||||
fillType: TypoGeom.Boolean.PolyFillType.pftNonZero,
|
fillType: TypoGeom.Boolean.PolyFillType.pftNonZero,
|
||||||
shape: CurveUtil.convertShapeToArcs(operand.toContours())
|
shape: CurveUtil.convertShapeToArcs(operand.toContours()),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Push operator if i > 0
|
// Push operator if i > 0
|
||||||
|
@ -548,7 +548,7 @@ export class StrokeGeometry extends GeometryBase {
|
||||||
let arcs = TypoGeom.Boolean.removeOverlap(
|
let arcs = TypoGeom.Boolean.removeOverlap(
|
||||||
CurveUtil.convertShapeToArcs(nonTransformedGeometry.toContours()),
|
CurveUtil.convertShapeToArcs(nonTransformedGeometry.toContours()),
|
||||||
TypoGeom.Boolean.PolyFillType.pftNonZero,
|
TypoGeom.Boolean.PolyFillType.pftNonZero,
|
||||||
CurveUtil.BOOLE_RESOLUTION
|
CurveUtil.BOOLE_RESOLUTION,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Fairize to get get some arcs that are simple enough
|
// Fairize to get get some arcs that are simple enough
|
||||||
|
@ -559,7 +559,7 @@ export class StrokeGeometry extends GeometryBase {
|
||||||
fairizedArcs,
|
fairizedArcs,
|
||||||
this.m_radius,
|
this.m_radius,
|
||||||
this.m_contrast,
|
this.m_contrast,
|
||||||
this.m_fInside
|
this.m_fInside,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Convert to Iosevka format
|
// Convert to Iosevka format
|
||||||
|
@ -580,7 +580,7 @@ export class StrokeGeometry extends GeometryBase {
|
||||||
this.m_gizmo,
|
this.m_gizmo,
|
||||||
this.m_radius,
|
this.m_radius,
|
||||||
this.m_contrast,
|
this.m_contrast,
|
||||||
this.m_fInside
|
this.m_fInside,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
filterTag(fn) {
|
filterTag(fn) {
|
||||||
|
@ -589,7 +589,7 @@ export class StrokeGeometry extends GeometryBase {
|
||||||
this.m_gizmo,
|
this.m_gizmo,
|
||||||
this.m_radius,
|
this.m_radius,
|
||||||
this.m_contrast,
|
this.m_contrast,
|
||||||
this.m_fInside
|
this.m_fInside,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
measureComplexity() {
|
measureComplexity() {
|
||||||
|
@ -604,7 +604,7 @@ export class StrokeGeometry extends GeometryBase {
|
||||||
Format.gizmo(this.m_gizmo),
|
Format.gizmo(this.m_gizmo),
|
||||||
Format.n(this.m_radius),
|
Format.n(this.m_radius),
|
||||||
Format.n(this.m_contrast),
|
Format.n(this.m_contrast),
|
||||||
this.m_fInside
|
this.m_fInside,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -622,7 +622,7 @@ export class SimplifyGeometry extends GeometryBase {
|
||||||
arcs = TypoGeom.Boolean.removeOverlap(
|
arcs = TypoGeom.Boolean.removeOverlap(
|
||||||
arcs,
|
arcs,
|
||||||
TypoGeom.Boolean.PolyFillType.pftNonZero,
|
TypoGeom.Boolean.PolyFillType.pftNonZero,
|
||||||
CurveUtil.BOOLE_RESOLUTION
|
CurveUtil.BOOLE_RESOLUTION,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -631,7 +631,7 @@ export class SimplifyGeometry extends GeometryBase {
|
||||||
TypoGeom.ShapeConv.transferGenericShape(
|
TypoGeom.ShapeConv.transferGenericShape(
|
||||||
TypoGeom.Fairize.fairizeBezierShape(arcs),
|
TypoGeom.Fairize.fairizeBezierShape(arcs),
|
||||||
sink,
|
sink,
|
||||||
CurveUtil.GEOMETRY_PRECISION
|
CurveUtil.GEOMETRY_PRECISION,
|
||||||
);
|
);
|
||||||
return sink.contours;
|
return sink.contours;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ export class Point {
|
||||||
return new Point(
|
return new Point(
|
||||||
this.type,
|
this.type,
|
||||||
this.x + scale * (z2.x - this.x),
|
this.x + scale * (z2.x - this.x),
|
||||||
this.y + scale * (z2.y - this.y)
|
this.y + scale * (z2.y - this.y),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
scale(t) {
|
scale(t) {
|
||||||
|
@ -74,5 +74,5 @@ Point.Type = {
|
||||||
Corner: 0,
|
Corner: 0,
|
||||||
CubicStart: 1,
|
CubicStart: 1,
|
||||||
CubicEnd: 2,
|
CubicEnd: 2,
|
||||||
Quadratic: 3
|
Quadratic: 3,
|
||||||
};
|
};
|
||||||
|
|
|
@ -168,7 +168,7 @@ class BiKnot {
|
||||||
this.d2 == null ? "" : Format.n(this.d2),
|
this.d2 == null ? "" : Format.n(this.d2),
|
||||||
this.proposedNormal
|
this.proposedNormal
|
||||||
? Format.tuple(Format.n(this.proposedNormal.x), Format.n(this.proposedNormal.y))
|
? Format.tuple(Format.n(this.proposedNormal.x), Format.n(this.proposedNormal.y))
|
||||||
: ""
|
: "",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
toMono() {
|
toMono() {
|
||||||
|
|
|
@ -34,7 +34,7 @@ export class SpiroExpander {
|
||||||
this.m_biKnotsT[j].type,
|
this.m_biKnotsT[j].type,
|
||||||
this.m_biKnotsT[j].unimportant,
|
this.m_biKnotsT[j].unimportant,
|
||||||
mix(lhs.x, rhs.x, 0.5),
|
mix(lhs.x, rhs.x, 0.5),
|
||||||
mix(lhs.y, rhs.y, 0.5)
|
mix(lhs.y, rhs.y, 0.5),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return middles;
|
return middles;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import * as SpiroJs from "spiro";
|
import * as SpiroJs from "spiro";
|
||||||
|
|
||||||
import * as CurveUtil from "./curve-util.mjs";
|
import * as CurveUtil from "./curve-util.mjs";
|
||||||
|
|
||||||
export function spiroToOutline(knots, fClosed, gizmo) {
|
export function spiroToOutline(knots, fClosed, gizmo) {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import * as TypoGeom from "typo-geom";
|
import * as TypoGeom from "typo-geom";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BOOLE_RESOLUTION,
|
BOOLE_RESOLUTION,
|
||||||
Bez3FromHermite,
|
|
||||||
GEOMETRY_PRECISION,
|
GEOMETRY_PRECISION,
|
||||||
OCCURRENT_PRECISION,
|
OCCURRENT_PRECISION,
|
||||||
OffsetCurve,
|
OffsetCurve,
|
||||||
RoundCapCurve
|
RoundCapCurve,
|
||||||
} from "./curve-util.mjs";
|
} from "./curve-util.mjs";
|
||||||
|
|
||||||
export function strokeArcs(arcs, radius, contrast, fInside) {
|
export function strokeArcs(arcs, radius, contrast, fInside) {
|
||||||
|
@ -24,7 +24,7 @@ export function strokeArcs(arcs, radius, contrast, fInside) {
|
||||||
bezs,
|
bezs,
|
||||||
TypoGeom.Boolean.PolyFillType.pftNonZero,
|
TypoGeom.Boolean.PolyFillType.pftNonZero,
|
||||||
TypoGeom.Boolean.PolyFillType.pftNonZero,
|
TypoGeom.Boolean.PolyFillType.pftNonZero,
|
||||||
BOOLE_RESOLUTION
|
BOOLE_RESOLUTION,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ export function strokeArcs(arcs, radius, contrast, fInside) {
|
||||||
currentArcs,
|
currentArcs,
|
||||||
TypoGeom.Boolean.PolyFillType.pftNonZero,
|
TypoGeom.Boolean.PolyFillType.pftNonZero,
|
||||||
TypoGeom.Boolean.PolyFillType.pftNonZero,
|
TypoGeom.Boolean.PolyFillType.pftNonZero,
|
||||||
BOOLE_RESOLUTION
|
BOOLE_RESOLUTION,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return currentArcs;
|
return currentArcs;
|
||||||
|
@ -72,8 +72,8 @@ function offsetContour(arcs, distance, contrast) {
|
||||||
prevOffsetedArc.derivative(1),
|
prevOffsetedArc.derivative(1),
|
||||||
currentOffsetedArc.bone.eval(0),
|
currentOffsetedArc.bone.eval(0),
|
||||||
currentStart,
|
currentStart,
|
||||||
currentOffsetedArc.derivative(0)
|
currentOffsetedArc.derivative(0),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
// offsetArcs.push(Bez3FromHermite(prevEnd, dPrevEnd, currentStart, dCurrentStart));
|
// offsetArcs.push(Bez3FromHermite(prevEnd, dPrevEnd, currentStart, dCurrentStart));
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ function createCap(
|
||||||
dPrevEnd, // Previous offseted curve's end point's derivative
|
dPrevEnd, // Previous offseted curve's end point's derivative
|
||||||
currentStartNoOffset, // Current non-offseted curve's start point
|
currentStartNoOffset, // Current non-offseted curve's start point
|
||||||
currentStart, // Current offseted curve's start point
|
currentStart, // Current offseted curve's start point
|
||||||
dCurrentStart // Current offseted curve's start point's derivative
|
dCurrentStart, // Current offseted curve's start point's derivative
|
||||||
) {
|
) {
|
||||||
return new RoundCapCurve(
|
return new RoundCapCurve(
|
||||||
side,
|
side,
|
||||||
|
@ -109,6 +109,6 @@ function createCap(
|
||||||
prevEndNoOffset,
|
prevEndNoOffset,
|
||||||
prevEnd,
|
prevEnd,
|
||||||
currentStartNoOffset,
|
currentStartNoOffset,
|
||||||
currentStart
|
currentStart,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ export class Transform {
|
||||||
applyOffsetXY(deltaX, deltaY) {
|
applyOffsetXY(deltaX, deltaY) {
|
||||||
return {
|
return {
|
||||||
x: deltaX * this.xx + deltaY * this.xy,
|
x: deltaX * this.xx + deltaY * this.xy,
|
||||||
y: deltaX * this.yx + deltaY * this.yy
|
y: deltaX * this.yx + deltaY * this.yy,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ export class Transform {
|
||||||
-this.yx / denom,
|
-this.yx / denom,
|
||||||
this.xx / denom,
|
this.xx / denom,
|
||||||
-(this.tx * this.yy - this.ty * this.xy) / denom,
|
-(this.tx * this.yy - this.ty * this.xy) / denom,
|
||||||
-(-this.tx * this.yx + this.ty * this.xx) / denom
|
-(-this.tx * this.yx + this.ty * this.xx) / denom,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ export class Transform {
|
||||||
z10.y - z00.y,
|
z10.y - z00.y,
|
||||||
z01.y - z00.y,
|
z01.y - z00.y,
|
||||||
z00.x,
|
z00.x,
|
||||||
z00.y
|
z00.y,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ export class Glyph {
|
||||||
this.includeGeometry(new Geom.ReferenceGeometry(g, shiftX, shiftY));
|
this.includeGeometry(new Geom.ReferenceGeometry(g, shiftX, shiftY));
|
||||||
} else {
|
} else {
|
||||||
this.includeGeometry(
|
this.includeGeometry(
|
||||||
new Geom.TransformedGeometry(g.geometry, Transform.Translate(shiftX, shiftY))
|
new Geom.TransformedGeometry(g.geometry, Transform.Translate(shiftX, shiftY)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@ export class Glyph {
|
||||||
const baseDerived = g.baseAnchors[m2];
|
const baseDerived = g.baseAnchors[m2];
|
||||||
this.baseAnchors[m2] = new Anchor(
|
this.baseAnchors[m2] = new Anchor(
|
||||||
shift.x + baseDerived.x,
|
shift.x + baseDerived.x,
|
||||||
shift.y + baseDerived.y
|
shift.y + baseDerived.y,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ export const Dotless = {
|
||||||
},
|
},
|
||||||
amendName(name) {
|
amendName(name) {
|
||||||
return name + ".dotless";
|
return name + ".dotless";
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const LowerYDotAtBelow = LinkedGlyphProp("LowerYDotAtBelow");
|
export const LowerYDotAtBelow = LinkedGlyphProp("LowerYDotAtBelow");
|
||||||
|
@ -27,9 +27,9 @@ export const LeaningMarkSpacer = LinkedGlyphProp("LeaningMarkSpacer");
|
||||||
export const LocalizedForm = {
|
export const LocalizedForm = {
|
||||||
SRB: {
|
SRB: {
|
||||||
Upright: LinkedGlyphProp("SerbianLocUpright"),
|
Upright: LinkedGlyphProp("SerbianLocUpright"),
|
||||||
Italic: LinkedGlyphProp("SerbianLocItalic")
|
Italic: LinkedGlyphProp("SerbianLocItalic"),
|
||||||
},
|
},
|
||||||
BGR: LinkedGlyphProp("BulgarianLoc")
|
BGR: LinkedGlyphProp("BulgarianLoc"),
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Texture = {
|
export const Texture = {
|
||||||
|
@ -38,7 +38,7 @@ export const Texture = {
|
||||||
ExtLR: LinkedGlyphProp("TextureExtLR"),
|
ExtLR: LinkedGlyphProp("TextureExtLR"),
|
||||||
ShrL: LinkedGlyphProp("TextureShrL"),
|
ShrL: LinkedGlyphProp("TextureShrL"),
|
||||||
ShrR: LinkedGlyphProp("TextureShrR"),
|
ShrR: LinkedGlyphProp("TextureShrR"),
|
||||||
ShrLR: LinkedGlyphProp("TextureShrLR")
|
ShrLR: LinkedGlyphProp("TextureShrLR"),
|
||||||
};
|
};
|
||||||
|
|
||||||
function LinkedGlyphProp(key) {
|
function LinkedGlyphProp(key) {
|
||||||
|
@ -58,7 +58,7 @@ function LinkedGlyphProp(key) {
|
||||||
},
|
},
|
||||||
amendOtName(name) {
|
amendOtName(name) {
|
||||||
return `${name}.${key}`;
|
return `${name}.${key}`;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ function DecompositionProp(key) {
|
||||||
},
|
},
|
||||||
amendOtName(baseName, index) {
|
amendOtName(baseName, index) {
|
||||||
return `${baseName}.d${index}`;
|
return `${baseName}.d${index}`;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ export const TieGlyph = {
|
||||||
if (!glyph.related) glyph.related = {};
|
if (!glyph.related) glyph.related = {};
|
||||||
glyph.related.TieGlyph = true;
|
glyph.related.TieGlyph = true;
|
||||||
Joining.or(glyph, Joining.Classes.Mid);
|
Joining.or(glyph, Joining.Classes.Mid);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function BoolProp(id) {
|
function BoolProp(id) {
|
||||||
|
@ -115,7 +115,7 @@ function BoolProp(id) {
|
||||||
set(glyph) {
|
set(glyph) {
|
||||||
if (!glyph.related) glyph.related = {};
|
if (!glyph.related) glyph.related = {};
|
||||||
glyph.related[id] = true;
|
glyph.related[id] = true;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
export const Radical = BoolProp("Radical");
|
export const Radical = BoolProp("Radical");
|
||||||
|
@ -152,8 +152,8 @@ export const Joining = {
|
||||||
Classes: {
|
Classes: {
|
||||||
Left: 1,
|
Left: 1,
|
||||||
Right: 2,
|
Right: 2,
|
||||||
Mid: 3
|
Mid: 3,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const HintClass = {
|
export const HintClass = {
|
||||||
|
@ -164,7 +164,7 @@ export const HintClass = {
|
||||||
set(glyph, script, style) {
|
set(glyph, script, style) {
|
||||||
if (!glyph.related) glyph.related = {};
|
if (!glyph.related) glyph.related = {};
|
||||||
glyph.related.hintClass = [script, style];
|
glyph.related.hintClass = [script, style];
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -173,7 +173,7 @@ export const DotlessOrNot = {
|
||||||
query(glyph) {
|
query(glyph) {
|
||||||
if (Dotless.get(glyph)) return [Dotless];
|
if (Dotless.get(glyph)) return [Dotless];
|
||||||
return null;
|
return null;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AnyLocalizedForm = {
|
export const AnyLocalizedForm = {
|
||||||
|
@ -184,7 +184,7 @@ export const AnyLocalizedForm = {
|
||||||
if (LocalizedForm.BGR.get(glyph)) grs.push(LocalizedForm.BGR);
|
if (LocalizedForm.BGR.get(glyph)) grs.push(LocalizedForm.BGR);
|
||||||
if (grs.length) return grs;
|
if (grs.length) return grs;
|
||||||
return null;
|
return null;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AnyCv = {
|
export const AnyCv = {
|
||||||
|
@ -203,7 +203,7 @@ export const AnyCv = {
|
||||||
if (ua < ub) return -1;
|
if (ua < ub) return -1;
|
||||||
if (ua > ub) return 1;
|
if (ua > ub) return 1;
|
||||||
return a.rank - b.rank;
|
return a.rank - b.rank;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AnyDerivingCv = {
|
export const AnyDerivingCv = {
|
||||||
|
@ -223,7 +223,7 @@ export const AnyDerivingCv = {
|
||||||
return glyph.related.preventCvDeriving.size > 0;
|
return glyph.related.preventCvDeriving.size > 0;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AnyCvOrCherryPicking = {
|
export const AnyCvOrCherryPicking = {
|
||||||
|
@ -231,7 +231,7 @@ export const AnyCvOrCherryPicking = {
|
||||||
let ret = AnyCv.query(glyph);
|
let ret = AnyCv.query(glyph);
|
||||||
if (Zero.get(glyph)) ret.push(Zero);
|
if (Zero.get(glyph)) ret.push(Zero);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -370,9 +370,9 @@ function displayQueryPairFeatures(g, name, grCis, grTrans, sink) {
|
||||||
FeatureSeries(name, [
|
FeatureSeries(name, [
|
||||||
[
|
[
|
||||||
{ css: `'${grCis.otlTag}' 1`, description: grCis.description },
|
{ css: `'${grCis.otlTag}' 1`, description: grCis.description },
|
||||||
{ css: `'${grTrans.otlTag}' 1`, description: grTrans.description }
|
{ css: `'${grTrans.otlTag}' 1`, description: grTrans.description },
|
||||||
]
|
],
|
||||||
])
|
]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -382,9 +382,9 @@ function displayQuerySingleFeature(g, grCis, sink) {
|
||||||
FeatureSeries(grCis.description, [
|
FeatureSeries(grCis.description, [
|
||||||
[
|
[
|
||||||
{ css: `'${grCis.otlTag}' 0`, description: grCis.description + " disabled" },
|
{ css: `'${grCis.otlTag}' 0`, description: grCis.description + " disabled" },
|
||||||
{ css: `'${grCis.otlTag}' 1`, description: grCis.description + " enabled" }
|
{ css: `'${grCis.otlTag}' 1`, description: grCis.description + " enabled" },
|
||||||
]
|
],
|
||||||
])
|
]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -414,7 +414,7 @@ function queryCvFeatureTagsOf(sink, gid, glyph, tagSet) {
|
||||||
|
|
||||||
const featureApp = {
|
const featureApp = {
|
||||||
css: `'${gr.tag}' ${String(gr.rank).padStart(2)}`,
|
css: `'${gr.tag}' ${String(gr.rank).padStart(2)}`,
|
||||||
description: gr.description
|
description: gr.description,
|
||||||
};
|
};
|
||||||
if (!series.groups[gr.groupRank]) series.groups[gr.groupRank] = [];
|
if (!series.groups[gr.groupRank]) series.groups[gr.groupRank] = [];
|
||||||
series.groups[gr.groupRank].push(featureApp);
|
series.groups[gr.groupRank].push(featureApp);
|
||||||
|
@ -474,7 +474,7 @@ export const SvInheritableRelations = [
|
||||||
Joining,
|
Joining,
|
||||||
NeqLigationSlashDotted,
|
NeqLigationSlashDotted,
|
||||||
OgonekTrY,
|
OgonekTrY,
|
||||||
ScheduleLeaningMark
|
ScheduleLeaningMark,
|
||||||
];
|
];
|
||||||
|
|
||||||
export const CvCherryPickingGrs = [Zero];
|
export const CvCherryPickingGrs = [Zero];
|
||||||
|
|
|
@ -18,7 +18,7 @@ export function applyLigationData(data, para, argv) {
|
||||||
}
|
}
|
||||||
para.ligation = {
|
para.ligation = {
|
||||||
defaultBuildup,
|
defaultBuildup,
|
||||||
caltBuildup: []
|
caltBuildup: [],
|
||||||
};
|
};
|
||||||
if (argv.ligations) {
|
if (argv.ligations) {
|
||||||
if (argv.ligations.inherits)
|
if (argv.ligations.inherits)
|
||||||
|
@ -27,13 +27,13 @@ export function applyLigationData(data, para, argv) {
|
||||||
Parameters.apply(
|
Parameters.apply(
|
||||||
para.ligation,
|
para.ligation,
|
||||||
hives,
|
hives,
|
||||||
argv.ligations.disables.map(x => `ligset-disable-${x}`)
|
argv.ligations.disables.map(x => `ligset-disable-${x}`),
|
||||||
);
|
);
|
||||||
if (argv.ligations.enables)
|
if (argv.ligations.enables)
|
||||||
Parameters.apply(
|
Parameters.apply(
|
||||||
para.ligation,
|
para.ligation,
|
||||||
hives,
|
hives,
|
||||||
argv.ligations.enables.map(x => `ligset-enable-${x}`)
|
argv.ligations.enables.map(x => `ligset-enable-${x}`),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ const validMetricOverrideFields = new Set([
|
||||||
"essRatioQuestion",
|
"essRatioQuestion",
|
||||||
"essRatio",
|
"essRatio",
|
||||||
"archDepth",
|
"archDepth",
|
||||||
"smallArchDepth"
|
"smallArchDepth",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -21,7 +21,7 @@ export function apply(data, para, argv) {
|
||||||
para.variants = {
|
para.variants = {
|
||||||
selectorTree: parsed.selectorTree,
|
selectorTree: parsed.selectorTree,
|
||||||
primes: parsed.primes,
|
primes: parsed.primes,
|
||||||
composites: parsed.composites
|
composites: parsed.composites,
|
||||||
};
|
};
|
||||||
para.variantSelector = variantSelector;
|
para.variantSelector = variantSelector;
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ class Prime {
|
||||||
ligatureSampler: this.ligatureSampler,
|
ligatureSampler: this.ligatureSampler,
|
||||||
descSampleText: this.descSampleText,
|
descSampleText: this.descSampleText,
|
||||||
hotChars: this.hotChars,
|
hotChars: this.hotChars,
|
||||||
variants: []
|
variants: [],
|
||||||
};
|
};
|
||||||
for (const variant of this.variants.values()) {
|
for (const variant of this.variants.values()) {
|
||||||
gr.variants.push({
|
gr.variants.push({
|
||||||
|
@ -175,7 +175,7 @@ class Prime {
|
||||||
rank: variant.rank,
|
rank: variant.rank,
|
||||||
groupRank: variant.groupRank,
|
groupRank: variant.groupRank,
|
||||||
description: variant.description,
|
description: variant.description,
|
||||||
snapshotFeatureApplication: variant.snapshotFeatureApplication
|
snapshotFeatureApplication: variant.snapshotFeatureApplication,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
gr.variants.sort((a, b) => (a.rank || 0x7fffffff) - (b.rank || 0x7fffffff));
|
gr.variants.sort((a, b) => (a.rank || 0x7fffffff) - (b.rank || 0x7fffffff));
|
||||||
|
@ -249,7 +249,7 @@ class Composite {
|
||||||
design: slabOverrideCfg.design,
|
design: slabOverrideCfg.design,
|
||||||
override: slabOverrideCfg.upright || slabOverrideCfg["upright-oblique"],
|
override: slabOverrideCfg.upright || slabOverrideCfg["upright-oblique"],
|
||||||
oblique: slabOverrideCfg.oblique || slabOverrideCfg["upright-oblique"],
|
oblique: slabOverrideCfg.oblique || slabOverrideCfg["upright-oblique"],
|
||||||
italic: slabOverrideCfg.italic
|
italic: slabOverrideCfg.italic,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
decompose(para, selTree) {
|
decompose(para, selTree) {
|
||||||
|
@ -259,7 +259,7 @@ class Composite {
|
||||||
this.design,
|
this.design,
|
||||||
this.decomposeSlope(this, para),
|
this.decomposeSlope(this, para),
|
||||||
!para.slab ? {} : this.slabOverride.design,
|
!para.slab ? {} : this.slabOverride.design,
|
||||||
!para.slab ? {} : this.decomposeSlope(this.slabOverride, para)
|
!para.slab ? {} : this.decomposeSlope(this.slabOverride, para),
|
||||||
);
|
);
|
||||||
for (const [k, v] of Object.entries(cfg)) {
|
for (const [k, v] of Object.entries(cfg)) {
|
||||||
const pv = selTree.get(k, v);
|
const pv = selTree.get(k, v);
|
||||||
|
@ -308,7 +308,7 @@ class VariantBuilder {
|
||||||
globalState.sink.sort(
|
globalState.sink.sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
a.nonBreakingVariantAdditionPriority - b.nonBreakingVariantAdditionPriority ||
|
a.nonBreakingVariantAdditionPriority - b.nonBreakingVariantAdditionPriority ||
|
||||||
a.rank - b.rank
|
a.rank - b.rank,
|
||||||
);
|
);
|
||||||
|
|
||||||
let ans = {};
|
let ans = {};
|
||||||
|
@ -398,7 +398,7 @@ class VbStageAlternative {
|
||||||
ans.addDescription(
|
ans.addDescription(
|
||||||
this.mode,
|
this.mode,
|
||||||
this.evalValue(this.descriptionJoiner, localState),
|
this.evalValue(this.descriptionJoiner, localState),
|
||||||
this.evalValue(this.descriptionAffix, localState)
|
this.evalValue(this.descriptionAffix, localState),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (this.selectorAffix) {
|
if (this.selectorAffix) {
|
||||||
|
@ -563,7 +563,7 @@ class VbLocalState {
|
||||||
rank: this.rank,
|
rank: this.rank,
|
||||||
groupRank: this.groupRank,
|
groupRank: this.groupRank,
|
||||||
description: this.produceDescription(),
|
description: this.produceDescription(),
|
||||||
selector: Object.fromEntries(this.selector)
|
selector: Object.fromEntries(this.selector),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ export const SuffixCfg = {
|
||||||
if (pair) ans[pair.left] = pair.right;
|
if (pair) ans[pair.left] = pair.right;
|
||||||
}
|
}
|
||||||
return ans;
|
return ans;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -98,7 +98,7 @@ export const MatchUtil = {
|
||||||
},
|
},
|
||||||
either(a, b) {
|
either(a, b) {
|
||||||
return x => a(x) || b(x);
|
return x => a(x) || b(x);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
export function constant(x) {
|
export function constant(x) {
|
||||||
return () => x;
|
return () => x;
|
||||||
|
@ -136,5 +136,5 @@ export const ArrayUtil = {
|
||||||
}
|
}
|
||||||
|
|
||||||
return ranges;
|
return ranges;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -46,7 +46,7 @@ export default async function main(argv) {
|
||||||
`<tr><td align="center">` +
|
`<tr><td align="center">` +
|
||||||
`<a href="${baseUrl}/packages-sha.txt">Package hashes (SHA-256)</a>` +
|
`<a href="${baseUrl}/packages-sha.txt">Package hashes (SHA-256)</a>` +
|
||||||
`</td></tr>` +
|
`</td></tr>` +
|
||||||
`</table>`
|
`</table>`,
|
||||||
);
|
);
|
||||||
await fs.promises.writeFile(argv.outputPath, out.data);
|
await fs.promises.writeFile(argv.outputPath, out.data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ async function main(argv) {
|
||||||
let readme = await fs.promises.readFile(argv.mdFilePath, "utf-8");
|
let readme = await fs.promises.readFile(argv.mdFilePath, "utf-8");
|
||||||
const dirs = {
|
const dirs = {
|
||||||
images: path.posix.relative(path.dirname(argv.mdFilePath), "images"),
|
images: path.posix.relative(path.dirname(argv.mdFilePath), "images"),
|
||||||
fragments: path.resolve(__dirname, "fragments")
|
fragments: path.resolve(__dirname, "fragments"),
|
||||||
};
|
};
|
||||||
readme = (await processSsOt(argv, dirs)).apply(readme);
|
readme = (await processSsOt(argv, dirs)).apply(readme);
|
||||||
readme = (await processCherryPickingStyles(argv, dirs)).apply(readme);
|
readme = (await processCherryPickingStyles(argv, dirs)).apply(readme);
|
||||||
|
@ -30,10 +30,10 @@ async function main(argv) {
|
||||||
readme = (await processLigSetCherryPicking(argv, dirs)).apply(readme);
|
readme = (await processLigSetCherryPicking(argv, dirs)).apply(readme);
|
||||||
readme = (await processLigSetPreDef(argv, dirs)).apply(readme);
|
readme = (await processLigSetPreDef(argv, dirs)).apply(readme);
|
||||||
readme = (await processLigSetOt(argv, dirs, 1, g => !isLanguageSpecificLigTag(g.tag))).apply(
|
readme = (await processLigSetOt(argv, dirs, 1, g => !isLanguageSpecificLigTag(g.tag))).apply(
|
||||||
readme
|
readme,
|
||||||
);
|
);
|
||||||
readme = (await processLigSetOt(argv, dirs, 2, g => isLanguageSpecificLigTag(g.tag))).apply(
|
readme = (await processLigSetOt(argv, dirs, 2, g => isLanguageSpecificLigTag(g.tag))).apply(
|
||||||
readme
|
readme,
|
||||||
);
|
);
|
||||||
readme = (await processLangList(argv)).apply(readme);
|
readme = (await processLangList(argv)).apply(readme);
|
||||||
readme = (await processPrivateBuildPlans(argv, dirs)).apply(readme);
|
readme = (await processPrivateBuildPlans(argv, dirs)).apply(readme);
|
||||||
|
|
|
@ -4,7 +4,7 @@ export class MdCol {
|
||||||
this.sectionName = sectionName;
|
this.sectionName = sectionName;
|
||||||
this.matchRegex = new RegExp(
|
this.matchRegex = new RegExp(
|
||||||
`^([ \\t]*)<!-- BEGIN ${sectionName} -->\\n[\\s\\S]*?<!-- END ${sectionName} -->\\n`,
|
`^([ \\t]*)<!-- BEGIN ${sectionName} -->\\n[\\s\\S]*?<!-- END ${sectionName} -->\\n`,
|
||||||
`m`
|
`m`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
log(...s) {
|
log(...s) {
|
||||||
|
|
|
@ -21,7 +21,7 @@ export default async function processCherryPickingStyles(argv, dirs) {
|
||||||
const info = {
|
const info = {
|
||||||
introMD: cv.description || `Styles for ${sampleText + explainText}`,
|
introMD: cv.description || `Styles for ${sampleText + explainText}`,
|
||||||
sampleImageCountEm: sampleImageCountEmOfCv(cv),
|
sampleImageCountEm: sampleImageCountEmOfCv(cv),
|
||||||
alternatives: []
|
alternatives: [],
|
||||||
};
|
};
|
||||||
const defaults = figureOutDefaults(variantsData, cv);
|
const defaults = figureOutDefaults(variantsData, cv);
|
||||||
for (const cvv of cv.variants) {
|
for (const cvv of cv.variants) {
|
||||||
|
@ -31,14 +31,14 @@ export default async function processCherryPickingStyles(argv, dirs) {
|
||||||
imageId: `${cv.key}-${cvv.key}`,
|
imageId: `${cv.key}-${cvv.key}`,
|
||||||
selectors: [`${cv.key} = '${cvv.key}'`, `${cv.tag} = ${cvv.rank}`],
|
selectors: [`${cv.key} = '${cvv.key}'`, `${cv.tag} = ${cvv.rank}`],
|
||||||
description:
|
description:
|
||||||
formatDescription(cvv.description) + formatDefaults(cvv.key, defaults)
|
formatDescription(cvv.description) + formatDefaults(cvv.key, defaults),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
info.alternatives.push({
|
info.alternatives.push({
|
||||||
imageId: `${cv.key}-${cvv.key}`,
|
imageId: `${cv.key}-${cvv.key}`,
|
||||||
selectors: [`${cv.key} = '${cvv.key}'`],
|
selectors: [`${cv.key} = '${cvv.key}'`],
|
||||||
description:
|
description:
|
||||||
formatDescription(cvv.description) + formatDefaults(cvv.key, defaults)
|
formatDescription(cvv.description) + formatDefaults(cvv.key, defaults),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,26 +96,26 @@ function figureOutDefaults(variantsData, gr) {
|
||||||
desc: "Sans Upright",
|
desc: "Sans Upright",
|
||||||
mask: 1,
|
mask: 1,
|
||||||
result: null,
|
result: null,
|
||||||
composition: { ...variantsData.defaults.sans.upright }
|
composition: { ...variantsData.defaults.sans.upright },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "Sans Italic",
|
desc: "Sans Italic",
|
||||||
mask: 2,
|
mask: 2,
|
||||||
result: null,
|
result: null,
|
||||||
composition: { ...variantsData.defaults.sans.italic }
|
composition: { ...variantsData.defaults.sans.italic },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "Slab Upright",
|
desc: "Slab Upright",
|
||||||
mask: 4,
|
mask: 4,
|
||||||
result: null,
|
result: null,
|
||||||
composition: { ...variantsData.defaults.slab.upright }
|
composition: { ...variantsData.defaults.slab.upright },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "Slab Italic",
|
desc: "Slab Italic",
|
||||||
mask: 8,
|
mask: 8,
|
||||||
result: null,
|
result: null,
|
||||||
composition: { ...variantsData.defaults.slab.italic }
|
composition: { ...variantsData.defaults.slab.italic },
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
for (const variant of gr.variants) {
|
for (const variant of gr.variants) {
|
||||||
for (const dc of defaultConfigs) {
|
for (const dc of defaultConfigs) {
|
||||||
|
|
|
@ -6,12 +6,12 @@ export default async function processCvInfluences(argv) {
|
||||||
const cl = await getCharMapAndSupportedLanguageList(
|
const cl = await getCharMapAndSupportedLanguageList(
|
||||||
argv.charMapPath,
|
argv.charMapPath,
|
||||||
argv.charMapItalicPath,
|
argv.charMapItalicPath,
|
||||||
argv.charMapObliquePath
|
argv.charMapObliquePath,
|
||||||
);
|
);
|
||||||
|
|
||||||
let m = {
|
let m = {
|
||||||
upright: new Map(),
|
upright: new Map(),
|
||||||
italic: new Map()
|
italic: new Map(),
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const block of cl.unicodeCoverage) {
|
for (const block of cl.unicodeCoverage) {
|
||||||
|
|
|
@ -19,7 +19,7 @@ export default async function processCvOt(argv, dirs) {
|
||||||
for (let rid = 0; rid < rowsNeeded; rid++) {
|
for (let rid = 0; rid < rowsNeeded; rid++) {
|
||||||
const entriesInThisRow = Math.min(
|
const entriesInThisRow = Math.min(
|
||||||
entriesPerRow,
|
entriesPerRow,
|
||||||
effVariants.length - rid * entriesPerRow
|
effVariants.length - rid * entriesPerRow,
|
||||||
);
|
);
|
||||||
const tailBlankColumnsCount = TableColumns - entryWidth * entriesInThisRow;
|
const tailBlankColumnsCount = TableColumns - entryWidth * entriesInThisRow;
|
||||||
// Image row
|
// Image row
|
||||||
|
|
|
@ -6,7 +6,7 @@ export default async function processLangList(argv) {
|
||||||
const cl = await getCharMapAndSupportedLanguageList(
|
const cl = await getCharMapAndSupportedLanguageList(
|
||||||
argv.charMapPath,
|
argv.charMapPath,
|
||||||
argv.charMapItalicPath,
|
argv.charMapItalicPath,
|
||||||
argv.charMapObliquePath
|
argv.charMapObliquePath,
|
||||||
);
|
);
|
||||||
const md = new MdCol("Section-Language-List");
|
const md = new MdCol("Section-Language-List");
|
||||||
md.log(`${cl.languages.length} Supported Languages: \n`);
|
md.log(`${cl.languages.length} Supported Languages: \n`);
|
||||||
|
|
|
@ -35,7 +35,7 @@ export default async function processPackageList(argv, dirs) {
|
||||||
ttcCells = [
|
ttcCells = [
|
||||||
`<td><b><a href="${sTtcLink}">Super\u00A0TTC</b></td>`,
|
`<td><b><a href="${sTtcLink}">Super\u00A0TTC</b></td>`,
|
||||||
`<td><b><a href="${ttcLink}">TTC</b></td>`,
|
`<td><b><a href="${ttcLink}">TTC</b></td>`,
|
||||||
`<td colspan="2"> </td>`
|
`<td colspan="2"> </td>`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ export default async function processPackageList(argv, dirs) {
|
||||||
`<tr>`,
|
`<tr>`,
|
||||||
`<td colspan="3"><b>📦 ${familyName}</b> — ${desc}</td>`,
|
`<td colspan="3"><b>📦 ${familyName}</b> — ${desc}</td>`,
|
||||||
...ttcCells,
|
...ttcCells,
|
||||||
`</tr>`
|
`</tr>`,
|
||||||
);
|
);
|
||||||
md.log(
|
md.log(
|
||||||
`<tr>`,
|
`<tr>`,
|
||||||
|
@ -51,7 +51,7 @@ export default async function processPackageList(argv, dirs) {
|
||||||
`<td><b>Spacing</b></td>`,
|
`<td><b>Spacing</b></td>`,
|
||||||
`<td><b>Ligatures</b></td>`,
|
`<td><b>Ligatures</b></td>`,
|
||||||
`<td colspan="4"><b>Downloads</b></td>`,
|
`<td colspan="4"><b>Downloads</b></td>`,
|
||||||
`</tr>`
|
`</tr>`,
|
||||||
);
|
);
|
||||||
let lastSubGroupID = null;
|
let lastSubGroupID = null;
|
||||||
for (const [subGroupID, subGr] of Object.entries(gr.subGroups)) {
|
for (const [subGroupID, subGr] of Object.entries(gr.subGroups)) {
|
||||||
|
@ -78,7 +78,7 @@ export default async function processPackageList(argv, dirs) {
|
||||||
`(${createLink("Unhinted", "PkgTTF-Unhinted")})</td>`,
|
`(${createLink("Unhinted", "PkgTTF-Unhinted")})</td>`,
|
||||||
`<td>${createLink("WebFont", "PkgWebFont")} ` +
|
`<td>${createLink("WebFont", "PkgWebFont")} ` +
|
||||||
`(${createLink("Unhinted", "PkgWebFont-Unhinted")})</td>`,
|
`(${createLink("Unhinted", "PkgWebFont-Unhinted")})</td>`,
|
||||||
`</tr>`
|
`</tr>`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
md.log(`<tr>`, `<td colspan="8">${img}</td>`, `</tr>`);
|
md.log(`<tr>`, `<td colspan="8">${img}</td>`, `</tr>`);
|
||||||
|
@ -98,7 +98,7 @@ const Spacings = {
|
||||||
type: ["Default", true],
|
type: ["Default", true],
|
||||||
term: ["Terminal", true],
|
term: ["Terminal", true],
|
||||||
fixed: ["Fixed", false],
|
fixed: ["Fixed", false],
|
||||||
"quasi-proportional": ["Default", false]
|
"quasi-proportional": ["Default", false],
|
||||||
};
|
};
|
||||||
function flag(f) {
|
function flag(f) {
|
||||||
return f ? "<b>Yes</b>" : "No";
|
return f ? "<b>Yes</b>" : "No";
|
||||||
|
|
|
@ -18,7 +18,7 @@ export default async function processSsOt(argv, dirs) {
|
||||||
`<tr>`,
|
`<tr>`,
|
||||||
`<td>${ImgX(`${dirs.images}/ss-u-${ss.tag}-${ss.rank}`)}</td>`,
|
`<td>${ImgX(`${dirs.images}/ss-u-${ss.tag}-${ss.rank}`)}</td>`,
|
||||||
`<td>${ImgX(`${dirs.images}/ss-i-${ss.tag}-${ss.rank}`)}</td>`,
|
`<td>${ImgX(`${dirs.images}/ss-i-${ss.tag}-${ss.rank}`)}</td>`,
|
||||||
`</tr>`
|
`</tr>`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ export async function collectBlockData() {
|
||||||
[[0xe0a0, 0xe0df], "Private Use Area — Powerline"],
|
[[0xe0a0, 0xe0df], "Private Use Area — Powerline"],
|
||||||
[[0xee00, 0xee0f], "Private Use Area — Progress Bar"],
|
[[0xee00, 0xee0f], "Private Use Area — Progress Bar"],
|
||||||
[[0xef10, 0xef1f], "Private Use Area — Iosevka Private Dingbats"],
|
[[0xef10, 0xef1f], "Private Use Area — Iosevka Private Dingbats"],
|
||||||
[[0x1cc00, 0x1ceaf], "Symbols for Legacy Computing Supplement (Proposed)"]
|
[[0x1cc00, 0x1ceaf], "Symbols for Legacy Computing Supplement (Proposed)"],
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const id of UnicodeDataIndex.Block) {
|
for (const id of UnicodeDataIndex.Block) {
|
||||||
|
|
|
@ -18,7 +18,7 @@ class CharDataLookup {
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
gc: ugc.get(lch),
|
gc: ugc.get(lch),
|
||||||
charName: ucdNames.get(lch)
|
charName: ucdNames.get(lch),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ export async function createCharDataLookup() {
|
||||||
|
|
||||||
const additionalDataTxt = await fs.promises.readFile(
|
const additionalDataTxt = await fs.promises.readFile(
|
||||||
path.join(__dirname, "additional-char-data.txt"),
|
path.join(__dirname, "additional-char-data.txt"),
|
||||||
"utf-8"
|
"utf-8",
|
||||||
);
|
);
|
||||||
|
|
||||||
let nameSuffix = "";
|
let nameSuffix = "";
|
||||||
|
|
|
@ -48,7 +48,7 @@ export async function gatherCoverageData(covUpright, covItalic, covOblique) {
|
||||||
...putFeatSeries(featureSeriesStore, "typographicFeatureSets", typoFs),
|
...putFeatSeries(featureSeriesStore, "typographicFeatureSets", typoFs),
|
||||||
...putFeatSeries(featureSeriesStore, "cvFeatureSetsUpright", uprightFs),
|
...putFeatSeries(featureSeriesStore, "cvFeatureSetsUpright", uprightFs),
|
||||||
...putFeatSeries(featureSeriesStore, "cvFeatureSetsItalic", italicFs),
|
...putFeatSeries(featureSeriesStore, "cvFeatureSetsItalic", italicFs),
|
||||||
...putFeatSeries(featureSeriesStore, "cvFeatureSetsOblique", obliqueFs)
|
...putFeatSeries(featureSeriesStore, "cvFeatureSetsOblique", obliqueFs),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
blockResults.push({ lch, gc, charName, inFont: false, glyphName: undefined });
|
blockResults.push({ lch, gc, charName, inFont: false, glyphName: undefined });
|
||||||
|
@ -57,7 +57,7 @@ export async function gatherCoverageData(covUpright, covItalic, covOblique) {
|
||||||
if (blockResults.length) {
|
if (blockResults.length) {
|
||||||
unicodeCoverage.push({
|
unicodeCoverage.push({
|
||||||
name: block,
|
name: block,
|
||||||
characters: blockResults.sort((a, b) => a.lch - b.lch)
|
characters: blockResults.sort((a, b) => a.lch - b.lch),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ async function main(argv) {
|
||||||
const cl = await getCharMapAndSupportedLanguageList(
|
const cl = await getCharMapAndSupportedLanguageList(
|
||||||
argv.charMapPath,
|
argv.charMapPath,
|
||||||
argv.charMapItalicPath,
|
argv.charMapItalicPath,
|
||||||
argv.charMapObliquePath
|
argv.charMapObliquePath,
|
||||||
);
|
);
|
||||||
await fs.promises.writeFile(
|
await fs.promises.writeFile(
|
||||||
argv.exportPathMeta,
|
argv.exportPathMeta,
|
||||||
|
@ -22,15 +22,15 @@ async function main(argv) {
|
||||||
ligationData: {
|
ligationData: {
|
||||||
cherry: ligationData.cherry,
|
cherry: ligationData.cherry,
|
||||||
samplesNarrow: ligationData.samplesNarrow,
|
samplesNarrow: ligationData.samplesNarrow,
|
||||||
nonMergeSets: ligationData.nonMergeSets
|
nonMergeSets: ligationData.nonMergeSets,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
2
|
2,
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
await fs.promises.writeFile(
|
await fs.promises.writeFile(
|
||||||
argv.exportPathCov,
|
argv.exportPathCov,
|
||||||
JSON.stringify({ version: argv.version, ...cl }, null, 2)
|
JSON.stringify({ version: argv.version, ...cl }, null, 2),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ const ligationSamplesNarrow = [
|
||||||
"--->",
|
"--->",
|
||||||
"->-",
|
"->-",
|
||||||
">-",
|
">-",
|
||||||
">>-"
|
">>-",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"=<<",
|
"=<<",
|
||||||
|
@ -35,7 +35,7 @@ const ligationSamplesNarrow = [
|
||||||
"===>",
|
"===>",
|
||||||
"=>=",
|
"=>=",
|
||||||
">=",
|
">=",
|
||||||
">>="
|
">>=",
|
||||||
],
|
],
|
||||||
["<->", "<-->", "<--->", "<---->", "<=>", "<==>", "<===>", "<====>", "::", ":::", "__"],
|
["<->", "<-->", "<--->", "<---->", "<=>", "<==>", "<===>", "<====>", "::", ":::", "__"],
|
||||||
[
|
[
|
||||||
|
@ -53,7 +53,7 @@ const ligationSamplesNarrow = [
|
||||||
"!==",
|
"!==",
|
||||||
"!===",
|
"!===",
|
||||||
"=/=",
|
"=/=",
|
||||||
"=!="
|
"=!=",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"<:",
|
"<:",
|
||||||
|
@ -72,7 +72,7 @@ const ligationSamplesNarrow = [
|
||||||
"+*",
|
"+*",
|
||||||
"=*",
|
"=*",
|
||||||
"=:",
|
"=:",
|
||||||
":>"
|
":>",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"(*",
|
"(*",
|
||||||
|
@ -90,13 +90,13 @@ const ligationSamplesNarrow = [
|
||||||
"|-",
|
"|-",
|
||||||
"-|",
|
"-|",
|
||||||
"<!--",
|
"<!--",
|
||||||
"<!---"
|
"<!---",
|
||||||
]
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
function buildLigationSet(ligData, getKey) {
|
function buildLigationSet(ligData, getKey) {
|
||||||
const ligationSets = new Map([
|
const ligationSets = new Map([
|
||||||
["*off", { tag: "calt", rank: 0, desc: "Ligation Off", brief: "Off", ligSets: [] }]
|
["*off", { tag: "calt", rank: 0, desc: "Ligation Off", brief: "Off", ligSets: [] }],
|
||||||
]);
|
]);
|
||||||
for (const sel in ligData.composite) {
|
for (const sel in ligData.composite) {
|
||||||
const comp = ligData.composite[sel];
|
const comp = ligData.composite[sel];
|
||||||
|
@ -112,7 +112,7 @@ function buildLigationSet(ligData, getKey) {
|
||||||
ligSets,
|
ligSets,
|
||||||
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 {
|
||||||
|
@ -127,19 +127,19 @@ function buildLigationSet(ligData, getKey) {
|
||||||
export async function parseLigationData(argv) {
|
export async function parseLigationData(argv) {
|
||||||
const ligToml = await fs.promises.readFile(
|
const ligToml = await fs.promises.readFile(
|
||||||
path.join(argv.paramsDir, "ligation-set.toml"),
|
path.join(argv.paramsDir, "ligation-set.toml"),
|
||||||
"utf8"
|
"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 {
|
||||||
samplesNarrow: ligationSamplesNarrow,
|
samplesNarrow: ligationSamplesNarrow,
|
||||||
cherry: ligData.simple,
|
cherry: ligData.simple,
|
||||||
rawSets: ligData.composite,
|
rawSets: ligData.composite,
|
||||||
sets: [...ligationSets.values()],
|
sets: [...ligationSets.values()],
|
||||||
nonMergeSets: [...nonMergeLigationSets.values()]
|
nonMergeSets: [...nonMergeLigationSets.values()],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ function getSupportLocaleSet(rawCoverage) {
|
||||||
...(exemplar.auxiliary || []),
|
...(exemplar.auxiliary || []),
|
||||||
...(exemplar.index || []),
|
...(exemplar.index || []),
|
||||||
...(exemplar.numbers || []),
|
...(exemplar.numbers || []),
|
||||||
...(exemplar.punctuation || [])
|
...(exemplar.punctuation || []),
|
||||||
].join("");
|
].join("");
|
||||||
let fullSupport = true;
|
let fullSupport = true;
|
||||||
let basicSupport = true;
|
let basicSupport = true;
|
||||||
|
@ -99,10 +99,10 @@ export async function getCharMapAndSupportedLanguageList(cmpUpright, cmpItalic,
|
||||||
return {
|
return {
|
||||||
stats: {
|
stats: {
|
||||||
glyphCount: charMap.length,
|
glyphCount: charMap.length,
|
||||||
codePointCount: rawCoverage.size
|
codePointCount: rawCoverage.size,
|
||||||
},
|
},
|
||||||
featureSeries: covData.featureSeries,
|
featureSeries: covData.featureSeries,
|
||||||
unicodeCoverage: covData.unicodeCoverage,
|
unicodeCoverage: covData.unicodeCoverage,
|
||||||
languages: Array.from(getSupportedLanguageSet(rawCoverage)).sort()
|
languages: Array.from(getSupportedLanguageSet(rawCoverage)).sort(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,13 +24,13 @@ const mockPara = {
|
||||||
sans: {
|
sans: {
|
||||||
upright: {},
|
upright: {},
|
||||||
oblique: { isOblique: true },
|
oblique: { isOblique: true },
|
||||||
italic: { isItalic: true }
|
italic: { isItalic: true },
|
||||||
},
|
},
|
||||||
slab: {
|
slab: {
|
||||||
upright: { slab: 2 },
|
upright: { slab: 2 },
|
||||||
oblique: { slab: 2, isOblique: true },
|
oblique: { slab: 2, isOblique: true },
|
||||||
italic: { slab: 2, isItalic: true }
|
italic: { slab: 2, isItalic: true },
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
function getSsData(variants) {
|
function getSsData(variants) {
|
||||||
const result = [
|
const result = [
|
||||||
|
@ -41,13 +41,13 @@ function getSsData(variants) {
|
||||||
description: "Default",
|
description: "Default",
|
||||||
composition: {
|
composition: {
|
||||||
sans: { upright: {}, italic: {}, oblique: {} },
|
sans: { upright: {}, italic: {}, oblique: {} },
|
||||||
slab: { upright: {}, italic: {}, oblique: {} }
|
slab: { upright: {}, italic: {}, oblique: {} },
|
||||||
},
|
},
|
||||||
hotChars: {
|
hotChars: {
|
||||||
sans: { upright: [], italic: [], oblique: [] },
|
sans: { upright: [], italic: [], oblique: [] },
|
||||||
slab: { upright: [], italic: [], oblique: [] }
|
slab: { upright: [], italic: [], oblique: [] },
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
const hcDefault = getCompWithLens(variants, null, x => x.hotChars);
|
const hcDefault = getCompWithLens(variants, null, x => x.hotChars);
|
||||||
for (const [key, composite] of variants.composites) {
|
for (const [key, composite] of variants.composites) {
|
||||||
|
@ -59,8 +59,8 @@ function getSsData(variants) {
|
||||||
description: composite.description,
|
description: composite.description,
|
||||||
composition: getCompWithLens(variants, composite, x => x.composition),
|
composition: getCompWithLens(variants, composite, x => x.composition),
|
||||||
hotChars: getCompWithLens(variants, composite, (x, style, slope) =>
|
hotChars: getCompWithLens(variants, composite, (x, style, slope) =>
|
||||||
uniqueHotChars(x.hotChars, hcDefault[style][slope])
|
uniqueHotChars(x.hotChars, hcDefault[style][slope]),
|
||||||
)
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -73,36 +73,36 @@ function getCompWithLens(variants, c, lens) {
|
||||||
upright: lens(
|
upright: lens(
|
||||||
buildupComposite(variants, mockPara.sans.upright, cDefault, c),
|
buildupComposite(variants, mockPara.sans.upright, cDefault, c),
|
||||||
"sans",
|
"sans",
|
||||||
"upright"
|
"upright",
|
||||||
),
|
),
|
||||||
italic: lens(
|
italic: lens(
|
||||||
buildupComposite(variants, mockPara.sans.italic, cDefault, c),
|
buildupComposite(variants, mockPara.sans.italic, cDefault, c),
|
||||||
"sans",
|
"sans",
|
||||||
"italic"
|
"italic",
|
||||||
),
|
),
|
||||||
oblique: lens(
|
oblique: lens(
|
||||||
buildupComposite(variants, mockPara.sans.oblique, cDefault, c),
|
buildupComposite(variants, mockPara.sans.oblique, cDefault, c),
|
||||||
"sans",
|
"sans",
|
||||||
"oblique"
|
"oblique",
|
||||||
)
|
),
|
||||||
},
|
},
|
||||||
slab: {
|
slab: {
|
||||||
upright: lens(
|
upright: lens(
|
||||||
buildupComposite(variants, mockPara.slab.upright, cDefault, cSlab, c),
|
buildupComposite(variants, mockPara.slab.upright, cDefault, cSlab, c),
|
||||||
"slab",
|
"slab",
|
||||||
"upright"
|
"upright",
|
||||||
),
|
),
|
||||||
italic: lens(
|
italic: lens(
|
||||||
buildupComposite(variants, mockPara.slab.italic, cDefault, cSlab, c),
|
buildupComposite(variants, mockPara.slab.italic, cDefault, cSlab, c),
|
||||||
"slab",
|
"slab",
|
||||||
"italic"
|
"italic",
|
||||||
),
|
),
|
||||||
oblique: lens(
|
oblique: lens(
|
||||||
buildupComposite(variants, mockPara.slab.oblique, cDefault, cSlab, c),
|
buildupComposite(variants, mockPara.slab.oblique, cDefault, cSlab, c),
|
||||||
"slab",
|
"slab",
|
||||||
"oblique"
|
"oblique",
|
||||||
)
|
),
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
function getSelectorKey(prime, variant) {
|
function getSelectorKey(prime, variant) {
|
||||||
|
@ -142,7 +142,7 @@ function uniqueHotChars(cfgDefault, cfgSS) {
|
||||||
export async function parseVariantsData(argv) {
|
export async function parseVariantsData(argv) {
|
||||||
const variantsToml = await fs.promises.readFile(
|
const variantsToml = await fs.promises.readFile(
|
||||||
path.join(argv.paramsDir, argv.paramsFileName || "variants.toml"),
|
path.join(argv.paramsDir, argv.paramsFileName || "variants.toml"),
|
||||||
"utf8"
|
"utf8",
|
||||||
);
|
);
|
||||||
const varDatRaw = toml.parse(variantsToml);
|
const varDatRaw = toml.parse(variantsToml);
|
||||||
const varDatParsed = VariantDataParser.parse(varDatRaw);
|
const varDatParsed = VariantDataParser.parse(varDatRaw);
|
||||||
|
|
|
@ -42,7 +42,7 @@ async function main(argv) {
|
||||||
const ligationData = await parseLigationData(argv);
|
const ligationData = await parseLigationData(argv);
|
||||||
const tasks = new Generator(
|
const tasks = new Generator(
|
||||||
argv.outputDir,
|
argv.outputDir,
|
||||||
argv.fontGroups.map(fg => path.resolve(process.cwd(), "dist", fg, "TTF", "*.ttf"))
|
argv.fontGroups.map(fg => path.resolve(process.cwd(), "dist", fg, "TTF", "*.ttf")),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Common
|
// Common
|
||||||
|
@ -58,7 +58,7 @@ async function main(argv) {
|
||||||
const cl = await getCharMapAndSupportedLanguageList(
|
const cl = await getCharMapAndSupportedLanguageList(
|
||||||
argv.charMapPath,
|
argv.charMapPath,
|
||||||
argv.charMapItalicPath,
|
argv.charMapItalicPath,
|
||||||
argv.charMapObliquePath
|
argv.charMapObliquePath,
|
||||||
);
|
);
|
||||||
for (const block of cl.unicodeCoverage) {
|
for (const block of cl.unicodeCoverage) {
|
||||||
const blockID = block.name
|
const blockID = block.name
|
||||||
|
@ -67,7 +67,7 @@ async function main(argv) {
|
||||||
.replaceAll(/ +/g, "-");
|
.replaceAll(/ +/g, "-");
|
||||||
if (blockID === "specials") continue;
|
if (blockID === "specials") continue;
|
||||||
await tasks.add(`cs-block-${blockID}`, CharGrid, {
|
await tasks.add(`cs-block-${blockID}`, CharGrid, {
|
||||||
characters: block.characters
|
characters: block.characters,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ async function main(argv) {
|
||||||
lineBreakMode: "each-row",
|
lineBreakMode: "each-row",
|
||||||
fontFamily: pst.fontFamily,
|
fontFamily: pst.fontFamily,
|
||||||
fontStyle: "normal",
|
fontStyle: "normal",
|
||||||
fontFeatures: pst.fontFeatures
|
fontFeatures: pst.fontFeatures,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ async function main(argv) {
|
||||||
ligationCherry: ligationData.cherry,
|
ligationCherry: ligationData.cherry,
|
||||||
tag: ls.tag,
|
tag: ls.tag,
|
||||||
rank: ls.rank,
|
rank: ls.rank,
|
||||||
ligSets: ls.ligSets
|
ligSets: ls.ligSets,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ async function main(argv) {
|
||||||
fontFamily: "Iosevka",
|
fontFamily: "Iosevka",
|
||||||
fontStyle: "normal",
|
fontStyle: "normal",
|
||||||
fontFeatures: { [ss.tag]: ss.rank },
|
fontFeatures: { [ss.tag]: ss.rank },
|
||||||
hotChars: ss.hotChars.sans.upright
|
hotChars: ss.hotChars.sans.upright,
|
||||||
});
|
});
|
||||||
await tasks.add(`ss-i-${ss.tag}-${ss.rank}`, StylisticSet, {
|
await tasks.add(`ss-i-${ss.tag}-${ss.rank}`, StylisticSet, {
|
||||||
hSize: 1,
|
hSize: 1,
|
||||||
|
@ -114,7 +114,7 @@ async function main(argv) {
|
||||||
fontFamily: "Iosevka",
|
fontFamily: "Iosevka",
|
||||||
fontStyle: "italic",
|
fontStyle: "italic",
|
||||||
fontFeatures: { [ss.tag]: ss.rank },
|
fontFeatures: { [ss.tag]: ss.rank },
|
||||||
hotChars: ss.hotChars.sans.italic
|
hotChars: ss.hotChars.sans.italic,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ async function main(argv) {
|
||||||
await tasks.add(`cv-${cv.key}-${variant.key}`, CharVariant, {
|
await tasks.add(`cv-${cv.key}-${variant.key}`, CharVariant, {
|
||||||
fontFeatures: variant.snapshotFeatureApplication || { [cv.tag]: variant.rank },
|
fontFeatures: variant.snapshotFeatureApplication || { [cv.tag]: variant.rank },
|
||||||
slopeDependent: !!cv.slopeDependent,
|
slopeDependent: !!cv.slopeDependent,
|
||||||
hotChars: cv.hotChars
|
hotChars: cv.hotChars,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,12 +15,12 @@ export default (function (args) {
|
||||||
"font-family": "Iosevka",
|
"font-family": "Iosevka",
|
||||||
"font-weight": 500,
|
"font-weight": 500,
|
||||||
"font-width": 6,
|
"font-width": 6,
|
||||||
"font-size": EM
|
"font-size": EM,
|
||||||
},
|
},
|
||||||
[{ color: theme.body }, args.text],
|
[{ color: theme.body }, args.text],
|
||||||
[{ color: theme.stress }, args.stressText || ""]
|
[{ color: theme.stress }, args.stressText || ""],
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -25,8 +25,8 @@ function CharGrid(args) {
|
||||||
{ "font-weight": 600 },
|
{ "font-weight": 600 },
|
||||||
{ "font-size": 0.5 * EM },
|
{ "font-size": 0.5 * EM },
|
||||||
{ color: theme.body },
|
{ color: theme.body },
|
||||||
offset.toString(16).toUpperCase()
|
offset.toString(16).toUpperCase(),
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,8 +45,8 @@ function CharGrid(args) {
|
||||||
{ "font-weight": 600 },
|
{ "font-weight": 600 },
|
||||||
{ "font-size": 0.5 * EM },
|
{ "font-size": 0.5 * EM },
|
||||||
{ color: theme.body },
|
{ color: theme.body },
|
||||||
"U+" + char.lch.toString(16).toUpperCase().padStart(4, "0")
|
"U+" + char.lch.toString(16).toUpperCase().padStart(4, "0"),
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,18 +57,18 @@ function CharGrid(args) {
|
||||||
left: (ITEMS_START_X + (char.lch % ITEMS_PER_ROW)) * ITEM_SIZE * EM,
|
left: (ITEMS_START_X + (char.lch % ITEMS_PER_ROW)) * ITEM_SIZE * EM,
|
||||||
right: (ITEMS_START_X + (char.lch % ITEMS_PER_ROW) + 1) * ITEM_SIZE * EM,
|
right: (ITEMS_START_X + (char.lch % ITEMS_PER_ROW) + 1) * ITEM_SIZE * EM,
|
||||||
top: rows * ITEM_SIZE * EM,
|
top: rows * ITEM_SIZE * EM,
|
||||||
bottom: (rows + 1) * ITEM_SIZE * EM
|
bottom: (rows + 1) * ITEM_SIZE * EM,
|
||||||
};
|
};
|
||||||
const fontSettings = [
|
const fontSettings = [
|
||||||
{ "font-family": "Iosevka" },
|
{ "font-family": "Iosevka" },
|
||||||
{ "font-weight": 400 },
|
{ "font-weight": 400 },
|
||||||
{ "font-size": EM }
|
{ "font-size": EM },
|
||||||
];
|
];
|
||||||
if (isMark) {
|
if (isMark) {
|
||||||
// Dotted circle
|
// Dotted circle
|
||||||
frames.push({
|
frames.push({
|
||||||
...dimensions,
|
...dimensions,
|
||||||
contents: [...fontSettings, { color: theme.stress }, "\u25CC"]
|
contents: [...fontSettings, { color: theme.stress }, "\u25CC"],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
frames.push({
|
frames.push({
|
||||||
|
@ -76,8 +76,8 @@ function CharGrid(args) {
|
||||||
contents: [
|
contents: [
|
||||||
...fontSettings,
|
...fontSettings,
|
||||||
{ color: char.inFont ? theme.body : theme.dimmed },
|
{ color: char.inFont ? theme.body : theme.dimmed },
|
||||||
char.inFont ? (isMark ? "\uE00E" : "") + String.fromCodePoint(char.lch) : "\uF00F"
|
char.inFont ? (isMark ? "\uE00E" : "") + String.fromCodePoint(char.lch) : "\uF00F",
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,6 +86,6 @@ function CharGrid(args) {
|
||||||
return {
|
return {
|
||||||
width: (ITEMS_PER_ROW + ITEMS_START_X) * ITEM_SIZE * EM,
|
width: (ITEMS_PER_ROW + ITEMS_START_X) * ITEM_SIZE * EM,
|
||||||
height: rows * ITEM_SIZE * EM,
|
height: rows * ITEM_SIZE * EM,
|
||||||
frames
|
frames,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,14 +20,14 @@ export default (function (args) {
|
||||||
{ "font-style": slope },
|
{ "font-style": slope },
|
||||||
{ "font-feature-settings": { ...args.fontFeatures, dlig: 1 } },
|
{ "font-feature-settings": { ...args.fontFeatures, dlig: 1 } },
|
||||||
{ color: theme.body },
|
{ color: theme.body },
|
||||||
ch
|
ch,
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
width: unitWidth * frames.length,
|
width: unitWidth * frames.length,
|
||||||
height: 160,
|
height: 160,
|
||||||
frames
|
frames,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,11 +15,11 @@ export default (function (args) {
|
||||||
"font-family": "Iosevka",
|
"font-family": "Iosevka",
|
||||||
"font-weight": 100,
|
"font-weight": 100,
|
||||||
"font-size": EM,
|
"font-size": EM,
|
||||||
color: theme.body
|
color: theme.body,
|
||||||
},
|
},
|
||||||
"Iosevka"
|
"Iosevka",
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -62,10 +62,10 @@ export default (function (args) {
|
||||||
"font-size": EM,
|
"font-size": EM,
|
||||||
"font-weight": 600,
|
"font-weight": 600,
|
||||||
"font-style": "italic",
|
"font-style": "italic",
|
||||||
color: theme.title
|
color: theme.title,
|
||||||
},
|
},
|
||||||
lang
|
lang,
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
frames.push({
|
frames.push({
|
||||||
top,
|
top,
|
||||||
|
@ -79,10 +79,10 @@ export default (function (args) {
|
||||||
"font-family": "Iosevka",
|
"font-family": "Iosevka",
|
||||||
"font-size": EM,
|
"font-size": EM,
|
||||||
...(localeId ? { lang: localeId } : {}),
|
...(localeId ? { lang: localeId } : {}),
|
||||||
color: theme.body
|
color: theme.body,
|
||||||
},
|
},
|
||||||
sample
|
sample,
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return { width: canvasWidth, height: canvasHeight, frames };
|
return { width: canvasWidth, height: canvasHeight, frames };
|
||||||
|
|
|
@ -47,9 +47,9 @@ export default (function (args) {
|
||||||
{ "font-family": args.fontFamily, "font-style": args.fontStyle },
|
{ "font-family": args.fontFamily, "font-style": args.fontStyle },
|
||||||
{ "font-size": 24, color: theme.body },
|
{ "font-size": 24, color: theme.body },
|
||||||
{ "font-feature-settings": { [args.tag]: args.rank } },
|
{ "font-feature-settings": { [args.tag]: args.rank } },
|
||||||
trimNewline([...makeSample(theme, args)])
|
trimNewline([...makeSample(theme, args)]),
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,7 +14,7 @@ export default (function (args) {
|
||||||
[-(1 / 4), "Iosevka", "oblique"],
|
[-(1 / 4), "Iosevka", "oblique"],
|
||||||
[+(1 / 4), "Iosevka Slab", "oblique"],
|
[+(1 / 4), "Iosevka Slab", "oblique"],
|
||||||
[-(1 / 4), "Iosevka", "italic"],
|
[-(1 / 4), "Iosevka", "italic"],
|
||||||
[+(1 / 4), "Iosevka Slab", "italic"]
|
[+(1 / 4), "Iosevka Slab", "italic"],
|
||||||
];
|
];
|
||||||
const weights = [100, 200, 300, 400, 500, 600, 700, 800, 900];
|
const weights = [100, 200, 300, 400, 500, 600, 700, 800, 900];
|
||||||
let frames = [];
|
let frames = [];
|
||||||
|
@ -35,10 +35,10 @@ export default (function (args) {
|
||||||
"font-weight": weight,
|
"font-weight": weight,
|
||||||
"font-style": slope,
|
"font-style": slope,
|
||||||
"font-size": EM,
|
"font-size": EM,
|
||||||
color: theme.body
|
color: theme.body,
|
||||||
},
|
},
|
||||||
"Mag"
|
"Mag",
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,10 +57,10 @@ export default (function (args) {
|
||||||
"font-weight": 100,
|
"font-weight": 100,
|
||||||
"font-style": "normal",
|
"font-style": "normal",
|
||||||
"font-size": 3 * EM,
|
"font-size": 3 * EM,
|
||||||
color: theme.sigil
|
color: theme.sigil,
|
||||||
},
|
},
|
||||||
"\uEF10"
|
"\uEF10",
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
return { width: canvasWidth, height: canvasHeight + sigilHeight, frames };
|
return { width: canvasWidth, height: canvasHeight + sigilHeight, frames };
|
||||||
|
|
|
@ -41,9 +41,9 @@ export default (function (args) {
|
||||||
{ "font-family": args.fontFamily, "font-style": args.fontStyle },
|
{ "font-family": args.fontFamily, "font-style": args.fontStyle },
|
||||||
{ "font-size": 24, color: theme.body },
|
{ "font-size": 24, color: theme.body },
|
||||||
{ "font-feature-settings": { calt: 1, ...args.fontFeatures } },
|
{ "font-feature-settings": { calt: 1, ...args.fontFeatures } },
|
||||||
trimNewline([...makeSample(args.lineBreakMode, args.hotChars)])
|
trimNewline([...makeSample(args.lineBreakMode, args.hotChars)]),
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -49,10 +49,10 @@ export default (function (args) {
|
||||||
{ "font-size": 24, color: theme.body },
|
{ "font-size": 24, color: theme.body },
|
||||||
{ "font-feature-settings": { calt: 1 } },
|
{ "font-feature-settings": { calt: 1 } },
|
||||||
trimNewline([
|
trimNewline([
|
||||||
...makeSample(theme, args.lineBreakMode, args.fontFeatures, args.hotChars)
|
...makeSample(theme, args.lineBreakMode, args.fontFeatures, args.hotChars),
|
||||||
])
|
]),
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,13 +20,13 @@ export default (function (args) {
|
||||||
"font-family": "Iosevka",
|
"font-family": "Iosevka",
|
||||||
"font-weight": weight,
|
"font-weight": weight,
|
||||||
"font-size": EM,
|
"font-size": EM,
|
||||||
color: theme.body
|
color: theme.body,
|
||||||
},
|
},
|
||||||
[{ color: theme.title }, "float"],
|
[{ color: theme.title }, "float"],
|
||||||
" Fox.quick(h){ is_brown ",
|
" Fox.quick(h){ is_brown ",
|
||||||
[{ color: theme.stress }, "&&"],
|
[{ color: theme.stress }, "&&"],
|
||||||
" it_jumps_over(dogs.lazy); }"
|
" it_jumps_over(dogs.lazy); }",
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return { width: canvasWidth, height: canvasHeight, frames };
|
return { width: canvasWidth, height: canvasHeight, frames };
|
||||||
|
|
|
@ -3,12 +3,12 @@ export const light = {
|
||||||
dimmed: "#20242E40",
|
dimmed: "#20242E40",
|
||||||
stress: "#048FBF",
|
stress: "#048FBF",
|
||||||
sigil: "#974caf",
|
sigil: "#974caf",
|
||||||
title: "#8757AD"
|
title: "#8757AD",
|
||||||
};
|
};
|
||||||
export const dark = {
|
export const dark = {
|
||||||
body: "#DEE4E3",
|
body: "#DEE4E3",
|
||||||
dimmed: "#DEE4E340",
|
dimmed: "#DEE4E340",
|
||||||
stress: "#03AEE9",
|
stress: "#03AEE9",
|
||||||
sigil: "#c49ed1",
|
sigil: "#c49ed1",
|
||||||
title: "#B77FDB"
|
title: "#B77FDB",
|
||||||
};
|
};
|
||||||
|
|
|
@ -46,7 +46,7 @@ async function main() {
|
||||||
out.push({
|
out.push({
|
||||||
scriptTag: key.split("-")[0],
|
scriptTag: key.split("-")[0],
|
||||||
featureTag: key.split("-")[1],
|
featureTag: key.split("-")[1],
|
||||||
ranges: ArrayUtil.toRanges(value)
|
ranges: ArrayUtil.toRanges(value),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ async function main() {
|
||||||
`// Machine generated. Do not modify。\n` +
|
`// Machine generated. Do not modify。\n` +
|
||||||
`export default ` +
|
`export default ` +
|
||||||
JSON.stringify(out, null, "\t") +
|
JSON.stringify(out, null, "\t") +
|
||||||
";\n"
|
";\n",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,74 +171,74 @@ const LatinBase = {
|
||||||
All(
|
All(
|
||||||
Script("Latin"),
|
Script("Latin"),
|
||||||
Either(GeneralCategory("Uppercase_Letter"), GeneralCategory("Lowercase_Letter")),
|
Either(GeneralCategory("Uppercase_Letter"), GeneralCategory("Lowercase_Letter")),
|
||||||
Not(Block("Halfwidth_And_Fullwidth_Forms"))
|
Not(Block("Halfwidth_And_Fullwidth_Forms")),
|
||||||
),
|
),
|
||||||
Block("Currency_Symbols"),
|
Block("Currency_Symbols"),
|
||||||
All(Block("Letterlike_Symbols"), Not(In("℀℁⅍℠℡™℻")))
|
All(Block("Letterlike_Symbols"), Not(In("℀℁⅍℠℡™℻"))),
|
||||||
)
|
),
|
||||||
};
|
};
|
||||||
const CyrillicBase = {
|
const CyrillicBase = {
|
||||||
scriptTag: "cyrl",
|
scriptTag: "cyrl",
|
||||||
featureTag: "dflt",
|
featureTag: "dflt",
|
||||||
filter: All(
|
filter: All(
|
||||||
Script("Cyrillic"),
|
Script("Cyrillic"),
|
||||||
Either(GeneralCategory("Uppercase_Letter"), GeneralCategory("Lowercase_Letter"))
|
Either(GeneralCategory("Uppercase_Letter"), GeneralCategory("Lowercase_Letter")),
|
||||||
)
|
),
|
||||||
};
|
};
|
||||||
const GreekBase = {
|
const GreekBase = {
|
||||||
scriptTag: "grek",
|
scriptTag: "grek",
|
||||||
featureTag: "dflt",
|
featureTag: "dflt",
|
||||||
filter: All(
|
filter: All(
|
||||||
Script("Greek"),
|
Script("Greek"),
|
||||||
Either(GeneralCategory("Uppercase_Letter"), GeneralCategory("Lowercase_Letter"))
|
Either(GeneralCategory("Uppercase_Letter"), GeneralCategory("Lowercase_Letter")),
|
||||||
)
|
),
|
||||||
};
|
};
|
||||||
const DigitBase = {
|
const DigitBase = {
|
||||||
scriptTag: "latn",
|
scriptTag: "latn",
|
||||||
featureTag: "dflt",
|
featureTag: "dflt",
|
||||||
filter: Either(In("0123456789"))
|
filter: Either(In("0123456789")),
|
||||||
};
|
};
|
||||||
|
|
||||||
const LatinSubscript = {
|
const LatinSubscript = {
|
||||||
scriptTag: "latb",
|
scriptTag: "latb",
|
||||||
featureTag: "dflt",
|
featureTag: "dflt",
|
||||||
filter: Either(In("ₐₑₔₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓ"))
|
filter: Either(In("ₐₑₔₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓ")),
|
||||||
};
|
};
|
||||||
const GreekSubscript = {
|
const GreekSubscript = {
|
||||||
scriptTag: "latb",
|
scriptTag: "latb",
|
||||||
featureTag: "dflt",
|
featureTag: "dflt",
|
||||||
filter: Either(In("ᵦᵧᵨᵩᵪ"))
|
filter: Either(In("ᵦᵧᵨᵩᵪ")),
|
||||||
};
|
};
|
||||||
const CyrillicSubscript = {
|
const CyrillicSubscript = {
|
||||||
scriptTag: "latb",
|
scriptTag: "latb",
|
||||||
featureTag: "dflt",
|
featureTag: "dflt",
|
||||||
filter: Either(In("𞁑𞁒𞁓𞁔𞁧𞁕𞁖𞁗𞁘𞁩𞁙𞁨𞁚𞁛𞁜𞁝𞁞𞁟𞁠𞁡𞁢𞁣𞁪𞁤𞁥𞁦"))
|
filter: Either(In("𞁑𞁒𞁓𞁔𞁧𞁕𞁖𞁗𞁘𞁩𞁙𞁨𞁚𞁛𞁜𞁝𞁞𞁟𞁠𞁡𞁢𞁣𞁪𞁤𞁥𞁦")),
|
||||||
};
|
};
|
||||||
const DigitSubscript = {
|
const DigitSubscript = {
|
||||||
scriptTag: "latb",
|
scriptTag: "latb",
|
||||||
featureTag: "dflt",
|
featureTag: "dflt",
|
||||||
filter: Either(In("₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎"))
|
filter: Either(In("₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎")),
|
||||||
};
|
};
|
||||||
|
|
||||||
const LatinSuperscript = {
|
const LatinSuperscript = {
|
||||||
scriptTag: "latp",
|
scriptTag: "latp",
|
||||||
featureTag: "dflt",
|
featureTag: "dflt",
|
||||||
filter: Either(In("ªº"), All(Script("Latin"), Either(GeneralCategory("Modifier_Letter"))))
|
filter: Either(In("ªº"), All(Script("Latin"), Either(GeneralCategory("Modifier_Letter")))),
|
||||||
};
|
};
|
||||||
const GreekSuperscript = {
|
const GreekSuperscript = {
|
||||||
scriptTag: "latp",
|
scriptTag: "latp",
|
||||||
featureTag: "dflt",
|
featureTag: "dflt",
|
||||||
filter: All(Script("Greek"), Either(GeneralCategory("Modifier_Letter")))
|
filter: All(Script("Greek"), Either(GeneralCategory("Modifier_Letter"))),
|
||||||
};
|
};
|
||||||
const CyrillicSuperscript = {
|
const CyrillicSuperscript = {
|
||||||
scriptTag: "latp",
|
scriptTag: "latp",
|
||||||
featureTag: "dflt",
|
featureTag: "dflt",
|
||||||
filter: All(Script("Cyrillic"), Either(GeneralCategory("Modifier_Letter")))
|
filter: All(Script("Cyrillic"), Either(GeneralCategory("Modifier_Letter"))),
|
||||||
};
|
};
|
||||||
const DigitSuperscript = {
|
const DigitSuperscript = {
|
||||||
scriptTag: "latp",
|
scriptTag: "latp",
|
||||||
featureTag: "dflt",
|
featureTag: "dflt",
|
||||||
filter: Either(In("⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾"))
|
filter: Either(In("⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾")),
|
||||||
};
|
};
|
||||||
|
|
||||||
const LatinPunctuation = {
|
const LatinPunctuation = {
|
||||||
|
@ -248,8 +248,8 @@ const LatinPunctuation = {
|
||||||
Block("Basic_Latin"),
|
Block("Basic_Latin"),
|
||||||
Block("Latin_1_Supplement"),
|
Block("Latin_1_Supplement"),
|
||||||
Block("General_Punctuation"),
|
Block("General_Punctuation"),
|
||||||
Block("Supplemental_Punctuation")
|
Block("Supplemental_Punctuation"),
|
||||||
)
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
const Targets = [
|
const Targets = [
|
||||||
|
@ -265,5 +265,5 @@ const Targets = [
|
||||||
DigitBase,
|
DigitBase,
|
||||||
DigitSubscript,
|
DigitSubscript,
|
||||||
DigitSuperscript,
|
DigitSuperscript,
|
||||||
LatinPunctuation
|
LatinPunctuation,
|
||||||
];
|
];
|
||||||
|
|
|
@ -4,7 +4,7 @@ import fs from "fs";
|
||||||
|
|
||||||
const WebfontFormatMap = new Map([
|
const WebfontFormatMap = new Map([
|
||||||
["WOFF2", "woff2"],
|
["WOFF2", "woff2"],
|
||||||
["TTF", "truetype"]
|
["TTF", "truetype"],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export default function (output, family, hs, formats, unhinted) {
|
export default function (output, family, hs, formats, unhinted) {
|
||||||
|
@ -22,7 +22,7 @@ export default function (output, family, hs, formats, unhinted) {
|
||||||
.map(
|
.map(
|
||||||
ext =>
|
ext =>
|
||||||
`url('${ext}${dirSuffix}/${term.name}.${ext}') ` +
|
`url('${ext}${dirSuffix}/${term.name}.${ext}') ` +
|
||||||
`format('${WebfontFormatMap.get(ext)}')`
|
`format('${WebfontFormatMap.get(ext)}')`,
|
||||||
)
|
)
|
||||||
.join(", ");
|
.join(", ");
|
||||||
ans += `
|
ans += `
|
||||||
|
|
|
@ -19,7 +19,7 @@ setTimeout(
|
||||||
console.error(e);
|
console.error(e);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}),
|
}),
|
||||||
0
|
0,
|
||||||
);
|
);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
154
verdafile.mjs
154
verdafile.mjs
|
@ -89,11 +89,11 @@ const InstalledVersion = computed.make(
|
||||||
if (!semver.satisfies(depPkg.version, required)) {
|
if (!semver.satisfies(depPkg.version, required)) {
|
||||||
fail(
|
fail(
|
||||||
`Package version for ${pkg} is outdated:`,
|
`Package version for ${pkg} is outdated:`,
|
||||||
`Required ${required}, Installed ${depPkg.version}`
|
`Required ${required}, Installed ${depPkg.version}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return { name: pkg, actual: depPkg.version, required };
|
return { name: pkg, actual: depPkg.version, required };
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
@ -121,7 +121,7 @@ async function tryParseToml(str) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Failed to parse configuration file ${str}.\n` +
|
`Failed to parse configuration file ${str}.\n` +
|
||||||
`Please validate whether there's syntax error.\n` +
|
`Please validate whether there's syntax error.\n` +
|
||||||
`${e}`
|
`${e}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ function rectifyPlanForSpacingDerive(p) {
|
||||||
buildCharMap: false,
|
buildCharMap: false,
|
||||||
snapshotFamily: null,
|
snapshotFamily: null,
|
||||||
snapshotFeature: null,
|
snapshotFeature: null,
|
||||||
targets: null
|
targets: null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ const FontInfoOf = computed.group("metadata:font-info-of", async (target, fileNa
|
||||||
spacingDerive = {
|
spacingDerive = {
|
||||||
manner: bp.spacing,
|
manner: bp.spacing,
|
||||||
prefix: bp.spacingDeriveFrom,
|
prefix: bp.spacingDeriveFrom,
|
||||||
fileName: makeFileName(bp.spacingDeriveFrom, fi0.suffix)
|
fileName: makeFileName(bp.spacingDeriveFrom, fi0.suffix),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ const FontInfoOf = computed.group("metadata:font-info-of", async (target, fileNa
|
||||||
noCvSs: bp.noCvSs || false,
|
noCvSs: bp.noCvSs || false,
|
||||||
noLigation: bp.noLigation || false,
|
noLigation: bp.noLigation || false,
|
||||||
exportGlyphNames: bp.exportGlyphNames || false,
|
exportGlyphNames: bp.exportGlyphNames || false,
|
||||||
buildTextureFeature: bp.buildTextureFeature || false
|
buildTextureFeature: bp.buildTextureFeature || false,
|
||||||
},
|
},
|
||||||
// Ligations
|
// Ligations
|
||||||
ligations: bp.ligations || null,
|
ligations: bp.ligations || null,
|
||||||
|
@ -274,7 +274,7 @@ const FontInfoOf = computed.group("metadata:font-info-of", async (target, fileNa
|
||||||
weight: sfi.shapeWeight,
|
weight: sfi.shapeWeight,
|
||||||
width: sfi.shapeWidth,
|
width: sfi.shapeWidth,
|
||||||
slope: sfi.shapeSlope,
|
slope: sfi.shapeSlope,
|
||||||
slopeAngle: sfi.shapeSlopeAngle
|
slopeAngle: sfi.shapeSlopeAngle,
|
||||||
},
|
},
|
||||||
// Menu
|
// Menu
|
||||||
menu: {
|
menu: {
|
||||||
|
@ -282,13 +282,13 @@ const FontInfoOf = computed.group("metadata:font-info-of", async (target, fileNa
|
||||||
version: version,
|
version: version,
|
||||||
width: sfi.menuWidth,
|
width: sfi.menuWidth,
|
||||||
slope: sfi.menuSlope,
|
slope: sfi.menuSlope,
|
||||||
weight: sfi.menuWeight
|
weight: sfi.menuWeight,
|
||||||
},
|
},
|
||||||
// CSS
|
// CSS
|
||||||
css: {
|
css: {
|
||||||
weight: sfi.cssWeight,
|
weight: sfi.cssWeight,
|
||||||
stretch: sfi.cssStretch,
|
stretch: sfi.cssStretch,
|
||||||
style: sfi.cssStyle
|
style: sfi.cssStyle,
|
||||||
},
|
},
|
||||||
// Hinting
|
// Hinting
|
||||||
hintParams: bp.hintParams || [],
|
hintParams: bp.hintParams || [],
|
||||||
|
@ -303,7 +303,7 @@ const FontInfoOf = computed.group("metadata:font-info-of", async (target, fileNa
|
||||||
excludedCharRanges: bp.excludeChars?.ranges,
|
excludedCharRanges: bp.excludeChars?.ranges,
|
||||||
|
|
||||||
// Spacing derivation -- creating faster build for spacing variants
|
// Spacing derivation -- creating faster build for spacing variants
|
||||||
spacingDerive
|
spacingDerive,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -365,7 +365,7 @@ function getSuffixMappingItem(weights, w, slopes, s, widths, wd) {
|
||||||
shapeSlope: sValidate("Shape slope of " + s, slopeDef.shape, VlShapeSlope),
|
shapeSlope: sValidate("Shape slope of " + s, slopeDef.shape, VlShapeSlope),
|
||||||
shapeSlopeAngle: nValidate("Angle of " + s, slopeDef.angle, VlSlopeAngle),
|
shapeSlopeAngle: nValidate("Angle of " + s, slopeDef.angle, VlSlopeAngle),
|
||||||
cssStyle: sValidate("CSS style of " + s, slopeDef.css, VlCssStyle),
|
cssStyle: sValidate("CSS style of " + s, slopeDef.css, VlCssStyle),
|
||||||
menuSlope: sValidate("Menu slope of " + s, slopeDef.menu, VlShapeSlope)
|
menuSlope: sValidate("Menu slope of " + s, slopeDef.menu, VlShapeSlope),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,7 +409,7 @@ const DistUnhintedTTF = file.make(
|
||||||
const spD = fi.spacingDerive;
|
const spD = fi.spacingDerive;
|
||||||
const [deriveFrom] = await target.need(
|
const [deriveFrom] = await target.need(
|
||||||
DistUnhintedTTF(spD.prefix, spD.fileName),
|
DistUnhintedTTF(spD.prefix, spD.fileName),
|
||||||
de(charMapPath.dir)
|
de(charMapPath.dir),
|
||||||
);
|
);
|
||||||
|
|
||||||
echo.action(echo.hl.command(`Create TTF`), out.full);
|
echo.action(echo.hl.command(`Create TTF`), out.full);
|
||||||
|
@ -418,7 +418,7 @@ const DistUnhintedTTF = file.make(
|
||||||
o: out.full,
|
o: out.full,
|
||||||
paramsDir: Path.resolve("params"),
|
paramsDir: Path.resolve("params"),
|
||||||
oNoGc: noGcTtfPath.full,
|
oNoGc: noGcTtfPath.full,
|
||||||
...fi
|
...fi,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Ab-initio build
|
// Ab-initio build
|
||||||
|
@ -432,7 +432,7 @@ const DistUnhintedTTF = file.make(
|
||||||
CompositesFromBuildPlan,
|
CompositesFromBuildPlan,
|
||||||
de(charMapPath.dir),
|
de(charMapPath.dir),
|
||||||
de(ttfaControlsPath.dir),
|
de(ttfaControlsPath.dir),
|
||||||
de(SHARED_CACHE)
|
de(SHARED_CACHE),
|
||||||
);
|
);
|
||||||
|
|
||||||
echo.action(echo.hl.command(`Create TTF`), out.full);
|
echo.action(echo.hl.command(`Create TTF`), out.full);
|
||||||
|
@ -445,7 +445,7 @@ const DistUnhintedTTF = file.make(
|
||||||
iCache: cachePath,
|
iCache: cachePath,
|
||||||
oCache: cacheDiffPath,
|
oCache: cacheDiffPath,
|
||||||
compositesFromBuildPlan: comps,
|
compositesFromBuildPlan: comps,
|
||||||
...fi
|
...fi,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (cacheUpdated) {
|
if (cacheUpdated) {
|
||||||
|
@ -455,37 +455,37 @@ const DistUnhintedTTF = file.make(
|
||||||
base: cachePath,
|
base: cachePath,
|
||||||
diff: cacheDiffPath,
|
diff: cacheDiffPath,
|
||||||
version: fi.menu.version,
|
version: fi.menu.version,
|
||||||
freshAgeKey: ageKey
|
freshAgeKey: ageKey,
|
||||||
});
|
});
|
||||||
lock.release();
|
lock.release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const BuildCM = file.make(
|
const BuildCM = file.make(
|
||||||
(gr, f) => `${BUILD}/TTF/${gr}/${f}.charmap.mpz`,
|
(gr, f) => `${BUILD}/TTF/${gr}/${f}.charmap.mpz`,
|
||||||
async (target, output, gr, f) => {
|
async (target, output, gr, f) => {
|
||||||
await target.need(DistUnhintedTTF(gr, f));
|
await target.need(DistUnhintedTTF(gr, f));
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
const BuildTtfaControls = file.make(
|
const BuildTtfaControls = file.make(
|
||||||
(gr, f) => `${BUILD}/TTF/${gr}/${f}.ttfa.txt`,
|
(gr, f) => `${BUILD}/TTF/${gr}/${f}.ttfa.txt`,
|
||||||
async (target, output, gr, f) => {
|
async (target, output, gr, f) => {
|
||||||
await target.need(DistUnhintedTTF(gr, f));
|
await target.need(DistUnhintedTTF(gr, f));
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
const BuildNoGcUnhintedTtfImpl = file.make(
|
const BuildNoGcUnhintedTtfImpl = file.make(
|
||||||
(gr, f) => `${BUILD}/TTF/${gr}/${f}.no-gc.ttf`,
|
(gr, f) => `${BUILD}/TTF/${gr}/${f}.no-gc.ttf`,
|
||||||
async (target, output, gr, f) => {
|
async (target, output, gr, f) => {
|
||||||
await target.need(DistUnhintedTTF(gr, f));
|
await target.need(DistUnhintedTTF(gr, f));
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
const BuildNoGcTtfImpl = file.make(
|
const BuildNoGcTtfImpl = file.make(
|
||||||
(gr, f) => `${BUILD}/TTF/${gr}/${f}.no-gc.hinted.ttf`,
|
(gr, f) => `${BUILD}/TTF/${gr}/${f}.no-gc.hinted.ttf`,
|
||||||
async (target, output, gr, f) => {
|
async (target, output, gr, f) => {
|
||||||
await target.need(DistHintedTTF(gr, f));
|
await target.need(DistHintedTTF(gr, f));
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const DistHintedTTF = file.make(
|
const DistHintedTTF = file.make(
|
||||||
|
@ -494,7 +494,7 @@ const DistHintedTTF = file.make(
|
||||||
const [fi, hint] = await target.need(
|
const [fi, hint] = await target.need(
|
||||||
FontInfoOf(fn),
|
FontInfoOf(fn),
|
||||||
CheckTtfAutoHintExists,
|
CheckTtfAutoHintExists,
|
||||||
de`${out.dir}`
|
de`${out.dir}`,
|
||||||
);
|
);
|
||||||
if (fi.spacingDerive) {
|
if (fi.spacingDerive) {
|
||||||
// The font is a spacing variant, and is derivable form an existing
|
// The font is a spacing variant, and is derivable form an existing
|
||||||
|
@ -505,7 +505,7 @@ const DistHintedTTF = file.make(
|
||||||
|
|
||||||
const [deriveFrom] = await target.need(
|
const [deriveFrom] = await target.need(
|
||||||
DistHintedTTF(spD.prefix, spD.fileName),
|
DistHintedTTF(spD.prefix, spD.fileName),
|
||||||
de(noGcTtfPath.dir)
|
de(noGcTtfPath.dir),
|
||||||
);
|
);
|
||||||
|
|
||||||
echo.action(echo.hl.command(`Hint TTF`), out.full);
|
echo.action(echo.hl.command(`Hint TTF`), out.full);
|
||||||
|
@ -514,17 +514,17 @@ const DistHintedTTF = file.make(
|
||||||
oNoGc: noGcTtfPath.full,
|
oNoGc: noGcTtfPath.full,
|
||||||
o: out.full,
|
o: out.full,
|
||||||
paramsDir: Path.resolve("params"),
|
paramsDir: Path.resolve("params"),
|
||||||
...fi
|
...fi,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const [from, ttfaControls] = await target.need(
|
const [from, ttfaControls] = await target.need(
|
||||||
DistUnhintedTTF(gr, fn),
|
DistUnhintedTTF(gr, fn),
|
||||||
BuildTtfaControls(gr, fn)
|
BuildTtfaControls(gr, fn),
|
||||||
);
|
);
|
||||||
echo.action(echo.hl.command(`Hint TTF`), out.full, echo.hl.operator("<-"), from.full);
|
echo.action(echo.hl.command(`Hint TTF`), out.full, echo.hl.operator("<-"), from.full);
|
||||||
await silently.run(hint, fi.hintParams, "-m", ttfaControls.full, from.full, out.full);
|
await silently.run(hint, fi.hintParams, "-m", ttfaControls.full, from.full, out.full);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const BuildNoGcTtf = task.make(
|
const BuildNoGcTtf = task.make(
|
||||||
|
@ -538,7 +538,7 @@ const BuildNoGcTtf = task.make(
|
||||||
const [distUnhinted] = await target.need(DistHintedTTF(gr, fn));
|
const [distUnhinted] = await target.need(DistHintedTTF(gr, fn));
|
||||||
return distUnhinted;
|
return distUnhinted;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
function formatSuffix(fmt, unhinted) {
|
function formatSuffix(fmt, unhinted) {
|
||||||
|
@ -552,7 +552,7 @@ const DistWoff2 = file.make(
|
||||||
const [from] = await target.need(Ctor(group, f), de`${out.dir}`);
|
const [from] = await target.need(Ctor(group, f), de`${out.dir}`);
|
||||||
echo.action(echo.hl.command("Create WOFF2"), out.full, echo.hl.operator("<-"), from.full);
|
echo.action(echo.hl.command("Create WOFF2"), out.full, echo.hl.operator("<-"), from.full);
|
||||||
await silently.node(`tools/misc/src/ttf-to-woff2.mjs`, from.full, out.full);
|
await silently.node(`tools/misc/src/ttf-to-woff2.mjs`, from.full, out.full);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
@ -596,7 +596,7 @@ const DistWebFontCSS = file.make(
|
||||||
const [plan] = await target.need(BuildPlanOf(gr));
|
const [plan] = await target.need(BuildPlanOf(gr));
|
||||||
await target.need(de(out.dir));
|
await target.need(de(out.dir));
|
||||||
await createWebFontCssImpl(target, out.full, gr, plan.webfontFormats, unhinted);
|
await createWebFontCssImpl(target, out.full, gr, plan.webfontFormats, unhinted);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
async function createWebFontCssImpl(target, output, gr, formats, unhinted) {
|
async function createWebFontCssImpl(target, output, gr, formats, unhinted) {
|
||||||
const [bp, ts] = await target.need(BuildPlanOf(gr), GroupFontsOf(gr));
|
const [bp, ts] = await target.need(BuildPlanOf(gr), GroupFontsOf(gr));
|
||||||
|
@ -608,7 +608,7 @@ async function createWebFontCssImpl(target, output, gr, formats, unhinted) {
|
||||||
bp.family,
|
bp.family,
|
||||||
hs,
|
hs,
|
||||||
formats,
|
formats,
|
||||||
unhinted
|
unhinted,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -620,7 +620,7 @@ const GroupTtfsImpl = task.make(
|
||||||
const [ts] = await target.need(GroupFontsOf(gr));
|
const [ts] = await target.need(GroupFontsOf(gr));
|
||||||
await target.need(ts.map(tn => Ctor(gr, tn)));
|
await target.need(ts.map(tn => Ctor(gr, tn)));
|
||||||
return gr;
|
return gr;
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
const GroupWoff2Impl = task.make(
|
const GroupWoff2Impl = task.make(
|
||||||
(gr, unhinted) => `group-${formatSuffix("WOFF2Impl", unhinted)}::${gr}`,
|
(gr, unhinted) => `group-${formatSuffix("WOFF2Impl", unhinted)}::${gr}`,
|
||||||
|
@ -628,7 +628,7 @@ const GroupWoff2Impl = task.make(
|
||||||
const [ts] = await target.need(GroupFontsOf(gr));
|
const [ts] = await target.need(GroupFontsOf(gr));
|
||||||
await target.need(ts.map(tn => DistWoff2(gr, tn, unhinted)));
|
await target.need(ts.map(tn => DistWoff2(gr, tn, unhinted)));
|
||||||
return gr;
|
return gr;
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
const GroupWebFontsImpl = task.make(
|
const GroupWebFontsImpl = task.make(
|
||||||
(gr, unhinted) => `group-${formatSuffix("WebFontImpl", unhinted)}::${gr}`,
|
(gr, unhinted) => `group-${formatSuffix("WebFontImpl", unhinted)}::${gr}`,
|
||||||
|
@ -647,7 +647,7 @@ const GroupWebFontsImpl = task.make(
|
||||||
}
|
}
|
||||||
await target.need(groupsNeeded, DistWebFontCSS(gr, unhinted));
|
await target.need(groupsNeeded, DistWebFontCSS(gr, unhinted));
|
||||||
return gr;
|
return gr;
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
@ -708,7 +708,7 @@ async function getCollectPlans(target, rawCollectPlans) {
|
||||||
ttcComposition,
|
ttcComposition,
|
||||||
groupDecomposition: [...collect.from],
|
groupDecomposition: [...collect.from],
|
||||||
inRelease: !!collect.release,
|
inRelease: !!collect.release,
|
||||||
isAmended: !!collect.isAmended
|
isAmended: !!collect.isAmended,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return plans;
|
return plans;
|
||||||
|
@ -736,7 +736,7 @@ function fnStandardTtc(fIsGlyfTtc, prefix, suffixMapping, sfi) {
|
||||||
optimalSfi.weight,
|
optimalSfi.weight,
|
||||||
optimalSfi.width,
|
optimalSfi.width,
|
||||||
optimalSfi.slope,
|
optimalSfi.slope,
|
||||||
DEFAULT_SUBFAMILY
|
DEFAULT_SUBFAMILY,
|
||||||
)}`;
|
)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -760,7 +760,7 @@ const CollectedSuperTtcFile = file.make(
|
||||||
const parts = Array.from(Object.keys(cp[cgr].glyfTtcComposition));
|
const parts = Array.from(Object.keys(cp[cgr].glyfTtcComposition));
|
||||||
const [inputs] = await target.need(parts.map(pt => GlyfTtc(cgr, pt)));
|
const [inputs] = await target.need(parts.map(pt => GlyfTtc(cgr, pt)));
|
||||||
await buildCompositeTtc(out, inputs);
|
await buildCompositeTtc(out, inputs);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
const CollectedTtcFile = file.make(
|
const CollectedTtcFile = file.make(
|
||||||
(cgr, f) => `${DIST_TTC}/${cgr}/${f}.ttc`,
|
(cgr, f) => `${DIST_TTC}/${cgr}/${f}.ttc`,
|
||||||
|
@ -769,7 +769,7 @@ const CollectedTtcFile = file.make(
|
||||||
const parts = Array.from(new Set(cp[cgr].ttcComposition[f]));
|
const parts = Array.from(new Set(cp[cgr].ttcComposition[f]));
|
||||||
const [inputs] = await target.need(parts.map(pt => GlyfTtc(cgr, pt)));
|
const [inputs] = await target.need(parts.map(pt => GlyfTtc(cgr, pt)));
|
||||||
await buildCompositeTtc(out, inputs);
|
await buildCompositeTtc(out, inputs);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
const GlyfTtc = file.make(
|
const GlyfTtc = file.make(
|
||||||
(cgr, f) => `${GLYF_TTC}/${cgr}/${f}.ttc`,
|
(cgr, f) => `${GLYF_TTC}/${cgr}/${f}.ttc`,
|
||||||
|
@ -777,7 +777,7 @@ const GlyfTtc = file.make(
|
||||||
const [cp] = await target.need(CollectPlans);
|
const [cp] = await target.need(CollectPlans);
|
||||||
const parts = cp[cgr].glyfTtcComposition[f];
|
const parts = cp[cgr].glyfTtcComposition[f];
|
||||||
await buildGlyphSharingTtc(target, parts, out);
|
await buildGlyphSharingTtc(target, parts, out);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
async function buildCompositeTtc(out, inputs) {
|
async function buildCompositeTtc(out, inputs) {
|
||||||
|
@ -806,14 +806,14 @@ const TtcZip = file.make(
|
||||||
const ttcFiles = Array.from(Object.keys(cPlan[cgr].ttcComposition));
|
const ttcFiles = Array.from(Object.keys(cPlan[cgr].ttcComposition));
|
||||||
await target.need(ttcFiles.map(pt => CollectedTtcFile(cgr, pt)));
|
await target.need(ttcFiles.map(pt => CollectedTtcFile(cgr, pt)));
|
||||||
await CreateGroupArchiveFile(`${DIST_TTC}/${cgr}`, out, `*.ttc`);
|
await CreateGroupArchiveFile(`${DIST_TTC}/${cgr}`, out, `*.ttc`);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
const SuperTtcZip = file.make(
|
const SuperTtcZip = file.make(
|
||||||
(cgr, version) => `${ARCHIVE_DIR}/SuperTTC-${cgr}-${version}.zip`,
|
(cgr, version) => `${ARCHIVE_DIR}/SuperTTC-${cgr}-${version}.zip`,
|
||||||
async (target, out, cgr) => {
|
async (target, out, cgr) => {
|
||||||
await target.need(de`${out.dir}`, CollectedSuperTtcFile(cgr));
|
await target.need(de`${out.dir}`, CollectedSuperTtcFile(cgr));
|
||||||
await CreateGroupArchiveFile(DIST_SUPER_TTC, out, `${cgr}.ttc`);
|
await CreateGroupArchiveFile(DIST_SUPER_TTC, out, `${cgr}.ttc`);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// Single-group Archives
|
// Single-group Archives
|
||||||
|
@ -826,9 +826,9 @@ const GroupTtfZip = file.make(
|
||||||
await CreateGroupArchiveFile(
|
await CreateGroupArchiveFile(
|
||||||
`${DIST}/${gr}/${formatSuffix("TTF", unhinted)}`,
|
`${DIST}/${gr}/${formatSuffix("TTF", unhinted)}`,
|
||||||
out,
|
out,
|
||||||
"*.ttf"
|
"*.ttf",
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
const GroupWebZip = file.make(
|
const GroupWebZip = file.make(
|
||||||
(gr, version, unhinted) =>
|
(gr, version, unhinted) =>
|
||||||
|
@ -841,9 +841,9 @@ const GroupWebZip = file.make(
|
||||||
`${DIST}/${gr}`,
|
`${DIST}/${gr}`,
|
||||||
out,
|
out,
|
||||||
`${formatSuffix(gr, unhinted)}.css`,
|
`${formatSuffix(gr, unhinted)}.css`,
|
||||||
...plan.webfontFormats.map(format => formatSuffix(format, unhinted))
|
...plan.webfontFormats.map(format => formatSuffix(format, unhinted)),
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
async function CreateGroupArchiveFile(dir, out, ...files) {
|
async function CreateGroupArchiveFile(dir, out, ...files) {
|
||||||
|
@ -854,7 +854,7 @@ async function CreateGroupArchiveFile(dir, out, ...files) {
|
||||||
[SEVEN_ZIP, "a"],
|
[SEVEN_ZIP, "a"],
|
||||||
["-tzip", "-r", "-mx=9", "-mmt=off"],
|
["-tzip", "-r", "-mx=9", "-mmt=off"],
|
||||||
relOut,
|
relOut,
|
||||||
...files
|
...files,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -875,7 +875,7 @@ const Pages = task(`pages`, async t => {
|
||||||
PagesFontExport`IosevkaQp`,
|
PagesFontExport`IosevkaQp`,
|
||||||
PagesFontExport`IosevkaQpSlab`,
|
PagesFontExport`IosevkaQpSlab`,
|
||||||
PagesFontExport`IosevkaQpe`,
|
PagesFontExport`IosevkaQpe`,
|
||||||
PagesFontExport`IosevkaQpeSlab`
|
PagesFontExport`IosevkaQpeSlab`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -891,10 +891,10 @@ const PagesDataExport = task(`pages:data-export`, async t => {
|
||||||
const [cm, cmi, cmo] = await t.need(
|
const [cm, cmi, cmo] = await t.need(
|
||||||
BuildCM("Iosevka", "Iosevka-Regular"),
|
BuildCM("Iosevka", "Iosevka-Regular"),
|
||||||
BuildCM("Iosevka", "Iosevka-Italic"),
|
BuildCM("Iosevka", "Iosevka-Italic"),
|
||||||
BuildCM("Iosevka", "Iosevka-Oblique")
|
BuildCM("Iosevka", "Iosevka-Oblique"),
|
||||||
);
|
);
|
||||||
await node(`tools/generate-samples/src/tokenized-sample-code.mjs`, {
|
await node(`tools/generate-samples/src/tokenized-sample-code.mjs`, {
|
||||||
output: Path.resolve(pagesDir, "shared/tokenized-sample-code/alphabet.txt.json")
|
output: Path.resolve(pagesDir, "shared/tokenized-sample-code/alphabet.txt.json"),
|
||||||
});
|
});
|
||||||
await node(`tools/data-export/src/index.mjs`, {
|
await node(`tools/data-export/src/index.mjs`, {
|
||||||
version,
|
version,
|
||||||
|
@ -903,7 +903,7 @@ const PagesDataExport = task(`pages:data-export`, async t => {
|
||||||
charMapItalicPath: cmi.full,
|
charMapItalicPath: cmi.full,
|
||||||
charMapObliquePath: cmo.full,
|
charMapObliquePath: cmo.full,
|
||||||
exportPathMeta: Path.resolve(pagesDir, "shared/data-import/raw/metadata.json"),
|
exportPathMeta: Path.resolve(pagesDir, "shared/data-import/raw/metadata.json"),
|
||||||
exportPathCov: Path.resolve(pagesDir, "shared/data-import/raw/coverage.json")
|
exportPathCov: Path.resolve(pagesDir, "shared/data-import/raw/coverage.json"),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -947,7 +947,7 @@ const AmendReadme = task("amend-readme", async target => {
|
||||||
AmendReadmeFor("doc/language-specific-ligation-sets.md"),
|
AmendReadmeFor("doc/language-specific-ligation-sets.md"),
|
||||||
AmendReadmeFor("doc/cv-influences.md"),
|
AmendReadmeFor("doc/cv-influences.md"),
|
||||||
AmendReadmeFor("doc/PACKAGE-LIST.md"),
|
AmendReadmeFor("doc/PACKAGE-LIST.md"),
|
||||||
AmendLicenseYear
|
AmendLicenseYear,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
const AmendReadmeFor = task.make(
|
const AmendReadmeFor = task.make(
|
||||||
|
@ -958,7 +958,7 @@ const AmendReadmeFor = task.make(
|
||||||
const [cm, cmi, cmo] = await target.need(
|
const [cm, cmi, cmo] = await target.need(
|
||||||
BuildCM("Iosevka", "Iosevka-Regular"),
|
BuildCM("Iosevka", "Iosevka-Regular"),
|
||||||
BuildCM("Iosevka", "Iosevka-Italic"),
|
BuildCM("Iosevka", "Iosevka-Italic"),
|
||||||
BuildCM("Iosevka", "Iosevka-Oblique")
|
BuildCM("Iosevka", "Iosevka-Oblique"),
|
||||||
);
|
);
|
||||||
return node(`tools/amend-readme/src/index.mjs`, {
|
return node(`tools/amend-readme/src/index.mjs`, {
|
||||||
version,
|
version,
|
||||||
|
@ -968,9 +968,9 @@ const AmendReadmeFor = task.make(
|
||||||
releasePackagesJsonPath: rpFiles.full,
|
releasePackagesJsonPath: rpFiles.full,
|
||||||
charMapPath: cm.full,
|
charMapPath: cm.full,
|
||||||
charMapItalicPath: cmi.full,
|
charMapItalicPath: cmi.full,
|
||||||
charMapObliquePath: cmo.full
|
charMapObliquePath: cmo.full,
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
const ReleaseNotePackagesFile = file(`${BUILD}/release-packages.json`, async (t, out) => {
|
const ReleaseNotePackagesFile = file(`${BUILD}/release-packages.json`, async (t, out) => {
|
||||||
const [cp] = await t.need(CollectPlans);
|
const [cp] = await t.need(CollectPlans);
|
||||||
|
@ -985,20 +985,20 @@ const ReleaseNotePackagesFile = file(`${BUILD}/release-packages.json`, async (t,
|
||||||
subGroups[gr] = {
|
subGroups[gr] = {
|
||||||
family: bp.family,
|
family: bp.family,
|
||||||
desc: bp.desc,
|
desc: bp.desc,
|
||||||
spacing: buildPlans[gr].spacing || "type"
|
spacing: buildPlans[gr].spacing || "type",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
releaseNoteGroups[k] = {
|
releaseNoteGroups[k] = {
|
||||||
subGroups,
|
subGroups,
|
||||||
slab: primePlan.serifs === "slab",
|
slab: primePlan.serifs === "slab",
|
||||||
quasiProportional: primePlan.spacing === "quasi-proportional"
|
quasiProportional: primePlan.spacing === "quasi-proportional",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
await FS.promises.writeFile(out.full, JSON.stringify(releaseNoteGroups, null, " "));
|
await FS.promises.writeFile(out.full, JSON.stringify(releaseNoteGroups, null, " "));
|
||||||
});
|
});
|
||||||
const AmendLicenseYear = task("amend-readme:license-year", async target => {
|
const AmendLicenseYear = task("amend-readme:license-year", async target => {
|
||||||
return node(`tools/amend-readme/src/license-year.mjs`, {
|
return node(`tools/amend-readme/src/license-year.mjs`, {
|
||||||
path: "LICENSE.md"
|
path: "LICENSE.md",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1018,12 +1018,12 @@ const SampleImagesPre = task(`sample-images:pre`, async target => {
|
||||||
GroupTtfsImpl(`Iosevka`, false),
|
GroupTtfsImpl(`Iosevka`, false),
|
||||||
GroupTtfsImpl(`IosevkaSlab`, false),
|
GroupTtfsImpl(`IosevkaSlab`, false),
|
||||||
GroupTtfsImpl(`IosevkaAile`, false),
|
GroupTtfsImpl(`IosevkaAile`, false),
|
||||||
GroupTtfsImpl(`IosevkaEtoile`, false)
|
GroupTtfsImpl(`IosevkaEtoile`, false),
|
||||||
);
|
);
|
||||||
const [cm, cmi, cmo] = await target.need(
|
const [cm, cmi, cmo] = await target.need(
|
||||||
BuildCM("Iosevka", "Iosevka-Regular"),
|
BuildCM("Iosevka", "Iosevka-Regular"),
|
||||||
BuildCM("Iosevka", "Iosevka-Italic"),
|
BuildCM("Iosevka", "Iosevka-Italic"),
|
||||||
BuildCM("Iosevka", "Iosevka-Oblique")
|
BuildCM("Iosevka", "Iosevka-Oblique"),
|
||||||
);
|
);
|
||||||
return await node("tools/generate-samples/src/index.mjs", {
|
return await node("tools/generate-samples/src/index.mjs", {
|
||||||
version,
|
version,
|
||||||
|
@ -1033,7 +1033,7 @@ const SampleImagesPre = task(`sample-images:pre`, async target => {
|
||||||
fontGroups: fontGroups,
|
fontGroups: fontGroups,
|
||||||
charMapPath: cm.full,
|
charMapPath: cm.full,
|
||||||
charMapItalicPath: cmi.full,
|
charMapItalicPath: cmi.full,
|
||||||
charMapObliquePath: cmo.full
|
charMapObliquePath: cmo.full,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
const PackageSnapshotConfig = async target => {
|
const PackageSnapshotConfig = async target => {
|
||||||
|
@ -1045,7 +1045,7 @@ const PackageSnapshotConfig = async target => {
|
||||||
cfg.push({
|
cfg.push({
|
||||||
name: "package-sample-" + key,
|
name: "package-sample-" + key,
|
||||||
fontFamily: p.snapshotFamily,
|
fontFamily: p.snapshotFamily,
|
||||||
fontFeatures: p.snapshotFeature
|
fontFeatures: p.snapshotFeature,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return cfg;
|
return cfg;
|
||||||
|
@ -1059,9 +1059,9 @@ const ScreenShotImpl = file.make(
|
||||||
await run(rp.buildOptions.snapshotGeneratorApp, [
|
await run(rp.buildOptions.snapshotGeneratorApp, [
|
||||||
`${IMAGE_TASKS}/${id}.json`,
|
`${IMAGE_TASKS}/${id}.json`,
|
||||||
"-o",
|
"-o",
|
||||||
out.full
|
out.full,
|
||||||
]);
|
]);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
@ -1079,9 +1079,9 @@ const ReleaseNotesFile = file.make(
|
||||||
await t.need(changeFiles.map(fu));
|
await t.need(changeFiles.map(fu));
|
||||||
await node("tools/amend-readme/src/generate-release-note.mjs", {
|
await node("tools/amend-readme/src/generate-release-note.mjs", {
|
||||||
version,
|
version,
|
||||||
outputPath: out.full
|
outputPath: out.full,
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const ChangeLog = task(`release:change-log`, async t => {
|
const ChangeLog = task(`release:change-log`, async t => {
|
||||||
|
@ -1096,7 +1096,7 @@ const ChangeLogMd = file(`CHANGELOG.md`, async (t, out) => {
|
||||||
});
|
});
|
||||||
const ChangeFileList = oracle.make(
|
const ChangeFileList = oracle.make(
|
||||||
() => `release:change-file-list`,
|
() => `release:change-file-list`,
|
||||||
target => FileList({ under: "changes", pattern: "*.md" })(target)
|
target => FileList({ under: "changes", pattern: "*.md" })(target),
|
||||||
);
|
);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
@ -1145,11 +1145,11 @@ const ReleaseArchives = task(`release:archives`, async target => {
|
||||||
|
|
||||||
const MARCOS = [
|
const MARCOS = [
|
||||||
fu`packages/font-glyphs/src/meta/macros.ptl`,
|
fu`packages/font-glyphs/src/meta/macros.ptl`,
|
||||||
fu`packages/font-otl/src/meta/macros.ptl`
|
fu`packages/font-otl/src/meta/macros.ptl`,
|
||||||
];
|
];
|
||||||
const ScriptsUnder = oracle.make(
|
const ScriptsUnder = oracle.make(
|
||||||
(ext, dir) => `${ext}-scripts-under::${dir}`,
|
(ext, dir) => `${ext}-scripts-under::${dir}`,
|
||||||
(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 [mjs, md] = await target.need(ScriptsUnder("mjs", "tools"), ScriptsUnder("md", "tools"));
|
const [mjs, md] = await target.need(ScriptsUnder("mjs", "tools"), ScriptsUnder("md", "tools"));
|
||||||
|
@ -1175,7 +1175,7 @@ const CompiledJs = file.make(
|
||||||
await target.need(sfu(ptl));
|
await target.need(sfu(ptl));
|
||||||
echo.action(echo.hl.command("Compile Script"), ptl);
|
echo.action(echo.hl.command("Compile Script"), ptl);
|
||||||
await silently.run(PATEL_C, "--strict", "--esm", ptl, "-o", out.full);
|
await silently.run(PATEL_C, "--strict", "--esm", ptl, "-o", out.full);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
const Scripts = task("scripts", async target => {
|
const Scripts = task("scripts", async target => {
|
||||||
const [jsFromPtlList] = await target.need(JavaScriptFromPtl);
|
const [jsFromPtlList] = await target.need(JavaScriptFromPtl);
|
||||||
|
@ -1201,7 +1201,7 @@ const Parameters = task(`meta:parameters`, async target => {
|
||||||
sfu`params/shape-slope.toml`,
|
sfu`params/shape-slope.toml`,
|
||||||
ofu`params/private-parameters.toml`,
|
ofu`params/private-parameters.toml`,
|
||||||
sfu`params/variants.toml`,
|
sfu`params/variants.toml`,
|
||||||
sfu`params/ligation-set.toml`
|
sfu`params/ligation-set.toml`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1226,7 +1226,7 @@ function failWithLegacyParamName(prefix, bp, legacy, expected) {
|
||||||
if (bp[legacy]) {
|
if (bp[legacy]) {
|
||||||
fail(
|
fail(
|
||||||
`Build plan for '${prefix}' contains legacy build parameter '${legacy}'. ` +
|
`Build plan for '${prefix}' contains legacy build parameter '${legacy}'. ` +
|
||||||
`Please use '${expected}' instead.`
|
`Please use '${expected}' instead.`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1238,7 +1238,7 @@ function resolveWws(bpName, buildPlans, defaultConfig) {
|
||||||
if (!bp.slopes && bp.slants) {
|
if (!bp.slopes && bp.slants) {
|
||||||
fail(
|
fail(
|
||||||
`Build plan for ${bpName} uses legacy "slants" to define slopes. ` +
|
`Build plan for ${bpName} uses legacy "slants" to define slopes. ` +
|
||||||
`Use "slopes" instead.`
|
`Use "slopes" instead.`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1265,7 +1265,7 @@ function resolveWwsAspect(aspectName, bpName, buildPlans, defaultConfig, deps) {
|
||||||
inheritedPlanName,
|
inheritedPlanName,
|
||||||
buildPlans,
|
buildPlans,
|
||||||
defaultConfig,
|
defaultConfig,
|
||||||
updatedDes
|
updatedDes,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return defaultConfig[aspectName];
|
return defaultConfig[aspectName];
|
||||||
|
@ -1306,12 +1306,12 @@ function validateRecommendedWeight(w, value, label) {
|
||||||
semibold: 600,
|
semibold: 600,
|
||||||
bold: 700,
|
bold: 700,
|
||||||
extrabold: 800,
|
extrabold: 800,
|
||||||
heavy: 900
|
heavy: 900,
|
||||||
};
|
};
|
||||||
if (RecommendedMenuWeights[w] && RecommendedMenuWeights[w] !== value) {
|
if (RecommendedMenuWeights[w] && RecommendedMenuWeights[w] !== value) {
|
||||||
echo.warn(
|
echo.warn(
|
||||||
`${label} weight settings of ${w} ( = ${value}) doesn't match ` +
|
`${label} weight settings of ${w} ( = ${value}) doesn't match ` +
|
||||||
`the recommended value ( = ${RecommendedMenuWeights[w]}).`
|
`the recommended value ( = ${RecommendedMenuWeights[w]}).`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1345,14 +1345,14 @@ const VlShapeWidth = {
|
||||||
const xCorrected = Math.round(500 * Math.pow(Math.sqrt(600 / 500), x - 5));
|
const xCorrected = Math.round(500 * Math.pow(Math.sqrt(600 / 500), x - 5));
|
||||||
echo.warn(
|
echo.warn(
|
||||||
`The build plan is using legacy width grade ${x}. ` +
|
`The build plan is using legacy width grade ${x}. ` +
|
||||||
`Converting to unit width ${xCorrected}.`
|
`Converting to unit width ${xCorrected}.`,
|
||||||
);
|
);
|
||||||
g_widthFixupMemory.set(x, xCorrected);
|
g_widthFixupMemory.set(x, xCorrected);
|
||||||
return xCorrected;
|
return xCorrected;
|
||||||
} else {
|
} else {
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
const VlMenuWidth = { validate: x => x >= 1 && x <= 9 && x % 1 === 0 };
|
const VlMenuWidth = { validate: x => x >= 1 && x <= 9 && x % 1 === 0 };
|
||||||
const VlSlopeAngle = { validate: x => x >= 0 && x <= 15 };
|
const VlSlopeAngle = { validate: x => x >= 0 && x <= 15 };
|
||||||
|
@ -1376,7 +1376,7 @@ const VlCssFontStretch = {
|
||||||
x == "semi-expanded" ||
|
x == "semi-expanded" ||
|
||||||
x == "expanded" ||
|
x == "expanded" ||
|
||||||
x == "extra-expanded" ||
|
x == "extra-expanded" ||
|
||||||
x == "ultra-expanded"
|
x == "ultra-expanded",
|
||||||
};
|
};
|
||||||
|
|
||||||
// Utilities
|
// Utilities
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue