Make essRatio overridable

This commit is contained in:
be5invis 2021-10-29 21:43:13 -07:00
parent d9c60a27ae
commit 09bc50a54c
4 changed files with 8 additions and 6 deletions

View file

@ -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:

View file

@ -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

View file

@ -42,7 +42,8 @@ const validMetricOverrideFields = new Set([
"powerlineScaleX",
"powerlineShiftY",
"powerlineShiftX",
"onumZeroHeightRatio"
"onumZeroHeightRatio",
"essRatio"
]);
///////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -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