Added "weights" option for make custom-config
. Fixes #243.
This commit is contained in:
parent
31bf5dea5b
commit
93bb461b40
3 changed files with 14 additions and 3 deletions
10
README.md
10
README.md
|
@ -84,8 +84,16 @@ The first step, `make custom-config` takes following parameters to set styles of
|
||||||
You can also customize the font family:
|
You can also customize the font family:
|
||||||
|
|
||||||
* `family='<Font Family>'`, for a customized font family name.
|
* `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:
|
The current available styles are:
|
||||||
|
|
||||||
|
|
2
makefile
2
makefile
|
@ -53,7 +53,7 @@ ifndef prestyle
|
||||||
prestyle = nothing
|
prestyle = nothing
|
||||||
endif
|
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)/
|
custom-config : maker.js | $(BUILD)/
|
||||||
$(CREATECONFIG)
|
$(CREATECONFIG)
|
||||||
|
|
5
maker.js
5
maker.js
|
@ -3,7 +3,10 @@ const path = require("path");
|
||||||
const argv = require("yargs").argv;
|
const argv = require("yargs").argv;
|
||||||
const pad = require("pad");
|
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 slantnesses = ["upright", "italic", "oblique"];
|
||||||
const widths = ["term", "normal", "cc"];
|
const widths = ["term", "normal", "cc"];
|
||||||
const designs = ["sans", "slab"];
|
const designs = ["sans", "slab"];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue