format and fix certain build breaks

This commit is contained in:
be5invis 2024-03-04 17:09:15 -08:00
parent 12a3b8c244
commit d5661093ff
65 changed files with 553 additions and 862 deletions

View file

@ -13,7 +13,7 @@
"sourceType": "module"
},
"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": {
"semi": ["error", "always"],
"no-var": "error",

View file

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

View file

@ -53,7 +53,7 @@ glyph-block Symbol-Geometric-Sun-And-Gear : for-width-kinds WideWidth1
set-width Geom.Width
include : refer-glyph : MangleName 'gearWithoutHub'
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
set-width Geom.Width

View file

@ -22,8 +22,8 @@ class BooleImpl {
return glyph.includeGeometry(
new TransformedGeometry(
new BooleanGeometry(this.operator, operandGeometries),
forwardGizmo
)
forwardGizmo,
),
);
}
}
@ -37,6 +37,6 @@ export function SetupBuilders(bindings) {
return {
union: union,
intersection: intersection,
difference: difference
difference: difference,
};
}

View file

@ -3,7 +3,7 @@ import {
BiKnotCollector,
UserControlKnot,
Interpolator,
TerminateInstruction
TerminateInstruction,
} from "@iosevka/geometry/spiro-control";
import { bez3, fallback, mix } from "@iosevka/util";
@ -47,8 +47,8 @@ class SpiroOutlineImpl extends SpiroImplBase {
new SpiroGeometry(
gizmo,
collector.closed,
collector.controls.map(k => k.toMono())
)
collector.controls.map(k => k.toMono()),
),
);
}
}
@ -58,7 +58,7 @@ class DiSpiroProxy {
gizmo,
collector.contrast,
collector.closed,
collector.controls
collector.controls,
);
this.m_origKnots = collector.controls;
}
@ -95,18 +95,18 @@ export function SetupBuilders(bindings) {
{ name: "up", x: 0, y: 1 },
{ name: "down", x: 0, y: -1 },
{ name: "left", x: -1, y: 0 },
{ name: "right", x: 1, y: 0 }
{ name: "right", x: 1, y: 0 },
];
let adhesions = [
{ name: "start", l: 0, r: 0.01 },
{ name: "mid", l: -0.005, r: 0.005 },
{ name: "end", l: -0.01, r: 0 }
{ name: "end", l: -0.01, r: 0 },
];
let knotTypes = [
[g4, g4, g4],
[g2, g2, g2],
[corner, corner, corner],
[straight, flat, curl]
[straight, flat, curl],
];
for (const [sink, kl, kr] of knotTypes) {
for (const d of directions) {
@ -114,7 +114,7 @@ export function SetupBuilders(bindings) {
for (const a of adhesions) {
sink[d.name][a.name] = (x, y, 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].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(
mix(before.x, after.x, args.rx),
mix(before.y, after.y, args.ry),
fallback(args.raf, unimportant)
fallback(args.raf, unimportant),
);
}
function afInterpolateDelta(before, after, args) {
return g4(
mix(before.x, after.x, args.rx) + args.deltaX,
mix(before.y, after.y, args.ry) + args.deltaY,
fallback(args.raf, unimportant)
fallback(args.raf, unimportant),
);
}
function afInterpolateG2(before, after, args) {
return g2(
mix(before.x, after.x, args.rx),
mix(before.y, after.y, args.ry),
fallback(args.raf, unimportant)
fallback(args.raf, unimportant),
);
}
function afInterpolateThem(before, after, args) {
@ -238,8 +238,8 @@ export function SetupBuilders(bindings) {
? args.raf.blend(rt)
: args.raf
? args.raf
: unimportant
)
: unimportant,
),
);
}
return innerKnots;
@ -255,8 +255,8 @@ export function SetupBuilders(bindings) {
? args.raf.blend(rt)
: args.raf
? args.raf
: unimportant
)
: unimportant,
),
);
}
return innerKnots;
@ -268,8 +268,8 @@ export function SetupBuilders(bindings) {
fallback(args.ty, g2)(
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),
args.raf.modifier(rt)
)
args.raf.modifier(rt),
),
);
}
return innerKnots;
@ -300,7 +300,7 @@ export function SetupBuilders(bindings) {
rs.push([
bez3(0, x1, x2, 1, j / samples),
bez3(0, y1, y2, 1, j / samples),
j / samples
j / samples,
]);
return alsoThruThem(rs, raf);
}
@ -314,7 +314,7 @@ export function SetupBuilders(bindings) {
mix(1, x1, 2 / 3),
mix(1, y1, 2 / 3),
fallback(_samples, 3),
raf
raf,
);
}
@ -432,6 +432,6 @@ export function SetupBuilders(bindings) {
arcvh,
dispiro,
"spiro-outline": spiroOutline,
CursiveBuilder
CursiveBuilder,
};
}

View file

@ -3,8 +3,7 @@ export : define [createGsubLookupFromGr gsub glyphStore gr] : begin
foreach { gnSrc glyph } [glyphStore.namedEntries] : begin
local gnDst : gr.get glyph
local glyphDst : glyphStore.queryByName gnDst
if (glyphDst && ([glyphStore.queryUnicodeOf glyph] || [glyphStore.queryUnicodeOf glyphDst]))
set mapping.(gnSrc) gnDst
if glyphDst : set mapping.(gnSrc) gnDst
return : gsub.createLookup {.type 'gsub_single' .substitutions mapping}

View file

@ -36,6 +36,7 @@ async function main(argv) {
case "fontconfig-mono":
case "fixed":
CliProc.gcFont(font, Ot.ListGlyphStoreFactory);
validateFontConfigMono(font);
await saveTTF(argv.o, font);
break;
default:
@ -68,18 +69,24 @@ async function deriveTerm(font) {
}
}
// 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.
// Drop the following "long" characters.
async function deriveFixed_DropWideChars(font) {
const unitWidth = font.os2.xAvgCharWidth;
for (const [ch, g] of [...font.cmap.unicode.entries()]) {
const advanceWidth = g.horizontal.end - g.horizontal.start;
if (!(advanceWidth === 0 || advanceWidth === unitWidth)) font.cmap.unicode.delete(ch);
}
for (const [ch, vs, g] of [...font.cmap.vs.entries()]) {
const advanceWidth = g.horizontal.end - g.horizontal.start;
if (!(advanceWidth === 0 || advanceWidth === unitWidth)) font.cmap.vs.delete(ch, vs);
const longCharCodes = [
0x27f5, // LONG LEFTWARDS ARROW
0x27f6, // LONG RIGHTWARDS ARROW
0x27f7, // LONG LEFT RIGHT ARROW
0x27f8, // LONG LEFTWARDS DOUBLE ARROW
0x27f9, // LONG RIGHTWARDS DOUBLE ARROW
0x27fa, // LONG LEFT RIGHT DOUBLE ARROW
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");
}
}

View file

@ -72,7 +72,7 @@ function sweepFeatures(table, accessibleLookupsIds) {
const featureFiltered = {
name: feature.name,
tag: feature.tag,
lookups: []
lookups: [],
};
for (const l of feature.lookups) {
if (accessibleLookupsIds.has(l)) featureFiltered.lookups.push(l);
@ -282,7 +282,7 @@ function collectAliasMap(aliasMap) {
if (!m) {
m = {
representative: null,
aliases: new Map()
aliases: new Map(),
};
aliasResolution.set(terminal.glyph, m);
}
@ -319,7 +319,7 @@ function alterGeometryAndOptimize(collection) {
cluster.representative.glyph.geometry = new Geometry.TransformedGeometry(
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) {
@ -327,12 +327,12 @@ function alterGeometryAndOptimize(collection) {
g.geometry = new Geometry.ReferenceGeometry(
cluster.representative.glyph,
tf.x - cluster.representative.x,
tf.y - cluster.representative.y
tf.y - cluster.representative.y,
);
optimized.set(g, {
glyph: cluster.representative.glyph,
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,
memo,
sr.glyph,
d + 0x10000
d + 0x10000,
);
parts.push(new Geometry.ReferenceGeometry(sr.glyph, sr.x, sr.y));
}

View file

@ -65,7 +65,7 @@ function flattenSimpleGlyph(cache, skew, g) {
const tfForward = g.gizmo ? g.gizmo : new Transform(1, +skew, 0, 1, 0, 0);
gSimplified = new Geom.TransformedGeometry(
new Geom.SimplifyGeometry(new Geom.TransformedGeometry(g.geometry, tfBack)),
tfForward
tfForward,
);
} else {
gSimplified = new Geom.SimplifyGeometry(g.geometry);

View file

@ -9,7 +9,7 @@ export function CreateEmptyFont(argv) {
os2: new Ot.Os2.Table(4),
post: new Ot.Post.Table(argv.featureControl.exportGlyphNames ? 2 : 3, 0),
maxp: Ot.Maxp.Table.TrueType(),
name: new Ot.Name.Table()
name: new Ot.Name.Table(),
};
if (process.env.SOURCE_DATE_EPOCH) {
font.head.created = new Date(process.env.SOURCE_DATE_EPOCH * 1000);
@ -34,7 +34,7 @@ export function parseTTF(buf) {
export function buildTTF(font) {
const sfnt = FontIo.writeFont(font, {
glyphStore: { statOs2XAvgCharWidth: false },
generateDummyDigitalSignature: true
generateDummyDigitalSignature: true,
});
const buf = FontIo.writeSfntOtf(sfnt);
return buf;

View file

@ -2,477 +2,144 @@
// Machine generated. Do not modify。
export default [
{
"scriptTag": "latn",
"featureTag": "dflt",
"ranges": [
[
0,
169
scriptTag: "latn",
featureTag: "dflt",
ranges: [
[0, 169],
[171, 177],
[180, 184],
[187, 442],
[444, 447],
[452, 452],
[454, 455],
[457, 458],
[460, 497],
[499, 659],
[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],
],
[
171,
177
],
[
180,
184
],
[
187,
442
],
[
444,
447
],
[
452,
452
],
[
454,
455
],
[
457,
458
],
[
460,
497
],
[
499,
659
],
[
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",
"featureTag": "dflt",
"ranges": [
[
170,
170
scriptTag: "latp",
featureTag: "dflt",
ranges: [
[170, 170],
[178, 179],
[185, 186],
[688, 696],
[736, 740],
[890, 890],
[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],
],
[
178,
179
],
[
185,
186
],
[
688,
696
],
[
736,
740
],
[
890,
890
],
[
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",
"featureTag": "dflt",
"ranges": [
[
880,
883
scriptTag: "grek",
featureTag: "dflt",
ranges: [
[880, 883],
[886, 887],
[891, 893],
[895, 895],
[902, 902],
[904, 906],
[908, 908],
[910, 929],
[931, 993],
[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],
],
[
886,
887
],
[
891,
893
],
[
895,
895
],
[
902,
902
],
[
904,
906
],
[
908,
908
],
[
910,
929
],
[
931,
993
],
[
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",
"featureTag": "dflt",
"ranges": [
[
1024,
1153
scriptTag: "cyrl",
featureTag: "dflt",
ranges: [
[1024, 1153],
[1162, 1327],
[7296, 7304],
[7467, 7467],
[42560, 42605],
[42624, 42651],
],
[
1162,
1327
],
[
7296,
7304
],
[
7467,
7467
],
[
42560,
42605
],
[
42624,
42651
]
]
},
{
"scriptTag": "latb",
"featureTag": "dflt",
"ranges": [
[
7522,
7530
scriptTag: "latb",
featureTag: "dflt",
ranges: [
[7522, 7530],
[8320, 8334],
[8336, 8348],
[11388, 11388],
[122961, 122986],
],
[
8320,
8334
],
[
8336,
8348
],
[
11388,
11388
],
[
122961,
122986
]
]
}
},
];

View file

@ -46,8 +46,8 @@ export async function buildCompatLigatures(para, font) {
ligature.geometry.items.push(
new Ot.Glyph.TtReference(
glyphList.at(component.g),
Ot.Glyph.Transform2X3.Translate(x, y)
)
Ot.Glyph.Transform2X3.Translate(x, y),
),
);
xCursor += component.ax;

View file

@ -50,7 +50,7 @@ async function getParameters(argv) {
await tryParseToml(WEIGHTS_TOML),
await tryParseToml(WIDTHS_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 rawLigationData = await tryParseToml(LIGATIONS_TOML);
@ -63,7 +63,7 @@ async function getParameters(argv) {
if (argv.metricOverride) applyMetricOverride(para, argv.metricOverride, argv);
para.naming = {
miscNames: para.naming,
...createNamingDictFromArgv(argv)
...createNamingDictFromArgv(argv),
};
return para;
}
@ -83,7 +83,7 @@ async function tryParseToml(str) {
return Toml.parse(await fs.promises.readFile(str, "utf-8"));
} catch (e) {
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([
gn,
Array.from(glyphStore.queryUnicodeOfName(gn) || []),
...createGrDisplaySheet(glyphStore, gn)
...createGrDisplaySheet(glyphStore, gn),
]);
}
await fs.promises.writeFile(argv.oCharMap, zlib.gzipSync(encode(charMap)));

View file

@ -7,7 +7,7 @@ export function createNamingDictFromArgv(argv) {
version: argv.menu.version,
weight: argv.menu.weight - 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.InstructionsMayDependOnPointSize, 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 {
style: getStyle(linkWeight, 5, linkSlope),
familySuffix: getStyle(nameSuffixWeight, nameSuffixWidth, nameSuffixSlope),
familySuffixShort: getShortStyle(nameSuffixWeight, nameSuffixWidth, nameSuffixSlope)
familySuffixShort: getShortStyle(nameSuffixWeight, nameSuffixWidth, nameSuffixSlope),
};
}
@ -185,7 +185,7 @@ const weightToMenuStyleMap = {
600: "Semibold",
700: "Bold",
800: "Extrabold",
900: "Heavy"
900: "Heavy",
};
const widthToMenuStyleMap = {
1: "Ultra-Condensed",
@ -196,12 +196,12 @@ const widthToMenuStyleMap = {
6: "Semi-Extended",
7: "Extended",
8: "Extra-Extended",
9: "Ultra-Extended"
9: "Ultra-Extended",
};
const slopeToMenuStyleMap = {
normal: "",
italic: "Italic",
oblique: "Oblique"
oblique: "Oblique",
};
const weightToMenuStyleMapShort = {
100: "Th",
@ -214,7 +214,7 @@ const weightToMenuStyleMapShort = {
600: "SmBd",
700: "Bd",
800: "XBd",
900: "Hv"
900: "Hv",
};
const widthToMenuStyleMapShort = {
1: "UltCn",
@ -225,12 +225,12 @@ const widthToMenuStyleMapShort = {
6: "SmEx",
7: "Ex",
8: "XEx",
9: "UltEx"
9: "UltEx",
};
const slopeToMenuStyleMapShort = {
normal: "",
italic: "It",
oblique: "Obl"
oblique: "Obl",
};
/////////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -257,7 +257,7 @@ const ApplePostNames = new Map([
[0x107, "cacute"],
[0x10c, "Ccaron"],
[0x10d, "ccaron"],
[0x111, "dcroat"]
[0x111, "dcroat"],
/* spell-checker: enable */
]);

View file

@ -83,7 +83,7 @@ class MappedGlyphStore {
let rev = new Map();
for (const [u, g] of this.m_primaryUnicodeMapping) rev.set(g, u);
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;
@ -101,7 +101,7 @@ class MappedGlyphStore {
gSrcBase,
gOtBase,
this.m_nameMapping,
conflictSet
conflictSet,
);
}
} while (nNewNames > 0);
@ -114,7 +114,7 @@ class MappedGlyphStore {
gSrcBase,
gOtBase,
this.m_nameMapping,
conflictSet
conflictSet,
);
}
} while (nNewNames > 0);
@ -162,8 +162,8 @@ class MappedGlyphStore {
z.y,
z.type === Point.Type.Quadratic
? Ot.Glyph.PointType.Quad
: Ot.Glyph.PointType.Corner
)
: Ot.Glyph.PointType.Corner,
),
);
}
cs.contours.push(c1);

View file

@ -89,7 +89,7 @@ class ScriptLanguageStore {
}
return {
requiredFeature: this.featureStore.query(data.requiredFeature) || null,
features: features
features: features,
};
}
}
@ -162,7 +162,7 @@ const GsubSingleHandler = {
const to = store.glyphs.queryByName(st[k]);
if (from && to) dst.mapping.set(from, to);
}
}
},
};
const GsubMultipleHandler = {
init() {
@ -176,13 +176,13 @@ const GsubMultipleHandler = {
if (!from || !to) continue;
dst.mapping.set(from, to);
}
}
},
};
const GsubAlternateHandler = {
init() {
return new Ot.Gsub.Alternate();
},
fill: GsubMultipleHandler.fill
fill: GsubMultipleHandler.fill,
};
const GsubLigatureHandler = {
init() {
@ -196,7 +196,7 @@ const GsubLigatureHandler = {
if (!from || !to) continue;
dst.mapping.push({ from, to });
}
}
},
};
const GsubChainingHandler = {
init() {
@ -221,7 +221,7 @@ const GsubChainingHandler = {
}
dst.rules.push({ match, inputBegins, inputEnds, applications });
}
}
},
};
const GsubReverseHandler = {
init() {
@ -257,7 +257,7 @@ const GsubReverseHandler = {
}
dst.rules.push({ match, doSubAt, replacement });
}
}
},
};
function mapGlyphListAll(gl, store) {
@ -285,7 +285,7 @@ const GsubHandlers = {
gsub_alternate: GsubAlternateHandler,
gsub_ligature: GsubLigatureHandler,
gsub_chaining: GsubChainingHandler,
gsub_reverse: GsubReverseHandler
gsub_reverse: GsubReverseHandler,
};
///////////////////////////////////////////////////////////////////////////////////////////////////
@ -298,7 +298,7 @@ const GposMarkToBaseHandler = {
const mm = collectClassMap(src.marks);
dst.marks = convertMarkRecords(src.marks, mm, store);
dst.bases = convertBaseRecords(src.bases, mm, store);
}
},
};
const GposMarkToMarkHandler = {
init() {
@ -308,7 +308,7 @@ const GposMarkToMarkHandler = {
const mm = collectClassMap(src.marks);
dst.marks = convertMarkRecords(src.marks, mm, store);
dst.baseMarks = convertBaseRecords(src.bases, mm, store);
}
},
};
function collectClassMap(marks) {
let n = 0;
@ -350,5 +350,5 @@ function convertBaseRecords(bases, mm, store) {
}
const GposHandlers = {
gpos_mark_to_base: GposMarkToBaseHandler,
gpos_mark_to_mark: GposMarkToMarkHandler
gpos_mark_to_mark: GposMarkToMarkHandler,
};

View file

@ -68,7 +68,7 @@ class Alignment {
Gr.Texture.ExtLR,
Gr.Texture.ShrL,
Gr.Texture.ShrR,
Gr.Texture.ShrLR
Gr.Texture.ShrLR,
];
for (const gr of cvs) {
const gnLinked = gr.get(go);

View file

@ -42,7 +42,7 @@ class Cache {
return {
version: version + "@" + Edition,
ageKeys: mergedAgeKeys,
gf: gfRep
gf: gfRep,
};
}
isEmpty() {

View file

@ -1,8 +1,8 @@
import { mix } from "@iosevka/util";
import * as TypoGeom from "typo-geom";
import { Point, Vec2 } from "./point.mjs";
import { Transform } from "./transform.mjs";
import { mix } from "@iosevka/util";
function contourToRep(contour) {
let c = [];
@ -30,8 +30,8 @@ function convertContourToArcs(contour) {
z0,
Point.from(Point.Type.CubicStart, z1),
Point.from(Point.Type.CubicEnd, z2),
Point.from(Point.Type.Corner, z3)
)
Point.from(Point.Type.Corner, z3),
),
);
z0 = z3;
j += 2;
@ -47,8 +47,8 @@ function convertContourToArcs(contour) {
z0,
Point.from(Point.Type.CubicStart, z0).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;
if (zfIsCorner) j++;
@ -57,8 +57,8 @@ function convertContourToArcs(contour) {
default: {
newContour.push(
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;
break;
@ -88,7 +88,7 @@ export function derivativeFromFiniteDifference(c, t) {
(2 / 3) * backward1.y +
(2 / 3) * forward1.y -
(1 / 12) * forward2.y) /
DELTA
DELTA,
);
}
@ -104,7 +104,7 @@ export class OffsetCurve {
const absD = Math.hypot(d.x, d.y);
return {
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) {
@ -189,7 +189,7 @@ export class RoundCapCurve {
return {
x: centerX + r * Math.cos(theta) * this.contrast,
y: centerY + r * Math.sin(theta)
y: centerY + r * Math.sin(theta),
};
}

View file

@ -71,7 +71,7 @@ export class ContourSetGeometry extends GeometryBase {
toShapeStringOrNull() {
return Format.struct(
`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",
Format.gizmo(this.m_gizmo),
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) {
outlineGeometry = new CombineGeometry([
new SpiroGeometry(this.m_gizmo, true, lhs),
new SpiroGeometry(this.m_gizmo, true, rhs)
new SpiroGeometry(this.m_gizmo, true, rhs),
]);
} else {
lhs[0].type = lhs[lhs.length - 1].type = "corner";
@ -155,7 +155,7 @@ export class DiSpiroGeometry extends GeometryBase {
this.m_gizmo,
this.m_contrast,
this.m_closed,
this.m_biKnots
this.m_biKnots,
);
expander.initializeNormals();
expander.iterateNormals();
@ -187,7 +187,7 @@ export class DiSpiroGeometry extends GeometryBase {
Format.gizmo(this.m_gizmo),
Format.n(this.m_contrast),
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() {
return new TransformedGeometry(
this.m_glyph.geometry,
Transform.Translate(this.m_x, this.m_y)
Transform.Translate(this.m_x, this.m_y),
);
}
toContours() {
@ -317,8 +317,8 @@ export class TransformedGeometry extends GeometryBase {
unwrapped.m_geom,
Transform.Translate(
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 {
return new TransformedGeometry(unwrapped, this.m_transform);
@ -467,7 +467,7 @@ export class BooleanGeometry extends GeometryBase {
sink.push({
type: "operand",
fillType: TypoGeom.Boolean.PolyFillType.pftNonZero,
shape: []
shape: [],
});
return;
}
@ -480,7 +480,7 @@ export class BooleanGeometry extends GeometryBase {
sink.push({
type: "operand",
fillType: TypoGeom.Boolean.PolyFillType.pftNonZero,
shape: CurveUtil.convertShapeToArcs(operand.toContours())
shape: CurveUtil.convertShapeToArcs(operand.toContours()),
});
}
// Push operator if i > 0
@ -548,7 +548,7 @@ export class StrokeGeometry extends GeometryBase {
let arcs = TypoGeom.Boolean.removeOverlap(
CurveUtil.convertShapeToArcs(nonTransformedGeometry.toContours()),
TypoGeom.Boolean.PolyFillType.pftNonZero,
CurveUtil.BOOLE_RESOLUTION
CurveUtil.BOOLE_RESOLUTION,
);
// Fairize to get get some arcs that are simple enough
@ -559,7 +559,7 @@ export class StrokeGeometry extends GeometryBase {
fairizedArcs,
this.m_radius,
this.m_contrast,
this.m_fInside
this.m_fInside,
);
// Convert to Iosevka format
@ -580,7 +580,7 @@ export class StrokeGeometry extends GeometryBase {
this.m_gizmo,
this.m_radius,
this.m_contrast,
this.m_fInside
this.m_fInside,
);
}
filterTag(fn) {
@ -589,7 +589,7 @@ export class StrokeGeometry extends GeometryBase {
this.m_gizmo,
this.m_radius,
this.m_contrast,
this.m_fInside
this.m_fInside,
);
}
measureComplexity() {
@ -604,7 +604,7 @@ export class StrokeGeometry extends GeometryBase {
Format.gizmo(this.m_gizmo),
Format.n(this.m_radius),
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.PolyFillType.pftNonZero,
CurveUtil.BOOLE_RESOLUTION
CurveUtil.BOOLE_RESOLUTION,
);
}
@ -631,7 +631,7 @@ export class SimplifyGeometry extends GeometryBase {
TypoGeom.ShapeConv.transferGenericShape(
TypoGeom.Fairize.fairizeBezierShape(arcs),
sink,
CurveUtil.GEOMETRY_PRECISION
CurveUtil.GEOMETRY_PRECISION,
);
return sink.contours;
}

View file

@ -33,7 +33,7 @@ export class Point {
return new Point(
this.type,
this.x + scale * (z2.x - this.x),
this.y + scale * (z2.y - this.y)
this.y + scale * (z2.y - this.y),
);
}
scale(t) {
@ -74,5 +74,5 @@ Point.Type = {
Corner: 0,
CubicStart: 1,
CubicEnd: 2,
Quadratic: 3
Quadratic: 3,
};

View file

@ -168,7 +168,7 @@ class BiKnot {
this.d2 == null ? "" : Format.n(this.d2),
this.proposedNormal
? Format.tuple(Format.n(this.proposedNormal.x), Format.n(this.proposedNormal.y))
: ""
: "",
);
}
toMono() {

View file

@ -34,7 +34,7 @@ export class SpiroExpander {
this.m_biKnotsT[j].type,
this.m_biKnotsT[j].unimportant,
mix(lhs.x, rhs.x, 0.5),
mix(lhs.y, rhs.y, 0.5)
mix(lhs.y, rhs.y, 0.5),
);
}
return middles;

View file

@ -1,4 +1,5 @@
import * as SpiroJs from "spiro";
import * as CurveUtil from "./curve-util.mjs";
export function spiroToOutline(knots, fClosed, gizmo) {

View file

@ -1,11 +1,11 @@
import * as TypoGeom from "typo-geom";
import {
BOOLE_RESOLUTION,
Bez3FromHermite,
GEOMETRY_PRECISION,
OCCURRENT_PRECISION,
OffsetCurve,
RoundCapCurve
RoundCapCurve,
} from "./curve-util.mjs";
export function strokeArcs(arcs, radius, contrast, fInside) {
@ -24,7 +24,7 @@ export function strokeArcs(arcs, radius, contrast, fInside) {
bezs,
TypoGeom.Boolean.PolyFillType.pftNonZero,
TypoGeom.Boolean.PolyFillType.pftNonZero,
BOOLE_RESOLUTION
BOOLE_RESOLUTION,
);
}
}
@ -37,7 +37,7 @@ export function strokeArcs(arcs, radius, contrast, fInside) {
currentArcs,
TypoGeom.Boolean.PolyFillType.pftNonZero,
TypoGeom.Boolean.PolyFillType.pftNonZero,
BOOLE_RESOLUTION
BOOLE_RESOLUTION,
);
} else {
return currentArcs;
@ -72,8 +72,8 @@ function offsetContour(arcs, distance, contrast) {
prevOffsetedArc.derivative(1),
currentOffsetedArc.bone.eval(0),
currentStart,
currentOffsetedArc.derivative(0)
)
currentOffsetedArc.derivative(0),
),
);
// offsetArcs.push(Bez3FromHermite(prevEnd, dPrevEnd, currentStart, dCurrentStart));
}
@ -101,7 +101,7 @@ function createCap(
dPrevEnd, // Previous offseted curve's end point's derivative
currentStartNoOffset, // Current non-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(
side,
@ -109,6 +109,6 @@ function createCap(
prevEndNoOffset,
prevEnd,
currentStartNoOffset,
currentStart
currentStart,
);
}

View file

@ -39,7 +39,7 @@ export class Transform {
applyOffsetXY(deltaX, deltaY) {
return {
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.xx / 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,
z01.y - z00.y,
z00.x,
z00.y
z00.y,
);
}
}

View file

@ -118,7 +118,7 @@ export class Glyph {
this.includeGeometry(new Geom.ReferenceGeometry(g, shiftX, shiftY));
} else {
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];
this.baseAnchors[m2] = new Anchor(
shift.x + baseDerived.x,
shift.y + baseDerived.y
shift.y + baseDerived.y,
);
}
}

View file

@ -13,7 +13,7 @@ export const Dotless = {
},
amendName(name) {
return name + ".dotless";
}
},
};
export const LowerYDotAtBelow = LinkedGlyphProp("LowerYDotAtBelow");
@ -27,9 +27,9 @@ export const LeaningMarkSpacer = LinkedGlyphProp("LeaningMarkSpacer");
export const LocalizedForm = {
SRB: {
Upright: LinkedGlyphProp("SerbianLocUpright"),
Italic: LinkedGlyphProp("SerbianLocItalic")
Italic: LinkedGlyphProp("SerbianLocItalic"),
},
BGR: LinkedGlyphProp("BulgarianLoc")
BGR: LinkedGlyphProp("BulgarianLoc"),
};
export const Texture = {
@ -38,7 +38,7 @@ export const Texture = {
ExtLR: LinkedGlyphProp("TextureExtLR"),
ShrL: LinkedGlyphProp("TextureShrL"),
ShrR: LinkedGlyphProp("TextureShrR"),
ShrLR: LinkedGlyphProp("TextureShrLR")
ShrLR: LinkedGlyphProp("TextureShrLR"),
};
function LinkedGlyphProp(key) {
@ -58,7 +58,7 @@ function LinkedGlyphProp(key) {
},
amendOtName(name) {
return `${name}.${key}`;
}
},
};
}
@ -90,7 +90,7 @@ function DecompositionProp(key) {
},
amendOtName(baseName, index) {
return `${baseName}.d${index}`;
}
},
};
}
@ -103,7 +103,7 @@ export const TieGlyph = {
if (!glyph.related) glyph.related = {};
glyph.related.TieGlyph = true;
Joining.or(glyph, Joining.Classes.Mid);
}
},
};
function BoolProp(id) {
@ -115,7 +115,7 @@ function BoolProp(id) {
set(glyph) {
if (!glyph.related) glyph.related = {};
glyph.related[id] = true;
}
},
};
}
export const Radical = BoolProp("Radical");
@ -152,8 +152,8 @@ export const Joining = {
Classes: {
Left: 1,
Right: 2,
Mid: 3
}
Mid: 3,
},
};
export const HintClass = {
@ -164,7 +164,7 @@ export const HintClass = {
set(glyph, script, style) {
if (!glyph.related) glyph.related = {};
glyph.related.hintClass = [script, style];
}
},
};
///////////////////////////////////////////////////////////////////////////////////////////////////
@ -173,7 +173,7 @@ export const DotlessOrNot = {
query(glyph) {
if (Dotless.get(glyph)) return [Dotless];
return null;
}
},
};
export const AnyLocalizedForm = {
@ -184,7 +184,7 @@ export const AnyLocalizedForm = {
if (LocalizedForm.BGR.get(glyph)) grs.push(LocalizedForm.BGR);
if (grs.length) return grs;
return null;
}
},
};
export const AnyCv = {
@ -203,7 +203,7 @@ export const AnyCv = {
if (ua < ub) return -1;
if (ua > ub) return 1;
return a.rank - b.rank;
}
},
};
export const AnyDerivingCv = {
@ -223,7 +223,7 @@ export const AnyDerivingCv = {
return glyph.related.preventCvDeriving.size > 0;
}
return false;
}
},
};
export const AnyCvOrCherryPicking = {
@ -231,7 +231,7 @@ export const AnyCvOrCherryPicking = {
let ret = AnyCv.query(glyph);
if (Zero.get(glyph)) ret.push(Zero);
return ret;
}
},
};
///////////////////////////////////////////////////////////////////////////////////////////////////
@ -370,9 +370,9 @@ function displayQueryPairFeatures(g, name, grCis, grTrans, sink) {
FeatureSeries(name, [
[
{ 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, [
[
{ 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 = {
css: `'${gr.tag}' ${String(gr.rank).padStart(2)}`,
description: gr.description
description: gr.description,
};
if (!series.groups[gr.groupRank]) series.groups[gr.groupRank] = [];
series.groups[gr.groupRank].push(featureApp);
@ -474,7 +474,7 @@ export const SvInheritableRelations = [
Joining,
NeqLigationSlashDotted,
OgonekTrY,
ScheduleLeaningMark
ScheduleLeaningMark,
];
export const CvCherryPickingGrs = [Zero];

View file

@ -18,7 +18,7 @@ export function applyLigationData(data, para, argv) {
}
para.ligation = {
defaultBuildup,
caltBuildup: []
caltBuildup: [],
};
if (argv.ligations) {
if (argv.ligations.inherits)
@ -27,13 +27,13 @@ export function applyLigationData(data, para, argv) {
Parameters.apply(
para.ligation,
hives,
argv.ligations.disables.map(x => `ligset-disable-${x}`)
argv.ligations.disables.map(x => `ligset-disable-${x}`),
);
if (argv.ligations.enables)
Parameters.apply(
para.ligation,
hives,
argv.ligations.enables.map(x => `ligset-enable-${x}`)
argv.ligations.enables.map(x => `ligset-enable-${x}`),
);
}
}

View file

@ -45,7 +45,7 @@ const validMetricOverrideFields = new Set([
"essRatioQuestion",
"essRatio",
"archDepth",
"smallArchDepth"
"smallArchDepth",
]);
///////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -21,7 +21,7 @@ export function apply(data, para, argv) {
para.variants = {
selectorTree: parsed.selectorTree,
primes: parsed.primes,
composites: parsed.composites
composites: parsed.composites,
};
para.variantSelector = variantSelector;
}
@ -167,7 +167,7 @@ class Prime {
ligatureSampler: this.ligatureSampler,
descSampleText: this.descSampleText,
hotChars: this.hotChars,
variants: []
variants: [],
};
for (const variant of this.variants.values()) {
gr.variants.push({
@ -175,7 +175,7 @@ class Prime {
rank: variant.rank,
groupRank: variant.groupRank,
description: variant.description,
snapshotFeatureApplication: variant.snapshotFeatureApplication
snapshotFeatureApplication: variant.snapshotFeatureApplication,
});
}
gr.variants.sort((a, b) => (a.rank || 0x7fffffff) - (b.rank || 0x7fffffff));
@ -249,7 +249,7 @@ class Composite {
design: slabOverrideCfg.design,
override: slabOverrideCfg.upright || slabOverrideCfg["upright-oblique"],
oblique: slabOverrideCfg.oblique || slabOverrideCfg["upright-oblique"],
italic: slabOverrideCfg.italic
italic: slabOverrideCfg.italic,
};
}
decompose(para, selTree) {
@ -259,7 +259,7 @@ class Composite {
this.design,
this.decomposeSlope(this, para),
!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)) {
const pv = selTree.get(k, v);
@ -308,7 +308,7 @@ class VariantBuilder {
globalState.sink.sort(
(a, b) =>
a.nonBreakingVariantAdditionPriority - b.nonBreakingVariantAdditionPriority ||
a.rank - b.rank
a.rank - b.rank,
);
let ans = {};
@ -398,7 +398,7 @@ class VbStageAlternative {
ans.addDescription(
this.mode,
this.evalValue(this.descriptionJoiner, localState),
this.evalValue(this.descriptionAffix, localState)
this.evalValue(this.descriptionAffix, localState),
);
}
if (this.selectorAffix) {
@ -563,7 +563,7 @@ class VbLocalState {
rank: this.rank,
groupRank: this.groupRank,
description: this.produceDescription(),
selector: Object.fromEntries(this.selector)
selector: Object.fromEntries(this.selector),
};
}
}

View file

@ -69,7 +69,7 @@ export const SuffixCfg = {
if (pair) ans[pair.left] = pair.right;
}
return ans;
}
},
};
///////////////////////////////////////////////////////////////////////////////////////////////////
@ -98,7 +98,7 @@ export const MatchUtil = {
},
either(a, b) {
return x => a(x) || b(x);
}
},
};
export function constant(x) {
return () => x;
@ -136,5 +136,5 @@ export const ArrayUtil = {
}
return ranges;
}
},
};

View file

@ -46,7 +46,7 @@ export default async function main(argv) {
`<tr><td align="center">` +
`<a href="${baseUrl}/packages-sha.txt">Package hashes (SHA-256)</a>` +
`</td></tr>` +
`</table>`
`</table>`,
);
await fs.promises.writeFile(argv.outputPath, out.data);
}

View file

@ -21,7 +21,7 @@ async function main(argv) {
let readme = await fs.promises.readFile(argv.mdFilePath, "utf-8");
const dirs = {
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 processCherryPickingStyles(argv, dirs)).apply(readme);
@ -30,10 +30,10 @@ async function main(argv) {
readme = (await processLigSetCherryPicking(argv, dirs)).apply(readme);
readme = (await processLigSetPreDef(argv, dirs)).apply(readme);
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
readme,
);
readme = (await processLangList(argv)).apply(readme);
readme = (await processPrivateBuildPlans(argv, dirs)).apply(readme);

View file

@ -4,7 +4,7 @@ export class MdCol {
this.sectionName = sectionName;
this.matchRegex = new RegExp(
`^([ \\t]*)<!-- BEGIN ${sectionName} -->\\n[\\s\\S]*?<!-- END ${sectionName} -->\\n`,
`m`
`m`,
);
}
log(...s) {

View file

@ -21,7 +21,7 @@ export default async function processCherryPickingStyles(argv, dirs) {
const info = {
introMD: cv.description || `Styles for ${sampleText + explainText}`,
sampleImageCountEm: sampleImageCountEmOfCv(cv),
alternatives: []
alternatives: [],
};
const defaults = figureOutDefaults(variantsData, cv);
for (const cvv of cv.variants) {
@ -31,14 +31,14 @@ export default async function processCherryPickingStyles(argv, dirs) {
imageId: `${cv.key}-${cvv.key}`,
selectors: [`${cv.key} = '${cvv.key}'`, `${cv.tag} = ${cvv.rank}`],
description:
formatDescription(cvv.description) + formatDefaults(cvv.key, defaults)
formatDescription(cvv.description) + formatDefaults(cvv.key, defaults),
});
} else {
info.alternatives.push({
imageId: `${cv.key}-${cvv.key}`,
selectors: [`${cv.key} = '${cvv.key}'`],
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",
mask: 1,
result: null,
composition: { ...variantsData.defaults.sans.upright }
composition: { ...variantsData.defaults.sans.upright },
},
{
desc: "Sans Italic",
mask: 2,
result: null,
composition: { ...variantsData.defaults.sans.italic }
composition: { ...variantsData.defaults.sans.italic },
},
{
desc: "Slab Upright",
mask: 4,
result: null,
composition: { ...variantsData.defaults.slab.upright }
composition: { ...variantsData.defaults.slab.upright },
},
{
desc: "Slab Italic",
mask: 8,
result: null,
composition: { ...variantsData.defaults.slab.italic }
}
composition: { ...variantsData.defaults.slab.italic },
},
];
for (const variant of gr.variants) {
for (const dc of defaultConfigs) {

View file

@ -6,12 +6,12 @@ export default async function processCvInfluences(argv) {
const cl = await getCharMapAndSupportedLanguageList(
argv.charMapPath,
argv.charMapItalicPath,
argv.charMapObliquePath
argv.charMapObliquePath,
);
let m = {
upright: new Map(),
italic: new Map()
italic: new Map(),
};
for (const block of cl.unicodeCoverage) {

View file

@ -19,7 +19,7 @@ export default async function processCvOt(argv, dirs) {
for (let rid = 0; rid < rowsNeeded; rid++) {
const entriesInThisRow = Math.min(
entriesPerRow,
effVariants.length - rid * entriesPerRow
effVariants.length - rid * entriesPerRow,
);
const tailBlankColumnsCount = TableColumns - entryWidth * entriesInThisRow;
// Image row

View file

@ -6,7 +6,7 @@ export default async function processLangList(argv) {
const cl = await getCharMapAndSupportedLanguageList(
argv.charMapPath,
argv.charMapItalicPath,
argv.charMapObliquePath
argv.charMapObliquePath,
);
const md = new MdCol("Section-Language-List");
md.log(`${cl.languages.length} Supported Languages: \n`);

View file

@ -35,7 +35,7 @@ export default async function processPackageList(argv, dirs) {
ttcCells = [
`<td><b><a href="${sTtcLink}">Super\u00A0TTC</b></td>`,
`<td><b><a href="${ttcLink}">TTC</b></td>`,
`<td colspan="2">&nbsp;</td>`
`<td colspan="2">&nbsp;</td>`,
];
}
@ -43,7 +43,7 @@ export default async function processPackageList(argv, dirs) {
`<tr>`,
`<td colspan="3"><b>&#x1F4E6; ${familyName}</b> — ${desc}</td>`,
...ttcCells,
`</tr>`
`</tr>`,
);
md.log(
`<tr>`,
@ -51,7 +51,7 @@ export default async function processPackageList(argv, dirs) {
`<td><b>Spacing</b></td>`,
`<td><b>Ligatures</b></td>`,
`<td colspan="4"><b>Downloads</b></td>`,
`</tr>`
`</tr>`,
);
let lastSubGroupID = null;
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>`,
`<td>${createLink("WebFont", "PkgWebFont")}&nbsp;` +
`(${createLink("Unhinted", "PkgWebFont-Unhinted")})</td>`,
`</tr>`
`</tr>`,
);
}
md.log(`<tr>`, `<td colspan="8">${img}</td>`, `</tr>`);
@ -98,7 +98,7 @@ const Spacings = {
type: ["Default", true],
term: ["Terminal", true],
fixed: ["Fixed", false],
"quasi-proportional": ["Default", false]
"quasi-proportional": ["Default", false],
};
function flag(f) {
return f ? "<b>Yes</b>" : "No";

View file

@ -18,7 +18,7 @@ export default async function processSsOt(argv, dirs) {
`<tr>`,
`<td>${ImgX(`${dirs.images}/ss-u-${ss.tag}-${ss.rank}`)}</td>`,
`<td>${ImgX(`${dirs.images}/ss-i-${ss.tag}-${ss.rank}`)}</td>`,
`</tr>`
`</tr>`,
);
}
}

View file

@ -5,7 +5,7 @@ export async function collectBlockData() {
[[0xe0a0, 0xe0df], "Private Use Area — Powerline"],
[[0xee00, 0xee0f], "Private Use Area — Progress Bar"],
[[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) {

View file

@ -18,7 +18,7 @@ class CharDataLookup {
} else {
return {
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(
path.join(__dirname, "additional-char-data.txt"),
"utf-8"
"utf-8",
);
let nameSuffix = "";

View file

@ -48,7 +48,7 @@ export async function gatherCoverageData(covUpright, covItalic, covOblique) {
...putFeatSeries(featureSeriesStore, "typographicFeatureSets", typoFs),
...putFeatSeries(featureSeriesStore, "cvFeatureSetsUpright", uprightFs),
...putFeatSeries(featureSeriesStore, "cvFeatureSetsItalic", italicFs),
...putFeatSeries(featureSeriesStore, "cvFeatureSetsOblique", obliqueFs)
...putFeatSeries(featureSeriesStore, "cvFeatureSetsOblique", obliqueFs),
});
} else {
blockResults.push({ lch, gc, charName, inFont: false, glyphName: undefined });
@ -57,7 +57,7 @@ export async function gatherCoverageData(covUpright, covItalic, covOblique) {
if (blockResults.length) {
unicodeCoverage.push({
name: block,
characters: blockResults.sort((a, b) => a.lch - b.lch)
characters: blockResults.sort((a, b) => a.lch - b.lch),
});
}
}

View file

@ -11,7 +11,7 @@ async function main(argv) {
const cl = await getCharMapAndSupportedLanguageList(
argv.charMapPath,
argv.charMapItalicPath,
argv.charMapObliquePath
argv.charMapObliquePath,
);
await fs.promises.writeFile(
argv.exportPathMeta,
@ -22,15 +22,15 @@ async function main(argv) {
ligationData: {
cherry: ligationData.cherry,
samplesNarrow: ligationData.samplesNarrow,
nonMergeSets: ligationData.nonMergeSets
}
nonMergeSets: ligationData.nonMergeSets,
},
},
null,
2
)
2,
),
);
await fs.promises.writeFile(
argv.exportPathCov,
JSON.stringify({ version: argv.version, ...cl }, null, 2)
JSON.stringify({ version: argv.version, ...cl }, null, 2),
);
}

View file

@ -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) {
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) {
const comp = ligData.composite[sel];
@ -112,7 +112,7 @@ function buildLigationSet(ligData, getKey) {
ligSets,
tagName: [comp.tag],
desc: comp.desc,
brief: comp.brief || comp.desc
brief: comp.brief || comp.desc,
};
ligationSets.set(key, item);
} else {
@ -127,19 +127,19 @@ function buildLigationSet(ligData, getKey) {
export async function parseLigationData(argv) {
const ligToml = await fs.promises.readFile(
path.join(argv.paramsDir, "ligation-set.toml"),
"utf8"
"utf8",
);
const ligData = toml.parse(ligToml);
const ligationSets = buildLigationSet(ligData, comp => comp.buildup.join(","));
const nonMergeLigationSets = buildLigationSet(
ligData,
comp => comp.tag + comp.buildup.join(",")
comp => comp.tag + comp.buildup.join(","),
);
return {
samplesNarrow: ligationSamplesNarrow,
cherry: ligData.simple,
rawSets: ligData.composite,
sets: [...ligationSets.values()],
nonMergeSets: [...nonMergeLigationSets.values()]
nonMergeSets: [...nonMergeLigationSets.values()],
};
}

View file

@ -31,7 +31,7 @@ function getSupportLocaleSet(rawCoverage) {
...(exemplar.auxiliary || []),
...(exemplar.index || []),
...(exemplar.numbers || []),
...(exemplar.punctuation || [])
...(exemplar.punctuation || []),
].join("");
let fullSupport = true;
let basicSupport = true;
@ -99,10 +99,10 @@ export async function getCharMapAndSupportedLanguageList(cmpUpright, cmpItalic,
return {
stats: {
glyphCount: charMap.length,
codePointCount: rawCoverage.size
codePointCount: rawCoverage.size,
},
featureSeries: covData.featureSeries,
unicodeCoverage: covData.unicodeCoverage,
languages: Array.from(getSupportedLanguageSet(rawCoverage)).sort()
languages: Array.from(getSupportedLanguageSet(rawCoverage)).sort(),
};
}

View file

@ -24,13 +24,13 @@ const mockPara = {
sans: {
upright: {},
oblique: { isOblique: true },
italic: { isItalic: true }
italic: { isItalic: true },
},
slab: {
upright: { slab: 2 },
oblique: { slab: 2, isOblique: true },
italic: { slab: 2, isItalic: true }
}
italic: { slab: 2, isItalic: true },
},
};
function getSsData(variants) {
const result = [
@ -41,13 +41,13 @@ function getSsData(variants) {
description: "Default",
composition: {
sans: { upright: {}, italic: {}, oblique: {} },
slab: { upright: {}, italic: {}, oblique: {} }
slab: { upright: {}, italic: {}, oblique: {} },
},
hotChars: {
sans: { upright: [], italic: [], oblique: [] },
slab: { upright: [], italic: [], oblique: [] }
}
}
slab: { upright: [], italic: [], oblique: [] },
},
},
];
const hcDefault = getCompWithLens(variants, null, x => x.hotChars);
for (const [key, composite] of variants.composites) {
@ -59,8 +59,8 @@ function getSsData(variants) {
description: composite.description,
composition: getCompWithLens(variants, composite, x => x.composition),
hotChars: getCompWithLens(variants, composite, (x, style, slope) =>
uniqueHotChars(x.hotChars, hcDefault[style][slope])
)
uniqueHotChars(x.hotChars, hcDefault[style][slope]),
),
});
}
return result;
@ -73,36 +73,36 @@ function getCompWithLens(variants, c, lens) {
upright: lens(
buildupComposite(variants, mockPara.sans.upright, cDefault, c),
"sans",
"upright"
"upright",
),
italic: lens(
buildupComposite(variants, mockPara.sans.italic, cDefault, c),
"sans",
"italic"
"italic",
),
oblique: lens(
buildupComposite(variants, mockPara.sans.oblique, cDefault, c),
"sans",
"oblique"
)
"oblique",
),
},
slab: {
upright: lens(
buildupComposite(variants, mockPara.slab.upright, cDefault, cSlab, c),
"slab",
"upright"
"upright",
),
italic: lens(
buildupComposite(variants, mockPara.slab.italic, cDefault, cSlab, c),
"slab",
"italic"
"italic",
),
oblique: lens(
buildupComposite(variants, mockPara.slab.oblique, cDefault, cSlab, c),
"slab",
"oblique"
)
}
"oblique",
),
},
};
}
function getSelectorKey(prime, variant) {
@ -142,7 +142,7 @@ function uniqueHotChars(cfgDefault, cfgSS) {
export async function parseVariantsData(argv) {
const variantsToml = await fs.promises.readFile(
path.join(argv.paramsDir, argv.paramsFileName || "variants.toml"),
"utf8"
"utf8",
);
const varDatRaw = toml.parse(variantsToml);
const varDatParsed = VariantDataParser.parse(varDatRaw);

View file

@ -42,7 +42,7 @@ async function main(argv) {
const ligationData = await parseLigationData(argv);
const tasks = new Generator(
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
@ -58,7 +58,7 @@ async function main(argv) {
const cl = await getCharMapAndSupportedLanguageList(
argv.charMapPath,
argv.charMapItalicPath,
argv.charMapObliquePath
argv.charMapObliquePath,
);
for (const block of cl.unicodeCoverage) {
const blockID = block.name
@ -67,7 +67,7 @@ async function main(argv) {
.replaceAll(/ +/g, "-");
if (blockID === "specials") continue;
await tasks.add(`cs-block-${blockID}`, CharGrid, {
characters: block.characters
characters: block.characters,
});
}
@ -79,7 +79,7 @@ async function main(argv) {
lineBreakMode: "each-row",
fontFamily: pst.fontFamily,
fontStyle: "normal",
fontFeatures: pst.fontFeatures
fontFeatures: pst.fontFeatures,
});
}
@ -92,7 +92,7 @@ async function main(argv) {
ligationCherry: ligationData.cherry,
tag: ls.tag,
rank: ls.rank,
ligSets: ls.ligSets
ligSets: ls.ligSets,
});
}
@ -105,7 +105,7 @@ async function main(argv) {
fontFamily: "Iosevka",
fontStyle: "normal",
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, {
hSize: 1,
@ -114,7 +114,7 @@ async function main(argv) {
fontFamily: "Iosevka",
fontStyle: "italic",
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, {
fontFeatures: variant.snapshotFeatureApplication || { [cv.tag]: variant.rank },
slopeDependent: !!cv.slopeDependent,
hotChars: cv.hotChars
hotChars: cv.hotChars,
});
}
}

View file

@ -15,12 +15,12 @@ export default (function (args) {
"font-family": "Iosevka",
"font-weight": 500,
"font-width": 6,
"font-size": EM
"font-size": EM,
},
[{ color: theme.body }, args.text],
[{ color: theme.stress }, args.stressText || ""]
]
}
]
[{ color: theme.stress }, args.stressText || ""],
],
},
],
};
});

View file

@ -25,8 +25,8 @@ function CharGrid(args) {
{ "font-weight": 600 },
{ "font-size": 0.5 * EM },
{ color: theme.body },
offset.toString(16).toUpperCase()
]
offset.toString(16).toUpperCase(),
],
});
}
@ -45,8 +45,8 @@ function CharGrid(args) {
{ "font-weight": 600 },
{ "font-size": 0.5 * EM },
{ 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,
right: (ITEMS_START_X + (char.lch % ITEMS_PER_ROW) + 1) * ITEM_SIZE * EM,
top: rows * ITEM_SIZE * EM,
bottom: (rows + 1) * ITEM_SIZE * EM
bottom: (rows + 1) * ITEM_SIZE * EM,
};
const fontSettings = [
{ "font-family": "Iosevka" },
{ "font-weight": 400 },
{ "font-size": EM }
{ "font-size": EM },
];
if (isMark) {
// Dotted circle
frames.push({
...dimensions,
contents: [...fontSettings, { color: theme.stress }, "\u25CC"]
contents: [...fontSettings, { color: theme.stress }, "\u25CC"],
});
}
frames.push({
@ -76,8 +76,8 @@ function CharGrid(args) {
contents: [
...fontSettings,
{ 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 {
width: (ITEMS_PER_ROW + ITEMS_START_X) * ITEM_SIZE * EM,
height: rows * ITEM_SIZE * EM,
frames
frames,
};
}

View file

@ -20,14 +20,14 @@ export default (function (args) {
{ "font-style": slope },
{ "font-feature-settings": { ...args.fontFeatures, dlig: 1 } },
{ color: theme.body },
ch
]
ch,
],
});
}
}
return {
width: unitWidth * frames.length,
height: 160,
frames
frames,
};
});

View file

@ -15,11 +15,11 @@ export default (function (args) {
"font-family": "Iosevka",
"font-weight": 100,
"font-size": EM,
color: theme.body
color: theme.body,
},
"Iosevka"
]
}
]
"Iosevka",
],
},
],
};
});

View file

@ -62,10 +62,10 @@ export default (function (args) {
"font-size": EM,
"font-weight": 600,
"font-style": "italic",
color: theme.title
color: theme.title,
},
lang
]
lang,
],
});
frames.push({
top,
@ -79,10 +79,10 @@ export default (function (args) {
"font-family": "Iosevka",
"font-size": EM,
...(localeId ? { lang: localeId } : {}),
color: theme.body
color: theme.body,
},
sample
]
sample,
],
});
}
return { width: canvasWidth, height: canvasHeight, frames };

View file

@ -47,9 +47,9 @@ export default (function (args) {
{ "font-family": args.fontFamily, "font-style": args.fontStyle },
{ "font-size": 24, color: theme.body },
{ "font-feature-settings": { [args.tag]: args.rank } },
trimNewline([...makeSample(theme, args)])
]
}
]
trimNewline([...makeSample(theme, args)]),
],
},
],
};
});

View file

@ -14,7 +14,7 @@ export default (function (args) {
[-(1 / 4), "Iosevka", "oblique"],
[+(1 / 4), "Iosevka Slab", "oblique"],
[-(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];
let frames = [];
@ -35,10 +35,10 @@ export default (function (args) {
"font-weight": weight,
"font-style": slope,
"font-size": EM,
color: theme.body
color: theme.body,
},
"Mag"
]
"Mag",
],
});
}
}
@ -57,10 +57,10 @@ export default (function (args) {
"font-weight": 100,
"font-style": "normal",
"font-size": 3 * EM,
color: theme.sigil
color: theme.sigil,
},
"\uEF10"
]
"\uEF10",
],
});
return { width: canvasWidth, height: canvasHeight + sigilHeight, frames };

View file

@ -41,9 +41,9 @@ export default (function (args) {
{ "font-family": args.fontFamily, "font-style": args.fontStyle },
{ "font-size": 24, color: theme.body },
{ "font-feature-settings": { calt: 1, ...args.fontFeatures } },
trimNewline([...makeSample(args.lineBreakMode, args.hotChars)])
]
}
]
trimNewline([...makeSample(args.lineBreakMode, args.hotChars)]),
],
},
],
};
});

View file

@ -49,10 +49,10 @@ export default (function (args) {
{ "font-size": 24, color: theme.body },
{ "font-feature-settings": { calt: 1 } },
trimNewline([
...makeSample(theme, args.lineBreakMode, args.fontFeatures, args.hotChars)
])
]
}
]
...makeSample(theme, args.lineBreakMode, args.fontFeatures, args.hotChars),
]),
],
},
],
};
});

View file

@ -20,13 +20,13 @@ export default (function (args) {
"font-family": "Iosevka",
"font-weight": weight,
"font-size": EM,
color: theme.body
color: theme.body,
},
[{ color: theme.title }, "float"],
" Fox.quick(h){ is_brown ",
[{ color: theme.stress }, "&&"],
" it_jumps_over(dogs.lazy); }"
]
" it_jumps_over(dogs.lazy); }",
],
});
}
return { width: canvasWidth, height: canvasHeight, frames };

View file

@ -3,12 +3,12 @@ export const light = {
dimmed: "#20242E40",
stress: "#048FBF",
sigil: "#974caf",
title: "#8757AD"
title: "#8757AD",
};
export const dark = {
body: "#DEE4E3",
dimmed: "#DEE4E340",
stress: "#03AEE9",
sigil: "#c49ed1",
title: "#B77FDB"
title: "#B77FDB",
};

View file

@ -46,7 +46,7 @@ async function main() {
out.push({
scriptTag: key.split("-")[0],
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` +
`export default ` +
JSON.stringify(out, null, "\t") +
";\n"
";\n",
);
}
@ -171,74 +171,74 @@ const LatinBase = {
All(
Script("Latin"),
Either(GeneralCategory("Uppercase_Letter"), GeneralCategory("Lowercase_Letter")),
Not(Block("Halfwidth_And_Fullwidth_Forms"))
Not(Block("Halfwidth_And_Fullwidth_Forms")),
),
Block("Currency_Symbols"),
All(Block("Letterlike_Symbols"), Not(In("℀℁⅍℠℡™℻")))
)
All(Block("Letterlike_Symbols"), Not(In("℀℁⅍℠℡™℻"))),
),
};
const CyrillicBase = {
scriptTag: "cyrl",
featureTag: "dflt",
filter: All(
Script("Cyrillic"),
Either(GeneralCategory("Uppercase_Letter"), GeneralCategory("Lowercase_Letter"))
)
Either(GeneralCategory("Uppercase_Letter"), GeneralCategory("Lowercase_Letter")),
),
};
const GreekBase = {
scriptTag: "grek",
featureTag: "dflt",
filter: All(
Script("Greek"),
Either(GeneralCategory("Uppercase_Letter"), GeneralCategory("Lowercase_Letter"))
)
Either(GeneralCategory("Uppercase_Letter"), GeneralCategory("Lowercase_Letter")),
),
};
const DigitBase = {
scriptTag: "latn",
featureTag: "dflt",
filter: Either(In("0123456789"))
filter: Either(In("0123456789")),
};
const LatinSubscript = {
scriptTag: "latb",
featureTag: "dflt",
filter: Either(In("ₐₑₔₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓ"))
filter: Either(In("ₐₑₔₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓ")),
};
const GreekSubscript = {
scriptTag: "latb",
featureTag: "dflt",
filter: Either(In("ᵦᵧᵨᵩᵪ"))
filter: Either(In("ᵦᵧᵨᵩᵪ")),
};
const CyrillicSubscript = {
scriptTag: "latb",
featureTag: "dflt",
filter: Either(In("𞁑𞁒𞁓𞁔𞁧𞁕𞁖𞁗𞁘𞁩𞁙𞁨𞁚𞁛𞁜𞁝𞁞𞁟𞁠𞁡𞁢𞁣𞁪𞁤𞁥𞁦"))
filter: Either(In("𞁑𞁒𞁓𞁔𞁧𞁕𞁖𞁗𞁘𞁩𞁙𞁨𞁚𞁛𞁜𞁝𞁞𞁟𞁠𞁡𞁢𞁣𞁪𞁤𞁥𞁦")),
};
const DigitSubscript = {
scriptTag: "latb",
featureTag: "dflt",
filter: Either(In("₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎"))
filter: Either(In("₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎")),
};
const LatinSuperscript = {
scriptTag: "latp",
featureTag: "dflt",
filter: Either(In("ªº"), All(Script("Latin"), Either(GeneralCategory("Modifier_Letter"))))
filter: Either(In("ªº"), All(Script("Latin"), Either(GeneralCategory("Modifier_Letter")))),
};
const GreekSuperscript = {
scriptTag: "latp",
featureTag: "dflt",
filter: All(Script("Greek"), Either(GeneralCategory("Modifier_Letter")))
filter: All(Script("Greek"), Either(GeneralCategory("Modifier_Letter"))),
};
const CyrillicSuperscript = {
scriptTag: "latp",
featureTag: "dflt",
filter: All(Script("Cyrillic"), Either(GeneralCategory("Modifier_Letter")))
filter: All(Script("Cyrillic"), Either(GeneralCategory("Modifier_Letter"))),
};
const DigitSuperscript = {
scriptTag: "latp",
featureTag: "dflt",
filter: Either(In("⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾"))
filter: Either(In("⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾")),
};
const LatinPunctuation = {
@ -248,8 +248,8 @@ const LatinPunctuation = {
Block("Basic_Latin"),
Block("Latin_1_Supplement"),
Block("General_Punctuation"),
Block("Supplemental_Punctuation")
)
Block("Supplemental_Punctuation"),
),
};
const Targets = [
@ -265,5 +265,5 @@ const Targets = [
DigitBase,
DigitSubscript,
DigitSuperscript,
LatinPunctuation
LatinPunctuation,
];

View file

@ -4,7 +4,7 @@ import fs from "fs";
const WebfontFormatMap = new Map([
["WOFF2", "woff2"],
["TTF", "truetype"]
["TTF", "truetype"],
]);
export default function (output, family, hs, formats, unhinted) {
@ -22,7 +22,7 @@ export default function (output, family, hs, formats, unhinted) {
.map(
ext =>
`url('${ext}${dirSuffix}/${term.name}.${ext}') ` +
`format('${WebfontFormatMap.get(ext)}')`
`format('${WebfontFormatMap.get(ext)}')`,
)
.join(", ");
ans += `

View file

@ -19,7 +19,7 @@ setTimeout(
console.error(e);
process.exit(1);
}),
0
0,
);
///////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -89,11 +89,11 @@ const InstalledVersion = computed.make(
if (!semver.satisfies(depPkg.version, required)) {
fail(
`Package version for ${pkg} is outdated:`,
`Required ${required}, Installed ${depPkg.version}`
`Required ${required}, Installed ${depPkg.version}`,
);
}
return { name: pkg, actual: depPkg.version, required };
}
},
);
///////////////////////////////////////////////////////////
@ -121,7 +121,7 @@ async function tryParseToml(str) {
throw new Error(
`Failed to parse configuration file ${str}.\n` +
`Please validate whether there's syntax error.\n` +
`${e}`
`${e}`,
);
}
}
@ -202,7 +202,7 @@ function rectifyPlanForSpacingDerive(p) {
buildCharMap: false,
snapshotFamily: null,
snapshotFeature: null,
targets: null
targets: null,
};
}
@ -250,7 +250,7 @@ const FontInfoOf = computed.group("metadata:font-info-of", async (target, fileNa
spacingDerive = {
manner: bp.spacing,
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,
noLigation: bp.noLigation || false,
exportGlyphNames: bp.exportGlyphNames || false,
buildTextureFeature: bp.buildTextureFeature || false
buildTextureFeature: bp.buildTextureFeature || false,
},
// Ligations
ligations: bp.ligations || null,
@ -274,7 +274,7 @@ const FontInfoOf = computed.group("metadata:font-info-of", async (target, fileNa
weight: sfi.shapeWeight,
width: sfi.shapeWidth,
slope: sfi.shapeSlope,
slopeAngle: sfi.shapeSlopeAngle
slopeAngle: sfi.shapeSlopeAngle,
},
// Menu
menu: {
@ -282,13 +282,13 @@ const FontInfoOf = computed.group("metadata:font-info-of", async (target, fileNa
version: version,
width: sfi.menuWidth,
slope: sfi.menuSlope,
weight: sfi.menuWeight
weight: sfi.menuWeight,
},
// CSS
css: {
weight: sfi.cssWeight,
stretch: sfi.cssStretch,
style: sfi.cssStyle
style: sfi.cssStyle,
},
// Hinting
hintParams: bp.hintParams || [],
@ -303,7 +303,7 @@ const FontInfoOf = computed.group("metadata:font-info-of", async (target, fileNa
excludedCharRanges: bp.excludeChars?.ranges,
// 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),
shapeSlopeAngle: nValidate("Angle of " + s, slopeDef.angle, VlSlopeAngle),
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 [deriveFrom] = await target.need(
DistUnhintedTTF(spD.prefix, spD.fileName),
de(charMapPath.dir)
de(charMapPath.dir),
);
echo.action(echo.hl.command(`Create TTF`), out.full);
@ -418,7 +418,7 @@ const DistUnhintedTTF = file.make(
o: out.full,
paramsDir: Path.resolve("params"),
oNoGc: noGcTtfPath.full,
...fi
...fi,
});
} else {
// Ab-initio build
@ -432,7 +432,7 @@ const DistUnhintedTTF = file.make(
CompositesFromBuildPlan,
de(charMapPath.dir),
de(ttfaControlsPath.dir),
de(SHARED_CACHE)
de(SHARED_CACHE),
);
echo.action(echo.hl.command(`Create TTF`), out.full);
@ -445,7 +445,7 @@ const DistUnhintedTTF = file.make(
iCache: cachePath,
oCache: cacheDiffPath,
compositesFromBuildPlan: comps,
...fi
...fi,
});
if (cacheUpdated) {
@ -455,37 +455,37 @@ const DistUnhintedTTF = file.make(
base: cachePath,
diff: cacheDiffPath,
version: fi.menu.version,
freshAgeKey: ageKey
freshAgeKey: ageKey,
});
lock.release();
}
}
}
},
);
const BuildCM = file.make(
(gr, f) => `${BUILD}/TTF/${gr}/${f}.charmap.mpz`,
async (target, output, gr, f) => {
await target.need(DistUnhintedTTF(gr, f));
}
},
);
const BuildTtfaControls = file.make(
(gr, f) => `${BUILD}/TTF/${gr}/${f}.ttfa.txt`,
async (target, output, gr, f) => {
await target.need(DistUnhintedTTF(gr, f));
}
},
);
const BuildNoGcUnhintedTtfImpl = file.make(
(gr, f) => `${BUILD}/TTF/${gr}/${f}.no-gc.ttf`,
async (target, output, gr, f) => {
await target.need(DistUnhintedTTF(gr, f));
}
},
);
const BuildNoGcTtfImpl = file.make(
(gr, f) => `${BUILD}/TTF/${gr}/${f}.no-gc.hinted.ttf`,
async (target, output, gr, f) => {
await target.need(DistHintedTTF(gr, f));
}
},
);
const DistHintedTTF = file.make(
@ -494,7 +494,7 @@ const DistHintedTTF = file.make(
const [fi, hint] = await target.need(
FontInfoOf(fn),
CheckTtfAutoHintExists,
de`${out.dir}`
de`${out.dir}`,
);
if (fi.spacingDerive) {
// 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(
DistHintedTTF(spD.prefix, spD.fileName),
de(noGcTtfPath.dir)
de(noGcTtfPath.dir),
);
echo.action(echo.hl.command(`Hint TTF`), out.full);
@ -514,17 +514,17 @@ const DistHintedTTF = file.make(
oNoGc: noGcTtfPath.full,
o: out.full,
paramsDir: Path.resolve("params"),
...fi
...fi,
});
} else {
const [from, ttfaControls] = await target.need(
DistUnhintedTTF(gr, fn),
BuildTtfaControls(gr, fn)
BuildTtfaControls(gr, fn),
);
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);
}
}
},
);
const BuildNoGcTtf = task.make(
@ -538,7 +538,7 @@ const BuildNoGcTtf = task.make(
const [distUnhinted] = await target.need(DistHintedTTF(gr, fn));
return distUnhinted;
}
}
},
);
function formatSuffix(fmt, unhinted) {
@ -552,7 +552,7 @@ const DistWoff2 = file.make(
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);
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));
await target.need(de(out.dir));
await createWebFontCssImpl(target, out.full, gr, plan.webfontFormats, unhinted);
}
},
);
async function createWebFontCssImpl(target, output, gr, formats, unhinted) {
const [bp, ts] = await target.need(BuildPlanOf(gr), GroupFontsOf(gr));
@ -608,7 +608,7 @@ async function createWebFontCssImpl(target, output, gr, formats, unhinted) {
bp.family,
hs,
formats,
unhinted
unhinted,
);
}
@ -620,7 +620,7 @@ const GroupTtfsImpl = task.make(
const [ts] = await target.need(GroupFontsOf(gr));
await target.need(ts.map(tn => Ctor(gr, tn)));
return gr;
}
},
);
const GroupWoff2Impl = task.make(
(gr, unhinted) => `group-${formatSuffix("WOFF2Impl", unhinted)}::${gr}`,
@ -628,7 +628,7 @@ const GroupWoff2Impl = task.make(
const [ts] = await target.need(GroupFontsOf(gr));
await target.need(ts.map(tn => DistWoff2(gr, tn, unhinted)));
return gr;
}
},
);
const GroupWebFontsImpl = task.make(
(gr, unhinted) => `group-${formatSuffix("WebFontImpl", unhinted)}::${gr}`,
@ -647,7 +647,7 @@ const GroupWebFontsImpl = task.make(
}
await target.need(groupsNeeded, DistWebFontCSS(gr, unhinted));
return gr;
}
},
);
///////////////////////////////////////////////////////////
@ -708,7 +708,7 @@ async function getCollectPlans(target, rawCollectPlans) {
ttcComposition,
groupDecomposition: [...collect.from],
inRelease: !!collect.release,
isAmended: !!collect.isAmended
isAmended: !!collect.isAmended,
};
}
return plans;
@ -736,7 +736,7 @@ function fnStandardTtc(fIsGlyfTtc, prefix, suffixMapping, sfi) {
optimalSfi.weight,
optimalSfi.width,
optimalSfi.slope,
DEFAULT_SUBFAMILY
DEFAULT_SUBFAMILY,
)}`;
}
@ -760,7 +760,7 @@ const CollectedSuperTtcFile = file.make(
const parts = Array.from(Object.keys(cp[cgr].glyfTtcComposition));
const [inputs] = await target.need(parts.map(pt => GlyfTtc(cgr, pt)));
await buildCompositeTtc(out, inputs);
}
},
);
const CollectedTtcFile = file.make(
(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 [inputs] = await target.need(parts.map(pt => GlyfTtc(cgr, pt)));
await buildCompositeTtc(out, inputs);
}
},
);
const GlyfTtc = file.make(
(cgr, f) => `${GLYF_TTC}/${cgr}/${f}.ttc`,
@ -777,7 +777,7 @@ const GlyfTtc = file.make(
const [cp] = await target.need(CollectPlans);
const parts = cp[cgr].glyfTtcComposition[f];
await buildGlyphSharingTtc(target, parts, out);
}
},
);
async function buildCompositeTtc(out, inputs) {
@ -806,14 +806,14 @@ const TtcZip = file.make(
const ttcFiles = Array.from(Object.keys(cPlan[cgr].ttcComposition));
await target.need(ttcFiles.map(pt => CollectedTtcFile(cgr, pt)));
await CreateGroupArchiveFile(`${DIST_TTC}/${cgr}`, out, `*.ttc`);
}
},
);
const SuperTtcZip = file.make(
(cgr, version) => `${ARCHIVE_DIR}/SuperTTC-${cgr}-${version}.zip`,
async (target, out, cgr) => {
await target.need(de`${out.dir}`, CollectedSuperTtcFile(cgr));
await CreateGroupArchiveFile(DIST_SUPER_TTC, out, `${cgr}.ttc`);
}
},
);
// Single-group Archives
@ -826,9 +826,9 @@ const GroupTtfZip = file.make(
await CreateGroupArchiveFile(
`${DIST}/${gr}/${formatSuffix("TTF", unhinted)}`,
out,
"*.ttf"
"*.ttf",
);
}
},
);
const GroupWebZip = file.make(
(gr, version, unhinted) =>
@ -841,9 +841,9 @@ const GroupWebZip = file.make(
`${DIST}/${gr}`,
out,
`${formatSuffix(gr, unhinted)}.css`,
...plan.webfontFormats.map(format => formatSuffix(format, unhinted))
...plan.webfontFormats.map(format => formatSuffix(format, unhinted)),
);
}
},
);
async function CreateGroupArchiveFile(dir, out, ...files) {
@ -854,7 +854,7 @@ async function CreateGroupArchiveFile(dir, out, ...files) {
[SEVEN_ZIP, "a"],
["-tzip", "-r", "-mx=9", "-mmt=off"],
relOut,
...files
...files,
);
}
@ -875,7 +875,7 @@ const Pages = task(`pages`, async t => {
PagesFontExport`IosevkaQp`,
PagesFontExport`IosevkaQpSlab`,
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(
BuildCM("Iosevka", "Iosevka-Regular"),
BuildCM("Iosevka", "Iosevka-Italic"),
BuildCM("Iosevka", "Iosevka-Oblique")
BuildCM("Iosevka", "Iosevka-Oblique"),
);
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`, {
version,
@ -903,7 +903,7 @@ const PagesDataExport = task(`pages:data-export`, async t => {
charMapItalicPath: cmi.full,
charMapObliquePath: cmo.full,
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/cv-influences.md"),
AmendReadmeFor("doc/PACKAGE-LIST.md"),
AmendLicenseYear
AmendLicenseYear,
);
});
const AmendReadmeFor = task.make(
@ -958,7 +958,7 @@ const AmendReadmeFor = task.make(
const [cm, cmi, cmo] = await target.need(
BuildCM("Iosevka", "Iosevka-Regular"),
BuildCM("Iosevka", "Iosevka-Italic"),
BuildCM("Iosevka", "Iosevka-Oblique")
BuildCM("Iosevka", "Iosevka-Oblique"),
);
return node(`tools/amend-readme/src/index.mjs`, {
version,
@ -968,9 +968,9 @@ const AmendReadmeFor = task.make(
releasePackagesJsonPath: rpFiles.full,
charMapPath: cm.full,
charMapItalicPath: cmi.full,
charMapObliquePath: cmo.full
charMapObliquePath: cmo.full,
});
}
},
);
const ReleaseNotePackagesFile = file(`${BUILD}/release-packages.json`, async (t, out) => {
const [cp] = await t.need(CollectPlans);
@ -985,20 +985,20 @@ const ReleaseNotePackagesFile = file(`${BUILD}/release-packages.json`, async (t,
subGroups[gr] = {
family: bp.family,
desc: bp.desc,
spacing: buildPlans[gr].spacing || "type"
spacing: buildPlans[gr].spacing || "type",
};
}
releaseNoteGroups[k] = {
subGroups,
slab: primePlan.serifs === "slab",
quasiProportional: primePlan.spacing === "quasi-proportional"
quasiProportional: primePlan.spacing === "quasi-proportional",
};
}
await FS.promises.writeFile(out.full, JSON.stringify(releaseNoteGroups, null, " "));
});
const AmendLicenseYear = task("amend-readme:license-year", async target => {
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(`IosevkaSlab`, false),
GroupTtfsImpl(`IosevkaAile`, false),
GroupTtfsImpl(`IosevkaEtoile`, false)
GroupTtfsImpl(`IosevkaEtoile`, false),
);
const [cm, cmi, cmo] = await target.need(
BuildCM("Iosevka", "Iosevka-Regular"),
BuildCM("Iosevka", "Iosevka-Italic"),
BuildCM("Iosevka", "Iosevka-Oblique")
BuildCM("Iosevka", "Iosevka-Oblique"),
);
return await node("tools/generate-samples/src/index.mjs", {
version,
@ -1033,7 +1033,7 @@ const SampleImagesPre = task(`sample-images:pre`, async target => {
fontGroups: fontGroups,
charMapPath: cm.full,
charMapItalicPath: cmi.full,
charMapObliquePath: cmo.full
charMapObliquePath: cmo.full,
});
});
const PackageSnapshotConfig = async target => {
@ -1045,7 +1045,7 @@ const PackageSnapshotConfig = async target => {
cfg.push({
name: "package-sample-" + key,
fontFamily: p.snapshotFamily,
fontFeatures: p.snapshotFeature
fontFeatures: p.snapshotFeature,
});
}
return cfg;
@ -1059,9 +1059,9 @@ const ScreenShotImpl = file.make(
await run(rp.buildOptions.snapshotGeneratorApp, [
`${IMAGE_TASKS}/${id}.json`,
"-o",
out.full
out.full,
]);
}
},
);
///////////////////////////////////////////////////////////
@ -1079,9 +1079,9 @@ const ReleaseNotesFile = file.make(
await t.need(changeFiles.map(fu));
await node("tools/amend-readme/src/generate-release-note.mjs", {
version,
outputPath: out.full
outputPath: out.full,
});
}
},
);
const ChangeLog = task(`release:change-log`, async t => {
@ -1096,7 +1096,7 @@ const ChangeLogMd = file(`CHANGELOG.md`, async (t, out) => {
});
const ChangeFileList = oracle.make(
() => `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 = [
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(
(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 [mjs, md] = await target.need(ScriptsUnder("mjs", "tools"), ScriptsUnder("md", "tools"));
@ -1175,7 +1175,7 @@ const CompiledJs = file.make(
await target.need(sfu(ptl));
echo.action(echo.hl.command("Compile Script"), ptl);
await silently.run(PATEL_C, "--strict", "--esm", ptl, "-o", out.full);
}
},
);
const Scripts = task("scripts", async target => {
const [jsFromPtlList] = await target.need(JavaScriptFromPtl);
@ -1201,7 +1201,7 @@ const Parameters = task(`meta:parameters`, async target => {
sfu`params/shape-slope.toml`,
ofu`params/private-parameters.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]) {
fail(
`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) {
fail(
`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,
buildPlans,
defaultConfig,
updatedDes
updatedDes,
);
} else {
return defaultConfig[aspectName];
@ -1306,12 +1306,12 @@ function validateRecommendedWeight(w, value, label) {
semibold: 600,
bold: 700,
extrabold: 800,
heavy: 900
heavy: 900,
};
if (RecommendedMenuWeights[w] && RecommendedMenuWeights[w] !== value) {
echo.warn(
`${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));
echo.warn(
`The build plan is using legacy width grade ${x}. ` +
`Converting to unit width ${xCorrected}.`
`Converting to unit width ${xCorrected}.`,
);
g_widthFixupMemory.set(x, xCorrected);
return xCorrected;
} else {
return x;
}
}
},
};
const VlMenuWidth = { validate: x => x >= 1 && x <= 9 && x % 1 === 0 };
const VlSlopeAngle = { validate: x => x >= 0 && x <= 15 };
@ -1376,7 +1376,7 @@ const VlCssFontStretch = {
x == "semi-expanded" ||
x == "expanded" ||
x == "extra-expanded" ||
x == "ultra-expanded"
x == "ultra-expanded",
};
// Utilities