diff --git a/README.md b/README.md index ffad87a4a..455cc8702 100644 --- a/README.md +++ b/README.md @@ -324,9 +324,6 @@ Configuration of build plans are organized under `[buildPlans.]` sect - Otherwise the font will be sans-serif. * `no-cv-ss`: Optional, Boolean, disables `cv##` and `ss##` OpenType features. * `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`. @@ -424,8 +421,15 @@ Subsection `variants` is used to configure character variants in the font. Prope -* `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`, `Λ`, `Δ`: + `turn-v = 'straight'`, `cv01 = 1`: Standard, straight `A`, `Λ`, `Δ` (default). + `turn-v = 'curly'`, `cv01 = 2`: Slightly curly `A`, `Λ`, `Δ`, like Iosevka 2.x. diff --git a/changes/4.0.0-beta.1.md b/changes/4.0.0-beta.1.md index d80fe4713..c4bcd9bb0 100644 --- a/changes/4.0.0-beta.1.md +++ b/changes/4.0.0-beta.1.md @@ -3,4 +3,5 @@ * Make variant selectors for `m` and `u` have more effect on Cyrillic letters. * Fix incorrect serifs of Greek Small Rho (#718). * Add derived bold / italic / sans-serif / typewriter letters in Mathematical Alphanumeric Symbols block. - * Add shorter-serif variant for capital I (#709). \ No newline at end of file + * Add shorter-serif variant for capital I (#709). + * Support slope-dependent digit form control (#724). \ No newline at end of file diff --git a/font-src/glyphs/number/index.ptl b/font-src/glyphs/number/index.ptl index 5f844bc5f..d0059d46e 100644 --- a/font-src/glyphs/number/index.ptl +++ b/font-src/glyphs/number/index.ptl @@ -22,8 +22,8 @@ glyph-block Digits-Shared : begin p : MarkSet.OfZone {.top OnumHeight .bot (OnumHeight - CAP)} glyph-block-export CodeLnum CodeOnum - define [CodeLnum u] : if para.defaultToOldStyleFigures null u - define [CodeOnum u] : if para.defaultToOldStyleFigures u null + define [CodeLnum u] : if (para.variantSelector.__defaultDigitForm == 'oldStyle') null u + define [CodeOnum u] : if (para.variantSelector.__defaultDigitForm == 'oldStyle') u null glyph-block Digits-Zero : begin glyph-block-import CommonShapes diff --git a/font-src/support/parameters.js b/font-src/support/parameters.js index 9befd1203..200203204 100644 --- a/font-src/support/parameters.js +++ b/font-src/support/parameters.js @@ -8,7 +8,6 @@ function initPara(data, argv) { apply(para, data, ["iosevka"]); 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.digitForm) apply(para, data, ["digit-form-" + argv.shape.digitForm]); apply(para, data, ["shapeWeight"], { shapeWeight: argv.shape.weight }); apply(para, data, ["shapeWidth"], { shapeWidth: argv.shape.width }); apply(para, data, [`s-${argv.shape.slope}`]); diff --git a/params/parameters.toml b/params/parameters.toml index 94d954a0c..96595e569 100644 --- a/params/parameters.toml +++ b/params/parameters.toml @@ -64,9 +64,6 @@ excludedCharRanges = [] # - 2+ : Full (3.x) slab = 0 -# Enable old-style digits by default? -defaultToOldStyleFigures = false - [verbose] verbose = true @@ -120,9 +117,3 @@ diversityF = 0.75 diversityI = 0.75 diversityII = 0.5 -###### Old-style figures -[digit-form-old-style] -defaultToOldStyleFigures = true - -[digit-form-lining] -defaultToOldStyleFigures = false diff --git a/params/variants.toml b/params/variants.toml index 331998e37..1d6108fd2 100644 --- a/params/variants.toml +++ b/params/variants.toml @@ -1644,6 +1644,13 @@ selector.r = "narrow" selector."turnrrtail" = "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] @@ -1703,6 +1710,8 @@ ascii-grave = 'straight' h = 'straight' m = 'normal' n = 'straight' +# Digit form +digit-form = 'lining' [default.upright-oblique] a = 'doublestorey' diff --git a/private-build-plans.sample.toml b/private-build-plans.sample.toml index 24a32f77a..144d22aef 100644 --- a/private-build-plans.sample.toml +++ b/private-build-plans.sample.toml @@ -2,7 +2,6 @@ family = "Iosevka Custom" # Font menu family name spacing = "normal" # Optional; Values: `normal`, `term`, `fontconfig-mono`, or `fixed` serifs = "sans" # Optional; Values: `sans` or `slab` -digit-form = "lining" # Optional; Values `lining` or `old-style` ################################################################################################### # Configure variants diff --git a/utility/amend-readme/fragments/description-cheery-picking-styles.md b/utility/amend-readme/fragments/description-cheery-picking-styles.md index 5e3ca14a0..5080a42f1 100644 --- a/utility/amend-readme/fragments/description-cheery-picking-styles.md +++ b/utility/amend-readme/fragments/description-cheery-picking-styles.md @@ -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: diff --git a/utility/amend-readme/fragments/special-variant-digit-form.md b/utility/amend-readme/fragments/special-variant-digit-form.md new file mode 100644 index 000000000..c83a609b5 --- /dev/null +++ b/utility/amend-readme/fragments/special-variant-digit-form.md @@ -0,0 +1,3 @@ + - Default digit form: + - `digit-form = 'lining'`: Lining (default). + - `digit-form = 'old-style'`: Old-style. \ No newline at end of file diff --git a/utility/amend-readme/index.js b/utility/amend-readme/index.js index 551eff91e..d41544562 100644 --- a/utility/amend-readme/index.js +++ b/utility/amend-readme/index.js @@ -71,6 +71,9 @@ async function processCv() { const headerPath = path.resolve(__dirname, "fragments/description-cheery-picking-styles.md"); 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) { const sampleText = gr.descSampleText .map(c => (c === "`" ? "`` ` ``" : `\`${c}\``))