Added "weights" option for make custom-config. Fixes #243.

This commit is contained in:
belleve 2018-01-29 15:58:30 +08:00
parent 31bf5dea5b
commit 93bb461b40
3 changed files with 14 additions and 3 deletions

View file

@ -84,8 +84,16 @@ The first step, `make custom-config` takes following parameters to set styles of
You can also customize the font family:
* `family='<Font Family>'`, for a customized font family name.
* `weights='<list of weights>'`, a space-separated list, indicates the specific weights needed to be built. The candidates are:
* `thin`
* `extralight`
* `light`
* `book`
* `medium`
* `bold`
* `heavy`
You can add arbitary styles for these variables, for example, `make custom-config upright='v-l-zshaped v-i-zshaped' family='Iosevka X' && make custom` will create a variant with Z-shaped letter `l` and `i` for uprights, and it would be named as '`Iosevka X`' after installation.
You can add arbitrary styles for these variables, for example, `make custom-config upright='v-l-zshaped v-i-zshaped' family='Iosevka X' && make custom` will create a variant with Z-shaped letter `l` and `i` for uprights, and it would be named as '`Iosevka X`' after installation.
The current available styles are:

View file

@ -53,7 +53,7 @@ ifndef prestyle
prestyle = nothing
endif
CREATECONFIG = node maker.js --custom $(set) --design '$(design)' --upright '$(upright)' --italic '$(italic)' --oblique '$(oblique)' --prestyle '$(prestyle)' --family '$(family)' > $(BUILD)/targets-$(set).mk
CREATECONFIG = node maker.js --custom $(set) --design '$(design)' --upright '$(upright)' --italic '$(italic)' --oblique '$(oblique)' --prestyle '$(prestyle)' --family '$(family)' --weights '$(weights)' > $(BUILD)/targets-$(set).mk
custom-config : maker.js | $(BUILD)/
$(CREATECONFIG)

View file

@ -3,7 +3,10 @@ const path = require("path");
const argv = require("yargs").argv;
const pad = require("pad");
const weights = ["thin", "extralight", "light", "book", "medium", "bold", "heavy"];
const possibleWeights = new Set(["thin", "extralight", "light", "book", "medium", "bold", "heavy"]);
const weights = argv.weights
? argv.weights.split(/ +/g).filter(w => possibleWeights.has(w))
: [...possibleWeights];
const slantnesses = ["upright", "italic", "oblique"];
const widths = ["term", "normal", "cc"];
const designs = ["sans", "slab"];