Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve shape of "s" under extra wides (#2460) #2461

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions packages/font-glyphs/src/letter/latin/s.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ glyph-block Letter-Latin-S : begin
yLoopTop -- 0.333 * XH + 0.125 * fine
swBefore -- sw

define [SNeck df height stroke ess] : begin
local adjustFactor : 0.1 * (df.rightSB - df.leftSB) / height
return : list
~~~ [alsoThru 0.5 (0.7 + adjustFactor)]
g4 [pre@mix@post 0.5] [pre@mix@post 0.5] [widths.center ess]
~~~ [alsoThru 0.5 (0.3 - adjustFactor)]

define [SStrokeImpl df top bot st sb stroke refSwEss] : begin
local ess : refSwEss * stroke / Stroke
define archDepth : AdviceSArchDepth (top - bot) (-1) stroke
Expand All @@ -52,7 +59,7 @@ glyph-block Letter-Latin-S : begin
hookstart top (sw -- stroke)

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

match sb
Expand All @@ -72,7 +79,7 @@ glyph-block Letter-Latin-S : begin
g4 df.leftSB (CAP - Hook) [widths.rhs stroke]
hookstart CAP (sw -- stroke)
g4 df.rightSB (CAP - archDepth)
alsoThru.g2 0.5 0.5 [widths.center ess]
~~~ [SNeck df CAP stroke ess]
g4 (df.leftSB + SOBot) archDepth [widths.lhs stroke]
match sb
[Just SLAB-CLASSICAL] : SerifedArcEnd.LtrLhs df.rightSB 0 stroke Hook
Expand All @@ -94,7 +101,7 @@ glyph-block Letter-Latin-S : begin
hookstart XH (sw -- stroke)

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

match sb
Expand All @@ -116,10 +123,9 @@ glyph-block Letter-Latin-S : begin
g4 (df.rightSB + OX / 4 - [HSwToV soStart]) (top - hook)
hookstart (top - soStart) (sw -- fine)
g4 (df.leftSB + oXLeftTop + offsetLT.x) (top - archDepth + offsetLT.y)
g2
offsetC.x + [mix (df.leftSB + oXLeftTop + offsetLT.x) (df.rightSB - SOBot - offsetRB.x) 0.5]
offsetC.y + [mix (top - archDepth) (archDepth) 0.5]
widths.center stroke
~~~ [virt pre@ (top - archDepth)]
~~~ [g4 [pre@mix@post 0.5 offsetC.x] [pre@mix@post 0.5 offsetC.y] [widths.center stroke]]
~~~ [virt post@ (archDepth)]
g4 (df.rightSB - SOBot - offsetRB.x) (archDepth + offsetRB.y) [widths.rhs fine]
hookend soEnd (sw -- fine)
g4 (df.leftSB + SOBot + [HSwToV soEnd]) (hook) [widths.rhs fine]
Expand All @@ -136,7 +142,7 @@ glyph-block Letter-Latin-S : begin
g4 df.rightSB (top - Hook) [widths.lhs stroke]
hookstart top (sw -- stroke)
g4 df.leftSB (top - archDepth)
alsoThru.g2 0.5 0.5 [widths.center ess]
~~~ [SNeck df top stroke ess]
g4 (df.rightSB - SOBot) (archDepth) [widths.rhs stroke]
arcvh
flat [arch.adjust-x.top df.middle] 0 [widths.rhs Stroke]
Expand All @@ -152,7 +158,7 @@ glyph-block Letter-Latin-S : begin
g4 (df.leftSB - OX) (XH - SHook) [widths.rhs stroke]
hookstart XH (sw -- stroke)
g4 (df.rightSB + OX) (XH - archDepth)
alsoThru.g2 0.5 0.5 [widths.center ess]
~~~ [SNeck df XH stroke ess]
g4 (df.leftSB - OX + SOBot) (archDepth) [widths.lhs stroke]
match sb
[Just SLAB-CLASSICAL] : SerifedArcEnd.LtrLhs df.rightSB 0 stroke SHook
Expand Down
4 changes: 4 additions & 0 deletions params/shape-width.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ tbalance = 1
tbalance2 = 1
archDepth = 1
smallArchDepth = 1
essRatio = 1

# "Grade 9"
[shapeWidth.blend.720]
Expand All @@ -32,6 +33,7 @@ tbalance = 1.210
tbalance2 = 1.210
archDepth = 1.103
smallArchDepth = 1.103
essRatio = 0.953

# "Grade 8"
[shapeWidth.blend.657]
Expand Down Expand Up @@ -66,6 +68,7 @@ tbalance = 1.100
tbalance2 = 1.100
archDepth = 1.050
smallArchDepth = 1.050
essRatio = 1

# "Grade 6"
[shapeWidth.blend.547]
Expand Down Expand Up @@ -119,6 +122,7 @@ tbalance = 0.909
tbalance2 = 0.909
archDepth = 0.952
smallArchDepth = 0.952
essRatio = 1

# Slab correlation
[shapeWidth-serifs-slab.multiplies.blend.500]
Expand Down
Loading