From d7ad5d643202f8211c29fce47417ee616dea732f Mon Sep 17 00:00:00 2001 From: belleve Date: Fri, 14 Sep 2018 22:10:27 +0800 Subject: [PATCH] update Verda deps. --- README.md | 6 ++++-- build-plans.toml | 9 +++++++++ gen/generator.js | 4 ++-- package.json | 2 +- private-build-plans.sample.toml | 27 +++++++++++++++++++++++++++ snapshot/index.html | 8 ++++++++ verdafile.js | 16 +++++++++++----- 7 files changed, 62 insertions(+), 10 deletions(-) create mode 100644 private-build-plans.sample.toml diff --git a/README.md b/README.md index 001d64e5d..bc9e53871 100644 --- a/README.md +++ b/README.md @@ -71,11 +71,13 @@ Since version 2.0, Iosevka would no longer support building via `makefile`. To i # When buildPlans..weights is absent # All weights would built and mapped to default shape/CSS [buildPlans.iosevka-custom.weights.regular] - shape = 400 # Weight of glyph shapes - css = 400 # Weight of menu and CSS + shape = 400 # Weight for glyph shapes + menu = 400 # Weight for menu name + css = 400 # Weight for WebFont CSS [buildPlans.iosevka-custom.weights.bold] shape = 700 + menu = 700 css = 700 # Override default building slant sets diff --git a/build-plans.toml b/build-plans.toml index ca6163e03..2d48b937f 100644 --- a/build-plans.toml +++ b/build-plans.toml @@ -178,38 +178,47 @@ from = [ # CSS weight : affects the font menu name and webfont CSS [weights.thin] shape = 100 +menu = 100 css = 100 [weights.extralight] shape = 200 +menu = 200 css = 200 [weights.light] shape = 300 +menu = 300 css = 300 [weights.regular] shape = 400 +menu = 400 css = 400 [weights.medium] shape = 500 +menu = 500 css = 500 [weights.semibold] shape = 600 +menu = 600 css = 600 [weights.bold] shape = 700 +menu = 700 css = 700 [weights.extrabold] shape = 800 +menu = 800 css = 800 [weights.heavy] shape = 900 +menu = 900 css = 900 # Slant mappings (style => CSS) diff --git a/gen/generator.js b/gen/generator.js index 457ff14fd..fe57ca247 100644 --- a/gen/generator.js +++ b/gen/generator.js @@ -112,8 +112,8 @@ function getParameters(argv) { para.naming = { family: argv.family, version: argv.ver, - weight: argv.weight - 0, - slant: argv.slant + weight: argv["menu-weight"] - 0, + slant: argv["menu-slant"] }; return para; diff --git a/package.json b/package.json index 8aae8bcd9..0e21f8f86 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "ttf2woff": "^2.0.1", "ttf2woff2": "^2.0.3", "unorm": "^1.4.1", - "verda": "^0.1.5", + "verda": "^0.1.6", "yargs": "^12.0.0", "primitive-quadify-off-curves": "^0.4.0" }, diff --git a/private-build-plans.sample.toml b/private-build-plans.sample.toml new file mode 100644 index 000000000..a9562aee5 --- /dev/null +++ b/private-build-plans.sample.toml @@ -0,0 +1,27 @@ +[buildPlans.iosevka-custom] # is your plan name +family = "Iosevka Custom" # Font menu family name +design = ["leading-1500", "v-i-hooky", "v-l-hooky"] # Customize styles + + +# Override default building weights +# When buildPlans..weights is absent +# All weights would built and mapped to default shape/CSS +[buildPlans.iosevka-custom.weights.regular] +shape = 400 # Weight for glyph shapes +menu = 400 # Weight for menu name +css = 400 # Weight for webfont CSS + +[buildPlans.iosevka-custom.weights.bold] +shape = 700 +menu = 700 +css = 700 +# end weight section + + +# Override default building slant sets +# Format: = <"normal"|"italic"|"oblique"> +# When this section is absent, all slants would be built. +[buildPlans.iosevka-custom.slants] +upright = "normal" +italic = "italic" +oblique = "oblique" diff --git a/snapshot/index.html b/snapshot/index.html index 81d61e90a..ac920c261 100644 --- a/snapshot/index.html +++ b/snapshot/index.html @@ -232,6 +232,14 @@ cv53 ff +
  • + cv54 + $$ +
  • +
  • + cv55 + $$ +
  • diff --git a/verdafile.js b/verdafile.js index ea8b01bc5..c1f1efc91 100644 --- a/verdafile.js +++ b/verdafile.js @@ -1,4 +1,5 @@ "use strict"; + const { want, rule: { task, file, oracle, phony }, @@ -7,6 +8,7 @@ const { journal, argv } = require("verda"); + const fs = require("fs"); const path = require("path"); const toml = require("toml"); @@ -96,9 +98,11 @@ function getSuffixSet(weights, slants) { mapping[suffix] = { hives: [`w-${weights[w].shape}`, `s-${s}`], weight: w, + cssWeight: weights[w].css || w, + menuWeight: weights[w].menu || weights[w].css || w, slant: s, - cssWeight: weights[w].css, - cssStyle: slants[s] + cssStyle: slants[s] || s, + menuStyle: slants[s] || s }; } } @@ -132,6 +136,8 @@ oracle(`o:font-building-parameters`).def(async target => { name: fileName, family, hives: ["iosevka", ...preHives, ...suffixMapping[suffix].hives, ...postHives], + menuWeight: suffixMapping[suffix].menuWeight, + menuStyle: suffixMapping[suffix].menuStyle, cssWeight: suffixMapping[suffix].cssWeight, cssStyle: suffixMapping[suffix].cssStyle }; @@ -193,7 +199,7 @@ oracle("collection-parts-of:*").def(async (target, id) => { /////////////////////////////////////////////////////////// file(`${BUILD}/*/*.ttf`).def(async (target, prefix, suffix) => { - const [{ hives, family, cssWeight, cssStyle }, version] = await target.need( + const [{ hives, family, menuWeight, menuStyle }, version] = await target.need( `hives-of:${suffix}`, `o:version` ); @@ -206,8 +212,8 @@ file(`${BUILD}/*/*.ttf`).def(async (target, prefix, suffix) => { ["--charmap", charmap], ["--family", family], ["--ver", version], - ["--weight", cssWeight], - ["--slant", cssStyle], + ["--menu-weight", menuWeight], + ["--menu-slant", menuStyle], hives ); await run("otfccbuild", otd, "-o", target.path.full, "-O3", "--keep-average-char-width");