Add weight 'Book'. Fixes #424.

This commit is contained in:
Belleve Invis 2020-02-13 20:03:10 -08:00
parent 1765923f8d
commit 296afad705
4 changed files with 194 additions and 183 deletions

View file

@ -535,6 +535,11 @@ shape = 400
menu = 400
css = 400
[weights.book]
shape = 450
menu = 450
css = 450
[weights.medium]
shape = 500
menu = 500

View file

@ -1 +1,2 @@
* Fix “Lucida” style's `one` character
* Fix “Lucida” style's `one` character.
* Added weight “Book”.

View file

@ -34,6 +34,7 @@ define weightToMenuStyleMap : object
200 "Extralight"
300 "Light"
400 ""
450 "Book"
500 "Medium"
600 "Semibold"
700 "Bold"
@ -59,6 +60,7 @@ define weightToMenuStyleMapShort : object
200 "XLt"
300 "Lt"
400 ""
450 "Bk"
500 "Md"
600 "SmBd"
700 "Bd"

View file

@ -137,8 +137,11 @@ function nValidate(key, v, f) {
function vlShapeWeight(x) {
return x >= 100 && x <= 900;
}
function vlCssWeight(x) {
return x >= 0 && x <= 1000;
}
function vlMenuWeight(x) {
return x >= 100 && x <= 900 && x % 100 === 0;
return (x >= 100 && x <= 900 && x % 100 === 0) || x === 450;
}
function vlShapeWidth(x) {
return x === 3 || x === 5 || x === 7;
@ -157,7 +160,7 @@ function getSuffixSet(weights, slants, widths) {
hives: [`shape-weight`, `s-${s}`, `wd-${widths[wd].shape}`],
weight: w,
shapeWeight: nValidate("Shape weight of " + w, weights[w].shape, vlShapeWeight),
cssWeight: nValidate("CSS weight of " + w, weights[w].css),
cssWeight: nValidate("CSS weight of " + w, weights[w].css, vlCssWeight),
menuWeight: nValidate("Menu weight of " + w, weights[w].menu, vlMenuWeight),
width: wd,
shapeWidth: nValidate("Shape width of " + wd, widths[wd].shape, vlShapeWidth),