Add automated change file generation
This commit is contained in:
parent
78f0fb89e4
commit
799c5027e7
20 changed files with 1044 additions and 808 deletions
24
.editorconfig
Normal file
24
.editorconfig
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.{js,jsx,ts,tsx}]
|
||||||
|
insert_final_newline = true
|
||||||
|
block_comment_start = /*
|
||||||
|
block_comment = *
|
||||||
|
block_comment_end = */
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
insert_final_newline = false
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
# The indent size used in the `package.json` file cannot be changed
|
||||||
|
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
|
||||||
|
[{*.yml,*.yaml,package.json}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
|
@ -14,11 +14,12 @@
|
||||||
"extends": "eslint:recommended",
|
"extends": "eslint:recommended",
|
||||||
"rules": {
|
"rules": {
|
||||||
"indent": ["error", "tab", { "SwitchCase": 1 }],
|
"indent": ["error", "tab", { "SwitchCase": 1 }],
|
||||||
"linebreak-style": ["error", "windows"],
|
|
||||||
"quotes": ["error", "double", { "allowTemplateLiterals": true }],
|
"quotes": ["error", "double", { "allowTemplateLiterals": true }],
|
||||||
"semi": ["error", "always"],
|
"semi": ["error", "always"],
|
||||||
"no-var":"error",
|
"no-var": "error",
|
||||||
"no-console": 0,
|
"no-console": 0,
|
||||||
"no-constant-condition": ["error", { "checkLoops": false }]
|
"no-constant-condition": ["error", { "checkLoops": false }],
|
||||||
|
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
|
||||||
|
"no-unused-vars": ["off"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -63,3 +63,6 @@ package-lock.json
|
||||||
private.toml
|
private.toml
|
||||||
private-build-plans.toml
|
private-build-plans.toml
|
||||||
private.mk
|
private.mk
|
||||||
|
|
||||||
|
# Ignore tmp directory
|
||||||
|
tmp
|
1
.npmrc
Normal file
1
.npmrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
package-lock=false
|
4
changes/3.0.0-alpha.1.md
Normal file
4
changes/3.0.0-alpha.1.md
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
* The letters `k`, `x`, `v`, `A`, etc. will now use straight legs by default. The “curly” families will keep the old shape.
|
||||||
|
* Note this is a parameter difference rather than variant. So there won’t be a `cv##` or `ss##` variant selector.
|
||||||
|
* Introduced a curly italic `k` with untagged variant `v-k-italic`.
|
||||||
|
* Introduced `ss12` OpenType tag for Ubuntu-Mono style as well as a prebuilt `SS12` family.
|
10
changes/3.0.0-alpha.2.md
Normal file
10
changes/3.0.0-alpha.2.md
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
* Extended width will be built automatically and integrate into existing families.
|
||||||
|
* Added more letter-like symbols: `⅋`, `ℂ`, `ℍ`, `ℙ`, `ℕ`, `ℚ`, `ℝ`, `ℤ`, `ℵ`, `ℶ`.
|
||||||
|
* Refine the height of brackets and symbols.
|
||||||
|
* Renamed various variant selectors:
|
||||||
|
* `v-m-longleg` → `v-m-normal`
|
||||||
|
* `v-one-hooky` → `v-one-nobase`
|
||||||
|
* `v-one-serifed` → `v-one-base`
|
||||||
|
* `v-seven-normal` → `v-seven-noserif`
|
||||||
|
* `v-seven-force-serifed` → `v-seven-serifed`
|
||||||
|
* Added `v-lig-ltgteq-flat` (`cv66`) and `v-lig-ltgteq-slanted` (`cv67`) to change the shape of `<=` and `>=` ligation.
|
3
changes/3.0.0-alpha.3.md
Normal file
3
changes/3.0.0-alpha.3.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
* Added ligation for `~>`, `<~`, `~~>`, etc.
|
||||||
|
* Further refined the shapes of APL symbols.
|
||||||
|
* Added old-style numbers. Feature `onum` and `lnum` are enabled.
|
7
changes/3.0.0-alpha.4.md
Normal file
7
changes/3.0.0-alpha.4.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
* Added three-line ligation of `===` and `!==` for JavaScript, PHP, etc.
|
||||||
|
* Default ligature set selector: `ligset-javascript` and `ligset-php`.
|
||||||
|
* Cherry-picking configuration selector: `eqeqeq` and `exeqeq`.
|
||||||
|
* OpenType tags: `XJS0`, `XPHP`.
|
||||||
|
* Exposed curly-vs-straight letterform selectors.
|
||||||
|
* OpenType tags are from `cv70` to `cv83`.
|
||||||
|
* Fixed style linking for extended variants.
|
0
changes/3.0.0-alpha.5.md
Normal file
0
changes/3.0.0-alpha.5.md
Normal file
36
gen/gc.js
36
gen/gc.js
|
@ -1,18 +1,18 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const { Workflow, introduce, build, gc } = require("megaminx");
|
const { Workflow, introduce, build, gc } = require("megaminx");
|
||||||
const argv = require("yargs").argv;
|
const argv = require("yargs").argv;
|
||||||
|
|
||||||
async function recipe(ctx, config, argv) {
|
async function recipe(ctx, config, argv) {
|
||||||
const a = await ctx.run(introduce, "a", { from: argv.i });
|
const a = await ctx.run(introduce, "a", { from: argv.i });
|
||||||
await ctx.run(gc, "a");
|
await ctx.run(gc, "a");
|
||||||
await ctx.run(build, "a", { to: argv.o, optimize: true });
|
await ctx.run(build, "a", { to: argv.o, optimize: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const config = {};
|
const config = {};
|
||||||
const flow = new Workflow(config);
|
const flow = new Workflow(config);
|
||||||
await flow.run(recipe, config, argv);
|
await flow.run(recipe, config, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
main();
|
main();
|
||||||
|
|
228
gen/generator.js
228
gen/generator.js
|
@ -1,114 +1,114 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
const argv = require("yargs").argv;
|
const argv = require("yargs").argv;
|
||||||
const buildGlyphs = require("./build-glyphs.js");
|
const buildGlyphs = require("./build-glyphs.js");
|
||||||
const parameters = require("../support/parameters");
|
const parameters = require("../support/parameters");
|
||||||
const formVariantData = require("../support/variant-data");
|
const formVariantData = require("../support/variant-data");
|
||||||
const regulateGlyphs = require("../support/regulate-glyph");
|
const regulateGlyphs = require("../support/regulate-glyph");
|
||||||
const toml = require("toml");
|
const toml = require("toml");
|
||||||
|
|
||||||
function objHashNonEmpty(obj) {
|
function objHashNonEmpty(obj) {
|
||||||
if (!obj) return false;
|
if (!obj) return false;
|
||||||
for (let k in obj) if (obj[k]) return true;
|
for (let k in obj) if (obj[k]) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PARAMETERS_TOML = path.resolve(__dirname, "../parameters.toml");
|
const PARAMETERS_TOML = path.resolve(__dirname, "../parameters.toml");
|
||||||
const PRIVATE_TOML = path.resolve(__dirname, "../private.toml");
|
const PRIVATE_TOML = path.resolve(__dirname, "../private.toml");
|
||||||
const VARIANTS_TOML = path.resolve(__dirname, "../variants.toml");
|
const VARIANTS_TOML = path.resolve(__dirname, "../variants.toml");
|
||||||
const EMPTY_FONT_TOML = path.resolve(__dirname, "../empty-font.toml");
|
const EMPTY_FONT_TOML = path.resolve(__dirname, "../empty-font.toml");
|
||||||
|
|
||||||
function tryParseToml(str) {
|
function tryParseToml(str) {
|
||||||
try {
|
try {
|
||||||
return toml.parse(fs.readFileSync(str, "utf-8"));
|
return toml.parse(fs.readFileSync(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}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getParameters(argv) {
|
function getParameters(argv) {
|
||||||
const parametersData = Object.assign(
|
const parametersData = Object.assign(
|
||||||
{},
|
{},
|
||||||
tryParseToml(PARAMETERS_TOML),
|
tryParseToml(PARAMETERS_TOML),
|
||||||
fs.existsSync(PRIVATE_TOML) ? tryParseToml(PRIVATE_TOML) : []
|
fs.existsSync(PRIVATE_TOML) ? tryParseToml(PRIVATE_TOML) : []
|
||||||
);
|
);
|
||||||
const variantData = tryParseToml(VARIANTS_TOML);
|
const variantData = tryParseToml(VARIANTS_TOML);
|
||||||
|
|
||||||
const para = parameters.build(parametersData, argv._);
|
const para = parameters.build(parametersData, argv._);
|
||||||
const variantsData = formVariantData(variantData, para);
|
const variantsData = formVariantData(variantData, para);
|
||||||
para.variants = variantsData;
|
para.variants = variantsData;
|
||||||
para.variantSelector = parameters.build(variantsData, argv._);
|
para.variantSelector = parameters.build(variantsData, argv._);
|
||||||
para.defaultVariant = variantsData.default;
|
para.defaultVariant = variantsData.default;
|
||||||
|
|
||||||
para.naming = {
|
para.naming = {
|
||||||
family: argv.family,
|
family: argv.family,
|
||||||
version: argv.ver,
|
version: argv.ver,
|
||||||
weight: argv["menu-weight"] - 0,
|
weight: argv["menu-weight"] - 0,
|
||||||
width: argv["menu-width"] - 0,
|
width: argv["menu-width"] - 0,
|
||||||
slant: argv["menu-slant"]
|
slant: argv["menu-slant"]
|
||||||
};
|
};
|
||||||
|
|
||||||
return para;
|
return para;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Font building
|
// Font building
|
||||||
const font = (function() {
|
const font = (function() {
|
||||||
const emptyFont = tryParseToml(EMPTY_FONT_TOML);
|
const emptyFont = tryParseToml(EMPTY_FONT_TOML);
|
||||||
const para = getParameters(argv);
|
const para = getParameters(argv);
|
||||||
const font = buildGlyphs.build.call(emptyFont, para);
|
const font = buildGlyphs.build.call(emptyFont, para);
|
||||||
font.parameters = para;
|
font.parameters = para;
|
||||||
return font;
|
return font;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
if (argv.charmap) {
|
if (argv.charmap) {
|
||||||
const charmap = font.glyf.map(function(glyph) {
|
const charmap = font.glyf.map(function(glyph) {
|
||||||
const isSpace = glyph.contours && glyph.contours.length ? 2 : 0;
|
const isSpace = glyph.contours && glyph.contours.length ? 2 : 0;
|
||||||
return [
|
return [
|
||||||
glyph.name,
|
glyph.name,
|
||||||
glyph.unicode,
|
glyph.unicode,
|
||||||
glyph.advanceWidth === 0 ? (objHashNonEmpty(glyph.anchors) ? 1 : isSpace ? 2 : 0) : 0
|
glyph.advanceWidth === 0 ? (objHashNonEmpty(glyph.anchors) ? 1 : isSpace ? 2 : 0) : 0
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
fs.writeFileSync(argv.charmap, JSON.stringify(charmap), "utf8");
|
fs.writeFileSync(argv.charmap, JSON.stringify(charmap), "utf8");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argv.o) {
|
if (argv.o) {
|
||||||
const skew = Math.tan(((font.post.italicAngle || 0) / 180) * Math.PI);
|
const skew = Math.tan(((font.post.italicAngle || 0) / 180) * Math.PI);
|
||||||
|
|
||||||
regulateGlyphs(font, skew);
|
regulateGlyphs(font, skew);
|
||||||
|
|
||||||
// finalize
|
// finalize
|
||||||
const excludedCodePoints = new Set();
|
const excludedCodePoints = new Set();
|
||||||
if (font.parameters.excludedCodePointRanges) {
|
if (font.parameters.excludedCodePointRanges) {
|
||||||
for (const [start, end] of font.parameters.excludedCodePointRanges) {
|
for (const [start, end] of font.parameters.excludedCodePointRanges) {
|
||||||
for (let p = start; p <= end; p++) excludedCodePoints.add(p);
|
for (let p = start; p <= end; p++) excludedCodePoints.add(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const o_glyf = {};
|
const o_glyf = {};
|
||||||
const o_cmap = {};
|
const o_cmap = {};
|
||||||
for (let g of font.glyf) {
|
for (let g of font.glyf) {
|
||||||
o_glyf[g.name] = g;
|
o_glyf[g.name] = g;
|
||||||
|
|
||||||
if (!g.unicode) continue;
|
if (!g.unicode) continue;
|
||||||
for (let u of g.unicode) {
|
for (let u of g.unicode) {
|
||||||
if (!excludedCodePoints.has(u - 0)) o_cmap[u] = g.name;
|
if (!excludedCodePoints.has(u - 0)) o_cmap[u] = g.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare OTD
|
// Prepare OTD
|
||||||
const otd = Object.assign({}, font);
|
const otd = Object.assign({}, font);
|
||||||
otd.glyf = o_glyf;
|
otd.glyf = o_glyf;
|
||||||
otd.cmap = o_cmap;
|
otd.cmap = o_cmap;
|
||||||
otd.glyfMap = null;
|
otd.glyfMap = null;
|
||||||
if (argv.o === "|") {
|
if (argv.o === "|") {
|
||||||
process.stdout.write(JSON.stringify(otd));
|
process.stdout.write(JSON.stringify(otd));
|
||||||
} else {
|
} else {
|
||||||
fs.writeFileSync(argv.o, JSON.stringify(otd, null, " "));
|
fs.writeFileSync(argv.o, JSON.stringify(otd, null, " "));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "iosevka",
|
"name": "iosevka",
|
||||||
"version": "3.0.0-alpha.4",
|
"version": "3.0.0-alpha.5",
|
||||||
"main": "./generate.js",
|
"main": "./generate.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.4.0"
|
"node": ">=8.4.0"
|
||||||
|
@ -30,6 +30,7 @@
|
||||||
"patel": "^0.33.1",
|
"patel": "^0.33.1",
|
||||||
"patrisika-scopes": "^0.11.1",
|
"patrisika-scopes": "^0.11.1",
|
||||||
"eslint": "^5.2.0",
|
"eslint": "^5.2.0",
|
||||||
"stylus": "^0.54.5"
|
"stylus": "^0.54.5",
|
||||||
|
"semver": "^7.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
147
utility/generate-release-note.js
Normal file
147
utility/generate-release-note.js
Normal file
|
@ -0,0 +1,147 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const path = require("path");
|
||||||
|
const fs = require("fs-extra");
|
||||||
|
const semver = require("semver");
|
||||||
|
|
||||||
|
const ChangeFileDir = path.join(__dirname, "../changes");
|
||||||
|
const ModifiedSinceVersion = "2.x";
|
||||||
|
const Version = process.argv[2];
|
||||||
|
|
||||||
|
class Output {
|
||||||
|
constructor() {
|
||||||
|
this.buffer = "";
|
||||||
|
}
|
||||||
|
log(...s) {
|
||||||
|
this.buffer += s.join("") + "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
const out = new Output();
|
||||||
|
await GenerateChangeList(out);
|
||||||
|
await CopyMarkdown(out, "packages-desc.md");
|
||||||
|
await GeneratePackageList(out);
|
||||||
|
await CopyMarkdown(out, "style-set-sample-image.md");
|
||||||
|
await CopyMarkdown(out, "deprecated-packages.md");
|
||||||
|
await fs.ensureDir(path.join(__dirname, `../release-archives/`));
|
||||||
|
await fs.writeFile(
|
||||||
|
path.join(__dirname, `../release-archives/release-notes-${Version}.md`),
|
||||||
|
out.buffer
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
main().catch(e => {
|
||||||
|
console.error(e);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copy Markdown
|
||||||
|
|
||||||
|
async function CopyMarkdown(out, name) {
|
||||||
|
const content = await fs.readFile(
|
||||||
|
path.resolve(__dirname, `release-note-fragments/${name}`),
|
||||||
|
"utf8"
|
||||||
|
);
|
||||||
|
out.log(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CHANGE LIST
|
||||||
|
|
||||||
|
async function GenerateChangeList(out) {
|
||||||
|
const changeFiles = await fs.readdir(ChangeFileDir);
|
||||||
|
const fragments = new Map();
|
||||||
|
for (const file of changeFiles) {
|
||||||
|
const filePath = path.join(ChangeFileDir, file);
|
||||||
|
const fileParts = path.parse(filePath);
|
||||||
|
if (fileParts.ext !== ".md") continue;
|
||||||
|
if (!semver.valid(fileParts.name) || semver.lt(Version, fileParts.name)) continue;
|
||||||
|
fragments.set(fileParts.name, await fs.readFile(filePath, "utf8"));
|
||||||
|
}
|
||||||
|
const sortedFragments = Array.from(fragments).sort((a, b) => semver.compare(b[0], a[0]));
|
||||||
|
|
||||||
|
out.log(`## Modifications since version ${ModifiedSinceVersion}`);
|
||||||
|
for (const [version, notes] of sortedFragments) {
|
||||||
|
out.log(` * **${version}**`);
|
||||||
|
out.log((notes.trim() + "\n").replace(/^/gm, " "));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// PACKAGE LIST
|
||||||
|
|
||||||
|
const PackageShapes = {
|
||||||
|
// shapeDesc, shapeNameSuffix, slab, count, nospace
|
||||||
|
"": ["Default", "", false, true],
|
||||||
|
slab: ["Slab", "Slab", true, true],
|
||||||
|
curly: ["Curly", "Curly", false, true],
|
||||||
|
"curly-slab": ["Curly Slab", "Curly Slab", true, true],
|
||||||
|
ss01: ["Andale Mono Style", "SS01"],
|
||||||
|
ss02: ["Anonymous Pro Style", "SS02"],
|
||||||
|
ss03: ["Consolas Style", "SS03"],
|
||||||
|
ss04: ["Menlo Style", "SS04"],
|
||||||
|
ss05: ["Fira Mono Style", "SS05"],
|
||||||
|
ss06: ["Liberation Mono Style", "SS06"],
|
||||||
|
ss07: ["Monaco Style", "SS07"],
|
||||||
|
ss08: ["Pragmata Pro Style", "SS08"],
|
||||||
|
ss09: ["Source Code Pro Style", "SS09"],
|
||||||
|
ss10: ["Envy Code R Style", "SS10"],
|
||||||
|
ss11: ["X Windows Fixed Style", "SS11"],
|
||||||
|
ss12: ["Ubuntu Mono Style", "SS12"],
|
||||||
|
aile: ["Quasi-proportional", "Aile", false, false, true],
|
||||||
|
etoile: ["Quasi-proportional slab-serif", "Etoile", false, false, true],
|
||||||
|
sparkle: ["Quasi-proportional family — like iA Writer’s Duo.", "Sparkle", false, false, true]
|
||||||
|
};
|
||||||
|
|
||||||
|
const PackageSpacings = {
|
||||||
|
// spacingDesc, ligation, spacingNameSuffix
|
||||||
|
"": ["Default", true, ""],
|
||||||
|
term: ["Terminal", false, "Type"],
|
||||||
|
type: ["Typesetting", true, "Type"],
|
||||||
|
"term-lig": ["Terminal-Ligature", true, "TermLig"]
|
||||||
|
};
|
||||||
|
|
||||||
|
async function GeneratePackageList(out) {
|
||||||
|
let nr = 1;
|
||||||
|
out.log(`### Packages`);
|
||||||
|
out.log(`| Package | Description |\n| --- | --- |`);
|
||||||
|
for (let shape in PackageShapes) {
|
||||||
|
const [shapeDesc, shapeNameSuffix, , count, nospace] = PackageShapes[shape];
|
||||||
|
for (let spacing in PackageSpacings) {
|
||||||
|
if (nospace && spacing) continue;
|
||||||
|
const [spacingDesc, ligation, spacingNameSuffix] = PackageSpacings[spacing];
|
||||||
|
const fileName = buildName(
|
||||||
|
"-",
|
||||||
|
count ? pad(nr, 2, "0") : "",
|
||||||
|
"iosevka",
|
||||||
|
spacing,
|
||||||
|
shape,
|
||||||
|
Version
|
||||||
|
);
|
||||||
|
const familyName = buildName(" ", "Iosevka", spacingNameSuffix, shapeNameSuffix);
|
||||||
|
const desc = nospace
|
||||||
|
? `_${shapeDesc}_`
|
||||||
|
: `**Shape**: _${shapeDesc}_; **Spacing**: _${spacingDesc}_ <br/>` +
|
||||||
|
`**Ligation**: ${flag(ligation)}`;
|
||||||
|
if (count) nr++;
|
||||||
|
out.log(`| \`${fileName}\`<br/>**Menu Name**: \`${familyName}\` | ${desc} |`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
out.log();
|
||||||
|
}
|
||||||
|
|
||||||
|
function pad(s, n, p) {
|
||||||
|
s = "" + s;
|
||||||
|
while (s.length < n) s = p + s;
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildName(j, ...parts) {
|
||||||
|
return parts.filter(x => !!x).join(j);
|
||||||
|
}
|
||||||
|
|
||||||
|
function flag(f) {
|
||||||
|
return f ? "**Yes**" : "No";
|
||||||
|
}
|
|
@ -1,33 +1,33 @@
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
module.exports = function(output, family, hs, formats) {
|
module.exports = function(output, family, hs, formats) {
|
||||||
let ans = ``;
|
let ans = ``;
|
||||||
for (const term of hs) {
|
for (const term of hs) {
|
||||||
let src = formats
|
let src = formats
|
||||||
.map(([ext, format]) => `url('${ext}/${term.name}.${ext}') format('${format}')`)
|
.map(([ext, format]) => `url('${ext}/${term.name}.${ext}') format('${format}')`)
|
||||||
.join(", ");
|
.join(", ");
|
||||||
ans += `
|
ans += `
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: '${family + " Web"}';
|
font-family: '${family + " Web"}';
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-weight: ${term.cssWeight};
|
font-weight: ${term.cssWeight};
|
||||||
font-stretch: ${term.cssStretch};
|
font-stretch: ${term.cssStretch};
|
||||||
font-style: ${term.cssStyle};
|
font-style: ${term.cssStyle};
|
||||||
src: ${src};
|
src: ${src};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
if (term.cssStyle === "oblique") {
|
if (term.cssStyle === "oblique") {
|
||||||
// CHROME hates a family with both Italic and Oblique
|
// CHROME hates a family with both Italic and Oblique
|
||||||
ans += `
|
ans += `
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: '${family + " Web Oblique"}';
|
font-family: '${family + " Web Oblique"}';
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-weight: ${term.cssWeight};
|
font-weight: ${term.cssWeight};
|
||||||
font-stretch: ${term.cssStretch};
|
font-stretch: ${term.cssStretch};
|
||||||
src: ${src};
|
src: ${src};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fs.writeFileSync(output, ans);
|
fs.writeFileSync(output, ans);
|
||||||
};
|
};
|
||||||
|
|
8
utility/release-note-fragments/deprecated-packages.md
Normal file
8
utility/release-note-fragments/deprecated-packages.md
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
### Deprecated Series
|
||||||
|
|
||||||
|
The “CC” series, which is intended to made width-compatible with legacy East Asian fonts from Iosevka 2.x is considered deprecated and will be removed soon. The variants include:
|
||||||
|
|
||||||
|
* `iosevka-cc-DEPRECATED-<version>`
|
||||||
|
* `iosevka-cc-slab-DEPRECATED-<version>`
|
||||||
|
* `iosevka-cc-curly-DEPRECATED-<version>`
|
||||||
|
* `iosevka-cc-curly-slab-DEPRECATED-<version>`
|
14
utility/release-note-fragments/packages-desc.md
Normal file
14
utility/release-note-fragments/packages-desc.md
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
## Prebuilt Packages
|
||||||
|
|
||||||
|
Iosevka provides a large variety of variants. Prebuilt variants are described below.
|
||||||
|
|
||||||
|
- **Spacing** : How wide some specific characters are.
|
||||||
|
- _Default_: The default variant with ligatures and semantic full-width glyphs.
|
||||||
|
- _Terminal_ (“Term”): Exact monospaced font without ligatures and full-width glyphs. Since some environments cannot interpret Iosevka as monospaced, and have difficulties with ligatures included, you can use Iosevka Term as an alternative.
|
||||||
|
- _Terminal-Ligature_ (“TermLig”):Exact monospaced font with ligatures.
|
||||||
|
- _Typesetting_ (“Type”): Similar to _Default_, but more mathematical symbols are wider.
|
||||||
|
- **Shape** : Key shape parameters:
|
||||||
|
- *Slab*: Letters will contain slab serif.
|
||||||
|
- *Curly*: Letters like `k`, `x`, `v`, `A`, `R` will have curly leg shapes.
|
||||||
|
- **Ligatures** : Whether the ligatures is included. The “no-ligature” variants are used for some Linux-based environments cannot handle ligatures correctly.
|
||||||
|
- **Menu Name** : The family name of the font in your OS after installation. If two variants share the same family name, they cannot be installed together.
|
1
utility/release-note-fragments/style-set-sample-image.md
Normal file
1
utility/release-note-fragments/style-set-sample-image.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|

|
|
@ -1,10 +1,10 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const ttf2woff = require("ttf2woff");
|
const ttf2woff = require("ttf2woff");
|
||||||
|
|
||||||
module.exports = function(from, to) {
|
module.exports = function(from, to) {
|
||||||
const input = fs.readFileSync(from);
|
const input = fs.readFileSync(from);
|
||||||
const ttf = new Uint8Array(input);
|
const ttf = new Uint8Array(input);
|
||||||
const woff = Buffer.from(ttf2woff(ttf, {}).buffer);
|
const woff = Buffer.from(ttf2woff(ttf, {}).buffer);
|
||||||
fs.writeFileSync(to, woff);
|
fs.writeFileSync(to, woff);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const ttf2woff2 = require("ttf2woff2");
|
const ttf2woff2 = require("ttf2woff2");
|
||||||
|
|
||||||
module.exports = function(from, to) {
|
module.exports = function(from, to) {
|
||||||
const input = fs.readFileSync(from);
|
const input = fs.readFileSync(from);
|
||||||
const woff = ttf2woff2(input);
|
const woff = ttf2woff2(input);
|
||||||
fs.writeFileSync(to, woff);
|
fs.writeFileSync(to, woff);
|
||||||
};
|
};
|
||||||
|
|
1250
verdafile.js
1250
verdafile.js
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue