From 09bc50a54c0ce5bb0768bef8bbd719af2e58a409 Mon Sep 17 00:00:00 2001 From: be5invis Date: Fri, 29 Oct 2021 21:43:13 -0700 Subject: [PATCH] Make essRatio overridable --- README.md | 1 + font-src/meta/aesthetics.ptl | 4 ++-- font-src/support/metric-override.js | 3 ++- params/shape-weight.toml | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b5d1e1425..0769fc823 100644 --- a/README.md +++ b/README.md @@ -3040,6 +3040,7 @@ Subsection `metric-override` provides ability to override certain metric values, | `powerlineScaleX`, `powerlineScaleY` | (*ratio*) | 1 | X and Y scale of Powerline glyphs. | | `powerlineShiftX`, `powerlineShiftY` | emu | 0 | X and Y shift of Powerline glyphs. | | `onumZeroHeightRatio` | (*ratio*) | 1.145 | Ratio of height of `0` under `onum` feature, to the height of `x`. | +| `essRatio` | (*ratio*) | (*varies, 1.12 for Regular*) | Ratio of the thickness of the neck of `S`/`s`, to the normal stroke width. | The values of each item could be either a number, or a string representing an expression so that it could be different for different instance fonts, or depending on default values. The syntax of valid expressions are: diff --git a/font-src/meta/aesthetics.ptl b/font-src/meta/aesthetics.ptl index d6b47fb11..ca7dc7bc6 100644 --- a/font-src/meta/aesthetics.ptl +++ b/font-src/meta/aesthetics.ptl @@ -129,8 +129,8 @@ export : define [calculateMetrics para] : begin define WideWidth3 : if (para.spacing >= 3) WideWidth0 Width define WideWidth4 : if (para.spacing >= 4) WideWidth0 Width - define Ess : Stroke * [fallback para.essx Contrast] - define EssQuestion : Stroke * [fallback para.essxq Contrast] + define Ess : Stroke * [fallback para.essRatio Contrast] + define EssQuestion : Stroke * [fallback para.essRatioq Contrast] define HalfStroke : Stroke / 2 define RightSB : Width - SB define Middle : Width / 2 diff --git a/font-src/support/metric-override.js b/font-src/support/metric-override.js index 3e16fc0be..ce6f64889 100644 --- a/font-src/support/metric-override.js +++ b/font-src/support/metric-override.js @@ -42,7 +42,8 @@ const validMetricOverrideFields = new Set([ "powerlineScaleX", "powerlineShiftY", "powerlineShiftX", - "onumZeroHeightRatio" + "onumZeroHeightRatio", + "essRatio" ]); /////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/params/shape-weight.toml b/params/shape-weight.toml index 4f8279daa..8f7f68ef0 100644 --- a/params/shape-weight.toml +++ b/params/shape-weight.toml @@ -6,7 +6,7 @@ canonicalStrokeWidthMax = 108 # sync with 900 entry below stroke = 70 # Primary stroke width contrast = 1.11 # Stroke width contrast sb = 64 # Primary sidebearings -essx = 1.12 # Proportion of widen of center of "S" +essRatio = 1.12 # Proportion of widen of center of "S" dotSize = 125 # Size of dots periodSize = 140 # Size of period @@ -43,7 +43,7 @@ vtipfineSlab = 0.9 stroke = 18 contrast = 1.08 sb = 72 -essx = 1.12 +essRatio = 1.12 dotSize = 53 periodSize = 55 @@ -83,7 +83,7 @@ stroke = 96 stroke = 114 contrast = 1.20 sb = 56 -essx = 1.05 +essRatio = 1.05 dotSize = 180 periodSize = 200