Support slope-dependent digit form control (#724).
This commit is contained in:
parent
fa150fba6b
commit
1358f914a5
10 changed files with 32 additions and 19 deletions
12
README.md
12
README.md
|
@ -324,9 +324,6 @@ Configuration of build plans are organized under `[buildPlans.<plan name>]` sect
|
||||||
- Otherwise the font will be sans-serif.
|
- Otherwise the font will be sans-serif.
|
||||||
* `no-cv-ss`: Optional, Boolean, disables `cv##` and `ss##` OpenType features.
|
* `no-cv-ss`: Optional, Boolean, disables `cv##` and `ss##` OpenType features.
|
||||||
* `no-ligation`: Optional, Boolean, disables ligations.
|
* `no-ligation`: Optional, Boolean, disables ligations.
|
||||||
* `digit-form`: Optional, String, configures the default form of digits (figures).
|
|
||||||
- When set to `old-style`, old-style digit figures will be used.
|
|
||||||
- When absent or set to `lining`, lining digit figures will be used.
|
|
||||||
|
|
||||||
Build plan could have 5 optional subsections: `ligations`, `variants`, `weights`, `widths` and `slopes`.
|
Build plan could have 5 optional subsections: `ligations`, `variants`, `weights`, `widths` and `slopes`.
|
||||||
|
|
||||||
|
@ -424,8 +421,15 @@ Subsection `variants` is used to configure character variants in the font. Prope
|
||||||
<!-- BEGIN Section-Cherry-Picking-Styles -->
|
<!-- BEGIN Section-Cherry-Picking-Styles -->
|
||||||
<!-- THIS SECTION IS AUTOMATICALLY GENERATED. DO NOT EDIT. -->
|
<!-- THIS SECTION IS AUTOMATICALLY GENERATED. DO NOT EDIT. -->
|
||||||
|
|
||||||
* `design`, `upright`, `italic`, and `oblique`: Optional, Dictionary, defines styles for individual characters. The choices are organized in key-value pairs, assigning a variant to a character group. Alternatively, you could assign numbers to `cv##` tags, like what you did when using OpenType in CSS. Assignments under `design` will be applied to all the slopes, and `upright`, `italic`, and `oblique` will apply to corresponded slopes. The valid combinations include:
|
* `design`, `upright`, `italic`, and `oblique`: Optional, Dictionary, defines styles for individual characters. The choices are organized in key-value pairs, assigning a variant to a character group. Alternatively, you could assign numbers to `cv##` tags, like what you did when using OpenType in CSS. Assignments under `design` will be applied to all the slopes, and `upright`, `italic`, and `oblique` will apply to corresponded slopes.
|
||||||
|
|
||||||
|
In addition, style selector for default digit form also uses these dictionaries.
|
||||||
|
|
||||||
|
The valid combinations include:
|
||||||
|
|
||||||
|
- Default digit form:
|
||||||
|
- `digit-form = 'lining'`: Lining (default).
|
||||||
|
- `digit-form = 'old-style'`: Old-style.
|
||||||
- Styles for `A`, `Λ`, `Δ`:
|
- Styles for `A`, `Λ`, `Δ`:
|
||||||
+ `turn-v = 'straight'`, `cv01 = 1`: Standard, straight `A`, `Λ`, `Δ` (default).
|
+ `turn-v = 'straight'`, `cv01 = 1`: Standard, straight `A`, `Λ`, `Δ` (default).
|
||||||
+ `turn-v = 'curly'`, `cv01 = 2`: Slightly curly `A`, `Λ`, `Δ`, like Iosevka 2.x.
|
+ `turn-v = 'curly'`, `cv01 = 2`: Slightly curly `A`, `Λ`, `Δ`, like Iosevka 2.x.
|
||||||
|
|
|
@ -4,3 +4,4 @@
|
||||||
* Fix incorrect serifs of Greek Small Rho (#718).
|
* Fix incorrect serifs of Greek Small Rho (#718).
|
||||||
* Add derived bold / italic / sans-serif / typewriter letters in Mathematical Alphanumeric Symbols block.
|
* Add derived bold / italic / sans-serif / typewriter letters in Mathematical Alphanumeric Symbols block.
|
||||||
* Add shorter-serif variant for capital I (#709).
|
* Add shorter-serif variant for capital I (#709).
|
||||||
|
* Support slope-dependent digit form control (#724).
|
|
@ -22,8 +22,8 @@ glyph-block Digits-Shared : begin
|
||||||
p : MarkSet.OfZone {.top OnumHeight .bot (OnumHeight - CAP)}
|
p : MarkSet.OfZone {.top OnumHeight .bot (OnumHeight - CAP)}
|
||||||
|
|
||||||
glyph-block-export CodeLnum CodeOnum
|
glyph-block-export CodeLnum CodeOnum
|
||||||
define [CodeLnum u] : if para.defaultToOldStyleFigures null u
|
define [CodeLnum u] : if (para.variantSelector.__defaultDigitForm == 'oldStyle') null u
|
||||||
define [CodeOnum u] : if para.defaultToOldStyleFigures u null
|
define [CodeOnum u] : if (para.variantSelector.__defaultDigitForm == 'oldStyle') u null
|
||||||
|
|
||||||
glyph-block Digits-Zero : begin
|
glyph-block Digits-Zero : begin
|
||||||
glyph-block-import CommonShapes
|
glyph-block-import CommonShapes
|
||||||
|
|
|
@ -8,7 +8,6 @@ function initPara(data, argv) {
|
||||||
apply(para, data, ["iosevka"]);
|
apply(para, data, ["iosevka"]);
|
||||||
if (argv.shape.serifs) apply(para, data, ["serifs-" + argv.shape.serifs]);
|
if (argv.shape.serifs) apply(para, data, ["serifs-" + argv.shape.serifs]);
|
||||||
if (argv.shape.spacing) apply(para, data, ["spacing-" + argv.shape.spacing]);
|
if (argv.shape.spacing) apply(para, data, ["spacing-" + argv.shape.spacing]);
|
||||||
if (argv.shape.digitForm) apply(para, data, ["digit-form-" + argv.shape.digitForm]);
|
|
||||||
apply(para, data, ["shapeWeight"], { shapeWeight: argv.shape.weight });
|
apply(para, data, ["shapeWeight"], { shapeWeight: argv.shape.weight });
|
||||||
apply(para, data, ["shapeWidth"], { shapeWidth: argv.shape.width });
|
apply(para, data, ["shapeWidth"], { shapeWidth: argv.shape.width });
|
||||||
apply(para, data, [`s-${argv.shape.slope}`]);
|
apply(para, data, [`s-${argv.shape.slope}`]);
|
||||||
|
|
|
@ -64,9 +64,6 @@ excludedCharRanges = []
|
||||||
# - 2+ : Full (3.x)
|
# - 2+ : Full (3.x)
|
||||||
slab = 0
|
slab = 0
|
||||||
|
|
||||||
# Enable old-style digits by default?
|
|
||||||
defaultToOldStyleFigures = false
|
|
||||||
|
|
||||||
[verbose]
|
[verbose]
|
||||||
verbose = true
|
verbose = true
|
||||||
|
|
||||||
|
@ -120,9 +117,3 @@ diversityF = 0.75
|
||||||
diversityI = 0.75
|
diversityI = 0.75
|
||||||
diversityII = 0.5
|
diversityII = 0.5
|
||||||
|
|
||||||
###### Old-style figures
|
|
||||||
[digit-form-old-style]
|
|
||||||
defaultToOldStyleFigures = true
|
|
||||||
|
|
||||||
[digit-form-lining]
|
|
||||||
defaultToOldStyleFigures = false
|
|
||||||
|
|
|
@ -1644,6 +1644,13 @@ selector.r = "narrow"
|
||||||
selector."turnrrtail" = "narrow"
|
selector."turnrrtail" = "narrow"
|
||||||
selector."rflap" = "narrow"
|
selector."rflap" = "narrow"
|
||||||
|
|
||||||
|
# This is a special variant selector that controls digit form
|
||||||
|
[prime.digit-form.variants.lining]
|
||||||
|
selector.__defaultDigitForm = "lining"
|
||||||
|
|
||||||
|
[prime.digit-form.variants.old-style]
|
||||||
|
selector.__defaultDigitForm = "oldStyle"
|
||||||
|
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
|
|
||||||
[default.design]
|
[default.design]
|
||||||
|
@ -1703,6 +1710,8 @@ ascii-grave = 'straight'
|
||||||
h = 'straight'
|
h = 'straight'
|
||||||
m = 'normal'
|
m = 'normal'
|
||||||
n = 'straight'
|
n = 'straight'
|
||||||
|
# Digit form
|
||||||
|
digit-form = 'lining'
|
||||||
|
|
||||||
[default.upright-oblique]
|
[default.upright-oblique]
|
||||||
a = 'doublestorey'
|
a = 'doublestorey'
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
family = "Iosevka Custom" # Font menu family name
|
family = "Iosevka Custom" # Font menu family name
|
||||||
spacing = "normal" # Optional; Values: `normal`, `term`, `fontconfig-mono`, or `fixed`
|
spacing = "normal" # Optional; Values: `normal`, `term`, `fontconfig-mono`, or `fixed`
|
||||||
serifs = "sans" # Optional; Values: `sans` or `slab`
|
serifs = "sans" # Optional; Values: `sans` or `slab`
|
||||||
digit-form = "lining" # Optional; Values `lining` or `old-style`
|
|
||||||
|
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
# Configure variants
|
# Configure variants
|
||||||
|
|
|
@ -1 +1,5 @@
|
||||||
* `design`, `upright`, `italic`, and `oblique`: Optional, Dictionary, defines styles for individual characters. The choices are organized in key-value pairs, assigning a variant to a character group. Alternatively, you could assign numbers to `cv##` tags, like what you did when using OpenType in CSS. Assignments under `design` will be applied to all the slopes, and `upright`, `italic`, and `oblique` will apply to corresponded slopes. The valid combinations include:
|
* `design`, `upright`, `italic`, and `oblique`: Optional, Dictionary, defines styles for individual characters. The choices are organized in key-value pairs, assigning a variant to a character group. Alternatively, you could assign numbers to `cv##` tags, like what you did when using OpenType in CSS. Assignments under `design` will be applied to all the slopes, and `upright`, `italic`, and `oblique` will apply to corresponded slopes.
|
||||||
|
|
||||||
|
In addition, style selector for default digit form also uses these dictionaries.
|
||||||
|
|
||||||
|
The valid combinations include:
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
- Default digit form:
|
||||||
|
- `digit-form = 'lining'`: Lining (default).
|
||||||
|
- `digit-form = 'old-style'`: Old-style.
|
|
@ -71,6 +71,9 @@ async function processCv() {
|
||||||
const headerPath = path.resolve(__dirname, "fragments/description-cheery-picking-styles.md");
|
const headerPath = path.resolve(__dirname, "fragments/description-cheery-picking-styles.md");
|
||||||
md.log(await fs.readFile(headerPath, "utf-8"));
|
md.log(await fs.readFile(headerPath, "utf-8"));
|
||||||
|
|
||||||
|
const cvDigitFormPath = path.resolve(__dirname, "fragments/special-variant-digit-form.md");
|
||||||
|
md.log(await fs.readFile(cvDigitFormPath, "utf-8"));
|
||||||
|
|
||||||
for (const gr of variantsData.primes) {
|
for (const gr of variantsData.primes) {
|
||||||
const sampleText = gr.descSampleText
|
const sampleText = gr.descSampleText
|
||||||
.map(c => (c === "`" ? "`` ` ``" : `\`${c}\``))
|
.map(c => (c === "`" ? "`` ` ``" : `\`${c}\``))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue