Skip to content

Instantly share code, notes, and snippets.

@be5invis
Created December 30, 2019 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save be5invis/03800e53394928b5be9e739e0a77c9fd to your computer and use it in GitHub Desktop.
Save be5invis/03800e53394928b5be9e739e0a77c9fd to your computer and use it in GitHub Desktop.
"use esnext";
const version = '3.0.0-alpha.2'
const shapes = {
'': ['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 spacings = {
'': ['Default', true, ''],
'term': ["Terminal", false, 'Type'],
'type': ["Typesetting", true, 'Type'],
'term-lig': ["Terminal-Ligature", true, "TermLig"]
};
let nr = 1;
console.log(`| Package | Description |\n| --- | --- |`)
for(let shape in shapes) {
const [shapeDesc, shapeNameSuffix, slab, count, nospace] = shapes[shape];
for(let spacing in spacings){
if (nospace && spacing) continue;
const [spacingDesc, ligation, spacingNameSuffix] = spacings[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++;
console.log(`| \`${fileName}\`<br/>**Menu Name**: \`${familyName}\` | ${desc} |`);
}
}
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'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment