diff --git a/README.md b/README.md index 9638fbfdf..488a42981 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,7 @@ Afrikaans, Aghem, Akan, Albanian, Asturian, Asu, Azerbaijani, Bafia, Bambara, Ba - - -Iosevka supports accessing all letter variants using OpenType features. +Iosevka supports accessing all letter variants using OpenType features, including `ss##` for applying a stylistic set, or `cv##` to cherry-pick variants. ![Style Sets](images/stylesets.png) @@ -57,11 +55,34 @@ Iosevka supports accessing all letter variants using OpenType features. ### Ligations -![Ligations Sample](images/ligations.png) - Iosevka’s default ligation set is assigned to `calt` feature, though not all of them are enabled by default. -Iosevka supports Language-Specific Ligations, which is the ligation set enabled only under certain languages. These ligation sets are assigned to custom feature tags, like `CLIK`. + + + +Iosevka supports Language-Specific Ligations, which is the ligation set enabled only under certain languages. These ligation sets are assigned to custom feature tags. To use them, you need to turn **off** `calt` and enable the corresponded feature. The feature list is: + +- `dlig`: Discretionary ligatures. +- `CLIK`: C-Like. +- `JSPT`: JavaScript. +- `PHPX`: PHP. +- `MLXX`: ML. +- `FSHP`: F#. +- `FSTA`: F*. +- `HSKL`: Haskell. +- `IDRS`: Idris. +- `ELMX`: Elm. +- `PURS`: PureScript. +- `SWFT`: Swift. +- `COQX`: Coq. +- `MTLB`: Matlab. +- `VRLG`: Verilog. +- `WFLM`: Wolfram Language (Mathematica). + + + +![Ligations Sample](images/ligations.png) + ## Building from Source @@ -140,6 +161,7 @@ Subsection `ligations` is used to customize the ligation set assigned to `calt` - `swift`: Default ligation set would be assigned to Swift. - `coq`: Default ligation set would be assigned to Coq. - `matlab`: Default ligation set would be assigned to Matlab. + - `verilog`: Default ligation set would be assigned to Verilog. - `wolfram`: Default ligation set would be assigned to Wolfram Language (Mathematica). diff --git a/params/ligation-set.toml b/params/ligation-set.toml index ed1d94759..c0671f5e2 100644 --- a/params/ligation-set.toml +++ b/params/ligation-set.toml @@ -190,6 +190,11 @@ tag = 'MTLB' buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'llgg', 'eqeq', 'tildeeq', 'ineq', 'plusplus', 'kern-dotty'] desc = 'Matlab' +[composite.verilog] +tag = 'VRLG' +buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'llgg', 'llggeq', 'eqeqeq', 'eqeq', 'exeqeq', 'exeq', 'plusplus', 'kern-dotty'] +desc = 'Verilog' + [composite.wolfram] tag = 'WFLM' buildup = ['center-ops', 'arrow', 'trig', 'ltgt-diamond', 'eqeq', 'exeq', 'eqexeq-dl', 'ineq', 'brst', 'plusplus', 'logic', 'colon-greater-as-colon-arrow'] diff --git a/utility/amend-readme/fragments/description-ot-ligation-tags.md b/utility/amend-readme/fragments/description-ot-ligation-tags.md new file mode 100644 index 000000000..66efff5eb --- /dev/null +++ b/utility/amend-readme/fragments/description-ot-ligation-tags.md @@ -0,0 +1 @@ +Iosevka supports Language-Specific Ligations, which is the ligation set enabled only under certain languages. These ligation sets are assigned to custom feature tags. To use them, you need to turn **off** `calt` and enable the corresponded feature. The feature list is: diff --git a/utility/amend-readme/index.js b/utility/amend-readme/index.js index f93918266..c9a19b644 100644 --- a/utility/amend-readme/index.js +++ b/utility/amend-readme/index.js @@ -14,6 +14,7 @@ const charMapObliquePath = process.argv[4]; execMain(main); ///////////////////////////////////////////////////////////////////////////////////////////////////// + async function main() { const readmePath = path.resolve(__dirname, "../../README.md"); let readme = await fs.readFile(readmePath, "utf-8"); @@ -21,6 +22,7 @@ async function main() { readme = (await processSs()).apply(readme); readme = (await processLigSetCherryPicking()).apply(readme); readme = (await processLigSetPreDef()).apply(readme); + readme = (await processLigSetOt()).apply(readme); readme = (await processLangList()).apply(readme); readme = (await processPrivateBuildPlans()).apply(readme); await fs.writeFile(readmePath, readme); @@ -73,30 +75,6 @@ async function processPrivateBuildPlans() { return md; } -class MdCol { - constructor(sectionName) { - this.data = ""; - this.sectionName = sectionName; - this.matchRegex = new RegExp( - `^([ \\t]*)\\n[\\s\\S]*?\\n`, - `m` - ); - } - log(...s) { - this.data += s.join("") + "\n"; - } - apply(s) { - return s.replace(this.matchRegex, (m, $1) => { - return ( - `\n` + - `\n\n` + - this.data + - `\n\n` - ).replace(/^/gm, $1); - }); - } -} - function formatDefaults(selector, defaults) { let dcs = [], mask = 0; @@ -180,6 +158,19 @@ async function processLigSetPreDef() { return md; } +async function processLigSetOt() { + const ligData = await parseLigationData(); + const md = new MdCol("Section-OT-Ligation-Tags"); + const headerPath = path.resolve(__dirname, "fragments/description-ot-ligation-tags.md"); + md.log(await fs.readFile(headerPath, "utf-8")); + for (const ls of ligData.nonMergeSets) { + if (!ls.rank || ls.tag === "calt") continue; + const longDesc = ls.desc; + md.log(`- \`${ls.tag}\`: ${longDesc}.`); + } + return md; +} + async function processLangList() { const cl = await getCharMapAndSupportedLanguageList( charMapPath, @@ -191,3 +182,29 @@ async function processLangList() { md.log(cl.languages.join(", ")); return md; } + +///////////////////////////////////////////////////////////////////////////////////////////////////// + +class MdCol { + constructor(sectionName) { + this.data = ""; + this.sectionName = sectionName; + this.matchRegex = new RegExp( + `^([ \\t]*)\\n[\\s\\S]*?\\n`, + `m` + ); + } + log(...s) { + this.data += s.join("") + "\n"; + } + apply(s) { + return s.replace(this.matchRegex, (m, $1) => { + return ( + `\n` + + `\n\n` + + this.data + + `\n\n` + ).replace(/^/gm, $1); + }); + } +}