Widths
This commit is contained in:
parent
3672aad56e
commit
40b7c1452e
6 changed files with 105 additions and 59 deletions
|
@ -82,6 +82,7 @@ design = ["termlig", "slab", "shape-curly-bar", "v-at-fourfold"]
|
||||||
family = "IosevkaCC Curly Slab"
|
family = "IosevkaCC Curly Slab"
|
||||||
design = ["cc", "slab", "shape-curly-bar", "v-at-fourfold"]
|
design = ["cc", "slab", "shape-curly-bar", "v-at-fourfold"]
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
# SSxx
|
# SSxx
|
||||||
[buildPlans.iosevka-ss01]
|
[buildPlans.iosevka-ss01]
|
||||||
family = "Iosevka SS01"
|
family = "Iosevka SS01"
|
||||||
|
@ -286,8 +287,8 @@ design = ["type", "ss12"]
|
||||||
family = "Iosevka TermLig SS12"
|
family = "Iosevka TermLig SS12"
|
||||||
design = ["termlig", "ss12"]
|
design = ["termlig", "ss12"]
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
# Proportional families
|
||||||
[buildPlans.iosevka-aile]
|
[buildPlans.iosevka-aile]
|
||||||
family = "Iosevka Aile"
|
family = "Iosevka Aile"
|
||||||
design = ["type", "v-at-fourfold", "v-j-narrow", 'v-capital-i-straight', 'v-capital-j-straight', 'v-g-singlestorey', 'v-r-narrow', "no-cv-ss", "no-ligation"]
|
design = ["type", "v-at-fourfold", "v-j-narrow", 'v-capital-i-straight', 'v-capital-j-straight', 'v-g-singlestorey', 'v-r-narrow', "no-cv-ss", "no-ligation"]
|
||||||
|
@ -296,7 +297,15 @@ italic = ["v-i-line", "v-l-line", 'v-f-narrow', 'v-t-narrow']
|
||||||
oblique = ["v-i-line", "v-l-line", 'v-f-narrow', 'v-t-narrow']
|
oblique = ["v-i-line", "v-l-line", 'v-f-narrow', 'v-t-narrow']
|
||||||
|
|
||||||
[buildPlans.iosevka-aile.post]
|
[buildPlans.iosevka-aile.post]
|
||||||
design = ['wd-extended', "diversity-2"]
|
design = ["diversity-2"]
|
||||||
|
|
||||||
|
[buildPlans.iosevka-aile.widths.normal]
|
||||||
|
shape = 7
|
||||||
|
menu = 5
|
||||||
|
css = "normal"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[buildPlans.iosevka-etoile]
|
[buildPlans.iosevka-etoile]
|
||||||
family = "Iosevka Etoile"
|
family = "Iosevka Etoile"
|
||||||
|
@ -306,7 +315,15 @@ italic = ['v-i-italic', 'v-l-italic']
|
||||||
oblique = ['v-i-serifed', 'v-l-serifed']
|
oblique = ['v-i-serifed', 'v-l-serifed']
|
||||||
|
|
||||||
[buildPlans.iosevka-etoile.post]
|
[buildPlans.iosevka-etoile.post]
|
||||||
design = ['wd-extended', "diversity-1"]
|
design = ["diversity-1"]
|
||||||
|
|
||||||
|
[buildPlans.iosevka-etoile.widths.normal]
|
||||||
|
shape = 7
|
||||||
|
menu = 5
|
||||||
|
css = "normal"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[buildPlans.iosevka-sparkle]
|
[buildPlans.iosevka-sparkle]
|
||||||
family = "Iosevka Sparkle"
|
family = "Iosevka Sparkle"
|
||||||
|
@ -316,21 +333,15 @@ italic = ['v-i-italic', 'v-l-italic', "v-f-tailed", 'v-r-standard']
|
||||||
oblique = ['v-i-serifed', 'v-l-serifed', "v-f-force-serifed", "v-r-force-serifed"]
|
oblique = ['v-i-serifed', 'v-l-serifed', "v-f-force-serifed", "v-r-force-serifed"]
|
||||||
|
|
||||||
[buildPlans.iosevka-sparkle.post]
|
[buildPlans.iosevka-sparkle.post]
|
||||||
design = ['wd-extended', "diversity-1"]
|
design = ["diversity-1"]
|
||||||
|
|
||||||
[buildPlans.iosevka-extended]
|
[buildPlans.iosevka-sparkle.widths.normal]
|
||||||
family = "Iosevka"
|
shape = 7
|
||||||
|
menu = 5
|
||||||
|
css = "normal"
|
||||||
|
|
||||||
[buildPlans.iosevka-extended.post]
|
|
||||||
design = ['wd-extended', 'menu-subfamily-extended']
|
|
||||||
|
|
||||||
[buildPlans.iosevka-slab-extended]
|
|
||||||
family = "Iosevka Slab"
|
|
||||||
design = ["slab"]
|
|
||||||
|
|
||||||
[buildPlans.iosevka-slab-extended.post]
|
|
||||||
design = ['wd-extended', 'menu-subfamily-extended']
|
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
# Export plans
|
# Export plans
|
||||||
# This mapping affects the process of creating ZIP archives only
|
# This mapping affects the process of creating ZIP archives only
|
||||||
[exportPlans]
|
[exportPlans]
|
||||||
|
@ -424,9 +435,8 @@ iosevka-term-lig-ss12 = "iosevka-term-lig-ss12"
|
||||||
iosevka-aile = "iosevka-aile"
|
iosevka-aile = "iosevka-aile"
|
||||||
iosevka-etoile = "iosevka-etoile"
|
iosevka-etoile = "iosevka-etoile"
|
||||||
iosevka-sparkle = "iosevka-sparkle"
|
iosevka-sparkle = "iosevka-sparkle"
|
||||||
iosevka-extended = "iosevka-extended"
|
|
||||||
iosevka-slab-extended = "iosevka-slab-extended"
|
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
# TTC collection plans
|
# TTC collection plans
|
||||||
[collectPlans.iosevka]
|
[collectPlans.iosevka]
|
||||||
from = [
|
from = [
|
||||||
|
@ -460,9 +470,11 @@ from = [
|
||||||
"iosevka-term-lig-curly-slab"
|
"iosevka-term-lig-curly-slab"
|
||||||
]
|
]
|
||||||
|
|
||||||
# Weight mappings (style => shape weight, CSS weight)
|
###################################################################################################
|
||||||
|
# Weight mappings (style => shape weight, menu weight, CSS weight)
|
||||||
# Shape weight : affects the shape of the glyphs
|
# Shape weight : affects the shape of the glyphs
|
||||||
# CSS weight : affects the font menu name and webfont CSS
|
# Menu weight : affects the font menu name
|
||||||
|
# CSS weight : affects the webfont CSS "font-weight" property
|
||||||
[weights.thin]
|
[weights.thin]
|
||||||
shape = 100
|
shape = 100
|
||||||
menu = 100
|
menu = 100
|
||||||
|
@ -515,3 +527,24 @@ css = 900
|
||||||
upright = "normal"
|
upright = "normal"
|
||||||
oblique = "oblique"
|
oblique = "oblique"
|
||||||
italic = "italic"
|
italic = "italic"
|
||||||
|
|
||||||
|
# Width mappings (style => shape width, menu width, CSS stretch)
|
||||||
|
# Shape width : affects the shape of the glyphs
|
||||||
|
# Menu width : affects the font menu name
|
||||||
|
# CSS stretch : affects the webfont CSS "font-stretch" property
|
||||||
|
# IMPORTANT!!
|
||||||
|
# Currently "shape" property only support 3, 5, and 7
|
||||||
|
[widths.condensed]
|
||||||
|
shape = 3
|
||||||
|
menu = 3
|
||||||
|
css = "condensed"
|
||||||
|
|
||||||
|
[widths.normal]
|
||||||
|
shape = 5
|
||||||
|
menu = 5
|
||||||
|
css = "normal"
|
||||||
|
|
||||||
|
[widths.extended]
|
||||||
|
shape = 7
|
||||||
|
menu = 7
|
||||||
|
css = "expanded"
|
||||||
|
|
|
@ -49,6 +49,7 @@ function getParameters(argv) {
|
||||||
family: argv.family,
|
family: argv.family,
|
||||||
version: argv.ver,
|
version: argv.ver,
|
||||||
weight: argv["menu-weight"] - 0,
|
weight: argv["menu-weight"] - 0,
|
||||||
|
width: argv["menu-width"] - 0,
|
||||||
slant: argv["menu-slant"]
|
slant: argv["menu-slant"]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ export : define [assignFontNames para metrics font] : begin
|
||||||
set font.name {}
|
set font.name {}
|
||||||
|
|
||||||
define family : para.naming.family.trim
|
define family : para.naming.family.trim
|
||||||
define style : getStyle para.naming.weight para.menuWidth para.naming.slant
|
define style : getStyle para.naming.weight para.naming.width para.naming.slant
|
||||||
define version para.naming.version
|
define version para.naming.version
|
||||||
|
|
||||||
define isItalic : para.naming.slant == "italic"
|
define isItalic : para.naming.slant == "italic"
|
||||||
|
@ -110,7 +110,7 @@ export : define [assignFontNames para metrics font] : begin
|
||||||
if [not : isRBIBI style] : begin
|
if [not : isRBIBI style] : begin
|
||||||
if isItalic : begin
|
if isItalic : begin
|
||||||
set compatStyle slantToMenuStyleMap.italic
|
set compatStyle slantToMenuStyleMap.italic
|
||||||
set compatFamily : family + ' ' + [getStyle para.naming.weight para.menuWidth 'normal']
|
set compatFamily : family + ' ' + [getStyle para.naming.weight para.naming.width 'normal']
|
||||||
: else : begin
|
: else : begin
|
||||||
set compatStyle 'Regular'
|
set compatStyle 'Regular'
|
||||||
set compatFamily : family + ' ' + style
|
set compatFamily : family + ' ' + style
|
||||||
|
@ -119,9 +119,9 @@ export : define [assignFontNames para metrics font] : begin
|
||||||
if (compatFamily.length >= 31) : begin
|
if (compatFamily.length >= 31) : begin
|
||||||
if isItalic : begin
|
if isItalic : begin
|
||||||
set compatStyle slantToMenuStyleMap.italic
|
set compatStyle slantToMenuStyleMap.italic
|
||||||
set compatFamily : family + ' ' + [getShortStyle para.naming.weight para.menuWidth 'normal']
|
set compatFamily : family + ' ' + [getShortStyle para.naming.weight para.naming.width 'normal']
|
||||||
: else : begin
|
: else : begin
|
||||||
local shortStyle : getShortStyle para.naming.weight para.menuWidth para.naming.slant
|
local shortStyle : getShortStyle para.naming.weight para.naming.width para.naming.slant
|
||||||
set compatStyle 'Regular'
|
set compatStyle 'Regular'
|
||||||
set compatFamily : family + ' ' + shortStyle
|
set compatFamily : family + ' ' + shortStyle
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ export : define [assignFontNames para metrics font] : begin
|
||||||
|
|
||||||
# Weight, width and slantness
|
# Weight, width and slantness
|
||||||
set font.OS_2.usWeightClass para.naming.weight
|
set font.OS_2.usWeightClass para.naming.weight
|
||||||
set font.OS_2.usWidthClass para.menuWidth
|
set font.OS_2.usWidthClass para.naming.width
|
||||||
set font.OS_2.panose.2 : 1 + para.naming.weight / 100
|
set font.OS_2.panose.2 : 1 + para.naming.weight / 100
|
||||||
set font.OS_2.fsSelection : object
|
set font.OS_2.fsSelection : object
|
||||||
oblique : not : not isOblique
|
oblique : not : not isOblique
|
||||||
|
|
|
@ -74,8 +74,6 @@ lllcrowdedness = 3.33333333
|
||||||
|
|
||||||
spacing = 1 # Spacing indicator
|
spacing = 1 # Spacing indicator
|
||||||
|
|
||||||
menuWidth = 5 # Menu width
|
|
||||||
|
|
||||||
# Powerline-specific parameters
|
# Powerline-specific parameters
|
||||||
powerlineScaleY = 1 # Vertical scale
|
powerlineScaleY = 1 # Vertical scale
|
||||||
powerlineScaleX = 1 # Horizontal scale
|
powerlineScaleX = 1 # Horizontal scale
|
||||||
|
@ -255,7 +253,7 @@ spacing = 3
|
||||||
# NOTE: this section is highly experimental
|
# NOTE: this section is highly experimental
|
||||||
# HANDLE WITH EXTREME CARE
|
# HANDLE WITH EXTREME CARE
|
||||||
# Expanded : I heard someone want it being wider...
|
# Expanded : I heard someone want it being wider...
|
||||||
[wd-extended.multiplies]
|
[wd-7.multiplies]
|
||||||
width = 1.152 # 576mem for normal char
|
width = 1.152 # 576mem for normal char
|
||||||
sb = 1.375
|
sb = 1.375
|
||||||
jut = 1.15
|
jut = 1.15
|
||||||
|
@ -265,20 +263,14 @@ rbalance = 1.375
|
||||||
tbalance = 1.100
|
tbalance = 1.100
|
||||||
|
|
||||||
[extended]
|
[extended]
|
||||||
inherits = ['wd-extended']
|
inherits = ['wd-7']
|
||||||
|
|
||||||
[menu-subfamily-extended]
|
|
||||||
menuWidth = 7
|
|
||||||
|
|
||||||
# Compressed : And someone else want it being narrower
|
# Compressed : And someone else want it being narrower
|
||||||
[wd-condensed.multiplies]
|
[wd-3.multiplies]
|
||||||
width = 0.9
|
width = 0.9
|
||||||
sb = 0.9
|
sb = 0.9
|
||||||
[condensed]
|
[condensed]
|
||||||
inherits = ['wd-condensed']
|
inherits = ['wd-3']
|
||||||
|
|
||||||
[menu-subfamily-condensed]
|
|
||||||
menuWidth = 3
|
|
||||||
|
|
||||||
[shape-curly-bar]
|
[shape-curly-bar]
|
||||||
straightBar = 0
|
straightBar = 0
|
||||||
|
|
|
@ -11,6 +11,7 @@ module.exports = function(output, family, hs, formats) {
|
||||||
font-family: '${family + " Web"}';
|
font-family: '${family + " Web"}';
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-weight: ${term.cssWeight};
|
font-weight: ${term.cssWeight};
|
||||||
|
font-stretch: ${term.cssStretch};
|
||||||
font-style: ${term.cssStyle};
|
font-style: ${term.cssStyle};
|
||||||
src: ${src};
|
src: ${src};
|
||||||
}
|
}
|
||||||
|
@ -22,6 +23,7 @@ module.exports = function(output, family, hs, formats) {
|
||||||
font-family: '${family + " Web Oblique"}';
|
font-family: '${family + " Web Oblique"}';
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-weight: ${term.cssWeight};
|
font-weight: ${term.cssWeight};
|
||||||
|
font-stretch: ${term.cssStretch};
|
||||||
src: ${src};
|
src: ${src};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
62
verdafile.js
62
verdafile.js
|
@ -102,53 +102,68 @@ const RawCollectPlans = computed("raw-collect-plans", async target => {
|
||||||
const [rp] = await target.need(RawPlans);
|
const [rp] = await target.need(RawPlans);
|
||||||
return rp.collectPlans;
|
return rp.collectPlans;
|
||||||
});
|
});
|
||||||
const Weights = computed("weights", async target => {
|
const Weights = computed("metadata:global-weights", async target => {
|
||||||
const [rp] = await target.need(RawPlans);
|
const [rp] = await target.need(RawPlans);
|
||||||
return rp.weights;
|
return rp.weights;
|
||||||
});
|
});
|
||||||
const Slants = computed("slants", async target => {
|
const Slants = computed("metadata:global-slants", async target => {
|
||||||
const [rp] = await target.need(RawPlans);
|
const [rp] = await target.need(RawPlans);
|
||||||
return rp.slants;
|
return rp.slants;
|
||||||
});
|
});
|
||||||
|
const Widths = computed("metadata:global-widths", async target => {
|
||||||
|
const [rp] = await target.need(RawPlans);
|
||||||
|
return rp.widths;
|
||||||
|
});
|
||||||
|
|
||||||
function getSuffixSet(weights, slants) {
|
function getSuffixSet(weights, slants, widths) {
|
||||||
const mapping = {};
|
const mapping = {};
|
||||||
for (const w in weights) {
|
for (const w in weights) {
|
||||||
for (const s in slants) {
|
for (const s in slants) {
|
||||||
const suffix =
|
for (const wd in widths) {
|
||||||
(w === "regular" ? (s === "upright" ? "regular" : "") : w) +
|
const suffix =
|
||||||
(s === "upright" ? "" : s);
|
(wd === "normal" ? "" : wd) +
|
||||||
mapping[suffix] = {
|
(w === "regular" ? "" : w) +
|
||||||
hives: [`w-${weights[w].shape}`, `s-${s}`],
|
(s === "upright" ? "" : s) || "regular";
|
||||||
weight: w,
|
mapping[suffix] = {
|
||||||
cssWeight: weights[w].css || w,
|
hives: [`w-${weights[w].shape}`, `s-${s}`, `wd-${widths[wd].shape}`],
|
||||||
menuWeight: weights[w].menu || weights[w].css || w,
|
weight: w,
|
||||||
slant: s,
|
cssWeight: weights[w].css || w,
|
||||||
cssStyle: slants[s] || s,
|
menuWeight: weights[w].menu || weights[w].css || w,
|
||||||
menuStyle: slants[s] || s
|
width: wd,
|
||||||
};
|
cssStretch: widths[wd].css || wd,
|
||||||
|
menuWidth: widths[wd].menu || widths[wd].css || wd,
|
||||||
|
slant: s,
|
||||||
|
cssStyle: slants[s] || s,
|
||||||
|
menuStyle: slants[s] || s
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mapping;
|
return mapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Suffixes = computed(`suffixes`, async target => {
|
const Suffixes = computed(`suffixes`, async target => {
|
||||||
const [weights, slants] = await target.need(Weights, Slants);
|
const [weights, slants, widths] = await target.need(Weights, Slants, Widths);
|
||||||
return getSuffixSet(weights, slants);
|
return getSuffixSet(weights, slants, widths);
|
||||||
});
|
});
|
||||||
|
|
||||||
const FontBuildingParameters = computed(`font-building-parameters`, async target => {
|
const FontBuildingParameters = computed(`font-building-parameters`, async target => {
|
||||||
const [buildPlans, defaultWeights, defaultSlants] = await target.need(
|
const [buildPlans, defaultWeights, defaultSlants, defaultWidths] = await target.need(
|
||||||
BuildPlans,
|
BuildPlans,
|
||||||
Weights,
|
Weights,
|
||||||
Slants
|
Slants,
|
||||||
|
Widths
|
||||||
);
|
);
|
||||||
const fontInfos = {};
|
const fontInfos = {};
|
||||||
const bp = {};
|
const bp = {};
|
||||||
for (const p in buildPlans) {
|
for (const p in buildPlans) {
|
||||||
const { pre, post, prefix, family, weights, slants, hintParams } = buildPlans[p];
|
const { pre, post, prefix, family, weights, slants, widths, hintParams } = buildPlans[p];
|
||||||
const targets = [];
|
const targets = [];
|
||||||
const suffixMapping = getSuffixSet(weights || defaultWeights, slants || defaultSlants);
|
const suffixMapping = getSuffixSet(
|
||||||
|
weights || defaultWeights,
|
||||||
|
slants || defaultSlants,
|
||||||
|
widths || defaultWidths
|
||||||
|
);
|
||||||
for (const suffix in suffixMapping) {
|
for (const suffix in suffixMapping) {
|
||||||
if (weights && !weights[suffixMapping[suffix].weight]) continue;
|
if (weights && !weights[suffixMapping[suffix].weight]) continue;
|
||||||
if (slants && !slants[suffixMapping[suffix].slant]) continue;
|
if (slants && !slants[suffixMapping[suffix].slant]) continue;
|
||||||
|
@ -160,8 +175,10 @@ const FontBuildingParameters = computed(`font-building-parameters`, async target
|
||||||
family,
|
family,
|
||||||
hives: ["iosevka", ...preHives, ...suffixMapping[suffix].hives, ...postHives],
|
hives: ["iosevka", ...preHives, ...suffixMapping[suffix].hives, ...postHives],
|
||||||
menuWeight: suffixMapping[suffix].menuWeight,
|
menuWeight: suffixMapping[suffix].menuWeight,
|
||||||
|
menuWidth: suffixMapping[suffix].menuWidth,
|
||||||
menuStyle: suffixMapping[suffix].menuStyle,
|
menuStyle: suffixMapping[suffix].menuStyle,
|
||||||
cssWeight: suffixMapping[suffix].cssWeight,
|
cssWeight: suffixMapping[suffix].cssWeight,
|
||||||
|
cssStretch: suffixMapping[suffix].cssStretch,
|
||||||
cssStyle: suffixMapping[suffix].cssStyle,
|
cssStyle: suffixMapping[suffix].cssStyle,
|
||||||
hintParams: hintParams || []
|
hintParams: hintParams || []
|
||||||
};
|
};
|
||||||
|
@ -227,7 +244,7 @@ const CollectionPartsOf = computed.group("collection-parts-of", async (target, i
|
||||||
const BuildTTF = file.make(
|
const BuildTTF = file.make(
|
||||||
(gr, fn) => `${BUILD}/${gr}/${fn}.ttf`,
|
(gr, fn) => `${BUILD}/${gr}/${fn}.ttf`,
|
||||||
async (target, output, _gr, fn) => {
|
async (target, output, _gr, fn) => {
|
||||||
const [{ hives, family, menuWeight, menuStyle }, version] = await target.need(
|
const [{ hives, family, menuWeight, menuStyle, menuWidth }, version] = await target.need(
|
||||||
HivesOf(fn),
|
HivesOf(fn),
|
||||||
Version
|
Version
|
||||||
);
|
);
|
||||||
|
@ -244,6 +261,7 @@ const BuildTTF = file.make(
|
||||||
["--ver", version],
|
["--ver", version],
|
||||||
["--menu-weight", menuWeight],
|
["--menu-weight", menuWeight],
|
||||||
["--menu-slant", menuStyle],
|
["--menu-slant", menuStyle],
|
||||||
|
["--menu-width", menuWidth],
|
||||||
hives
|
hives
|
||||||
);
|
);
|
||||||
await run("otfccbuild", otdTmp, "-o", ttfTmp, "-O3", "--keep-average-char-width");
|
await run("otfccbuild", otdTmp, "-o", ttfTmp, "-O3", "--keep-average-char-width");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue