Skip to content

Commit 854b4f7

Browse files
authored
Improve shape of "s" under extra wides (be5invis#2460) (be5invis#2461)
1 parent 15a0c47 commit 854b4f7

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

packages/font-glyphs/src/letter/latin/s.ptl

+15-9
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ glyph-block Letter-Latin-S : begin
3939
yLoopTop -- 0.333 * XH + 0.125 * fine
4040
swBefore -- sw
4141

42+
define [SNeck df height stroke ess] : begin
43+
local adjustFactor : 0.1 * (df.rightSB - df.leftSB) / height
44+
return : list
45+
~~~ [alsoThru 0.5 (0.7 + adjustFactor)]
46+
g4 [pre@mix@post 0.5] [pre@mix@post 0.5] [widths.center ess]
47+
~~~ [alsoThru 0.5 (0.3 - adjustFactor)]
48+
4249
define [SStrokeImpl df top bot st sb stroke refSwEss] : begin
4350
local ess : refSwEss * stroke / Stroke
4451
define archDepth : AdviceSArchDepth (top - bot) (-1) stroke
@@ -52,7 +59,7 @@ glyph-block Letter-Latin-S : begin
5259
hookstart top (sw -- stroke)
5360

5461
g4 df.leftSB (top - archDepth)
55-
alsoThru.g2 0.5 0.5 [widths.center ess]
62+
~~~ [SNeck df (top - bot) stroke ess]
5663
g4 (df.rightSB - SOBot) (bot + archDepth) [widths.rhs stroke]
5764

5865
match sb
@@ -72,7 +79,7 @@ glyph-block Letter-Latin-S : begin
7279
g4 df.leftSB (CAP - Hook) [widths.rhs stroke]
7380
hookstart CAP (sw -- stroke)
7481
g4 df.rightSB (CAP - archDepth)
75-
alsoThru.g2 0.5 0.5 [widths.center ess]
82+
~~~ [SNeck df CAP stroke ess]
7683
g4 (df.leftSB + SOBot) archDepth [widths.lhs stroke]
7784
match sb
7885
[Just SLAB-CLASSICAL] : SerifedArcEnd.LtrLhs df.rightSB 0 stroke Hook
@@ -94,7 +101,7 @@ glyph-block Letter-Latin-S : begin
94101
hookstart XH (sw -- stroke)
95102

96103
g4 (df.leftSB - OX) (XH - archDepth)
97-
alsoThru.g2 0.5 0.5 [widths.center ess]
104+
~~~ [SNeck df XH stroke ess]
98105
g4 (df.rightSB + OX - SOBot) (archDepth) [widths.rhs stroke]
99106

100107
match sb
@@ -116,10 +123,9 @@ glyph-block Letter-Latin-S : begin
116123
g4 (df.rightSB + OX / 4 - [HSwToV soStart]) (top - hook)
117124
hookstart (top - soStart) (sw -- fine)
118125
g4 (df.leftSB + oXLeftTop + offsetLT.x) (top - archDepth + offsetLT.y)
119-
g2
120-
offsetC.x + [mix (df.leftSB + oXLeftTop + offsetLT.x) (df.rightSB - SOBot - offsetRB.x) 0.5]
121-
offsetC.y + [mix (top - archDepth) (archDepth) 0.5]
122-
widths.center stroke
126+
~~~ [virt pre@ (top - archDepth)]
127+
~~~ [g4 [pre@mix@post 0.5 offsetC.x] [pre@mix@post 0.5 offsetC.y] [widths.center stroke]]
128+
~~~ [virt post@ (archDepth)]
123129
g4 (df.rightSB - SOBot - offsetRB.x) (archDepth + offsetRB.y) [widths.rhs fine]
124130
hookend soEnd (sw -- fine)
125131
g4 (df.leftSB + SOBot + [HSwToV soEnd]) (hook) [widths.rhs fine]
@@ -136,7 +142,7 @@ glyph-block Letter-Latin-S : begin
136142
g4 df.rightSB (top - Hook) [widths.lhs stroke]
137143
hookstart top (sw -- stroke)
138144
g4 df.leftSB (top - archDepth)
139-
alsoThru.g2 0.5 0.5 [widths.center ess]
145+
~~~ [SNeck df top stroke ess]
140146
g4 (df.rightSB - SOBot) (archDepth) [widths.rhs stroke]
141147
arcvh
142148
flat [arch.adjust-x.top df.middle] 0 [widths.rhs Stroke]
@@ -152,7 +158,7 @@ glyph-block Letter-Latin-S : begin
152158
g4 (df.leftSB - OX) (XH - SHook) [widths.rhs stroke]
153159
hookstart XH (sw -- stroke)
154160
g4 (df.rightSB + OX) (XH - archDepth)
155-
alsoThru.g2 0.5 0.5 [widths.center ess]
161+
~~~ [SNeck df XH stroke ess]
156162
g4 (df.leftSB - OX + SOBot) (archDepth) [widths.lhs stroke]
157163
match sb
158164
[Just SLAB-CLASSICAL] : SerifedArcEnd.LtrLhs df.rightSB 0 stroke SHook

params/shape-width.toml

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ tbalance = 1
1414
tbalance2 = 1
1515
archDepth = 1
1616
smallArchDepth = 1
17+
essRatio = 1
1718

1819
# "Grade 9"
1920
[shapeWidth.blend.720]
@@ -32,6 +33,7 @@ tbalance = 1.210
3233
tbalance2 = 1.210
3334
archDepth = 1.103
3435
smallArchDepth = 1.103
36+
essRatio = 0.953
3537

3638
# "Grade 8"
3739
[shapeWidth.blend.657]
@@ -66,6 +68,7 @@ tbalance = 1.100
6668
tbalance2 = 1.100
6769
archDepth = 1.050
6870
smallArchDepth = 1.050
71+
essRatio = 1
6972

7073
# "Grade 6"
7174
[shapeWidth.blend.547]
@@ -119,6 +122,7 @@ tbalance = 0.909
119122
tbalance2 = 0.909
120123
archDepth = 0.952
121124
smallArchDepth = 0.952
125+
essRatio = 1
122126

123127
# Slab correlation
124128
[shapeWidth-serifs-slab.multiplies.blend.500]

0 commit comments

Comments
 (0)