From 95fbf456c3a0768dac130dc30ce55a8c05db8b6c Mon Sep 17 00:00:00 2001 From: be5invis Date: Tue, 19 Jan 2021 02:39:51 -0800 Subject: [PATCH] Refine the shape of Slab `S` and `s` to add serifs at both terminals (#800). --- changes/4.6.0.md | 3 ++- font-src/glyphs/letter/latin/s.ptl | 11 ++++++----- font-src/glyphs/letter/shared.ptl | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/changes/4.6.0.md b/changes/4.6.0.md index 36a68d6b6..97fee93da 100644 --- a/changes/4.6.0.md +++ b/changes/4.6.0.md @@ -1,3 +1,4 @@ * Add diagonal-tailed variant of `i`, `j`, `k`, `l`, `t` (#795). * Fix broken geometry of `K` under ultra-wide (#800). - * Add straight-bar AE (`Æ`), follows variant selector for `A` (#800). \ No newline at end of file + * Add straight-bar AE (`Æ`), follows variant selector for `A` (#800). + * Refine the shape of Slab `S` and `s` to add serifs at both terminals (#800). \ No newline at end of file diff --git a/font-src/glyphs/letter/latin/s.ptl b/font-src/glyphs/letter/latin/s.ptl index c67a58f9f..a9d3a5436 100644 --- a/font-src/glyphs/letter/latin/s.ptl +++ b/font-src/glyphs/letter/latin/s.ptl @@ -10,7 +10,8 @@ glyph-block Letter-Latin-S : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives glyph-block-import Letter-Blackboard : BBS BBD - glyph-block-import Letter-Shared-Shapes : SerifedArcStart_RtlLhs ArcStartSerif + glyph-block-import Letter-Shared-Shapes : SerifedArcStart_RtlLhs SerifedArcEnd_RtlRhs + glyph-block-import Letter-Shared-Shapes : ArcStartSerif ArcEndSerif define SOBot OX define [SmallSTensionCoeff stroke] : mix [StrokeWidthBlend 1 0.375 stroke] 1 : clamp 0 1 : Math.pow (Width / (UPM * 0.55)) 0.5 @@ -44,8 +45,7 @@ glyph-block Letter-Latin-S : begin g4 SB (CAP - smooth) alsoThru.g2 0.5 0.5 [widths.center ess] g4 (RightSB - SOBot) smooth [widths 0 stroke] - hookend O (sw -- stroke) (swItalicAdj -- Stroke) - g4 (SB + SOBot) Hook + SerifedArcEnd_RtlRhs SB Middle 0 stroke Hook define [RevSStroke] : begin local stroke : AdviceStroke2 2 3 CAP @@ -86,8 +86,7 @@ glyph-block Letter-Latin-S : begin g4 (SB + OX / 8) (XH - smooth) SNeck (stroke -- ess) (slantCoeff -- -0.02) (dist -- [SmallSDistCoeff]) (tensionCoeff -- [SmallSTensionCoeff stroke]) g4 (RightSB - SOBot) (smooth) [widths 0 stroke] - hookend O (sw -- stroke) (swItalicAdj -- Stroke) - g4 (SB + SOBot) SHook + SerifedArcEnd_RtlRhs SB Middle 0 stroke SHook glyph-block-export SStrokeAlt define [SStrokeAlt] : params [top hook swStart swEnd oXLeftTop offsetLT offsetRB offsetC] : begin @@ -143,6 +142,7 @@ glyph-block Letter-Latin-S : begin create-glyph 'S' 'S' : glyph-proc include : MarkSet.capital if SLAB : include : ArcStartSerif RightSB CAP Stroke Hook + if SLAB : include : ArcEndSerif SB 0 Stroke Hook include : [if SLAB SlabSStroke SStroke] alias 'cyrl/Dze' 0x405 'S' @@ -150,6 +150,7 @@ glyph-block Letter-Latin-S : begin create-glyph 's' 's' : glyph-proc include : MarkSet.e if SLAB : include : ArcStartSerif RightSB XH [AdviceStroke2 2 3 XH] Hook + if SLAB : include : ArcEndSerif SB 0 [AdviceStroke2 2 3 XH] Hook include : [if SLAB SlabSmallSStroke SmallSStroke] alias 'cyrl/dze' 0x455 's' diff --git a/font-src/glyphs/letter/shared.ptl b/font-src/glyphs/letter/shared.ptl index ce877c5ae..9aa7a30ac 100644 --- a/font-src/glyphs/letter/shared.ptl +++ b/font-src/glyphs/letter/shared.ptl @@ -201,6 +201,19 @@ glyph-block Letter-Shared-Shapes : begin ShoulderMidKnotLhs cx (cy - O) fine sw (-1) (-1) archv + glyph-block-export SerifedArcEnd_RtlRhs + define [SerifedArcEnd_RtlRhs sx cx cy sw hook origBar] : begin + local barSw : if origBar sw [ArcStartSerifWidth sw] + local fine : barSw * [mix CThinB (ShoulderFine / Stroke) 0.5] + return : list + arcvh + ShoulderMidKnotRhs cx (cy + O) fine sw (+1) (+1) + archv + g4.up.end + sx + (barSw - fine) * HVContrast + cy + hook - O * 2 + widths.rhs.heading fine Upward + glyph-block-export ArcStartSerifWidth define [ArcStartSerifWidth stroke] : Math.max (stroke * 0.875) [AdviceStroke 3.5] @@ -208,6 +221,10 @@ glyph-block Letter-Shared-Shapes : begin define [ArcStartSerif cx cy stroke hook] : begin return : VBarRight cx (cy - hook + O * 2) cy [ArcStartSerifWidth stroke] + glyph-block-export ArcEndSerif + define [ArcEndSerif cx cy stroke hook] : begin + return : VBarLeft cx (cy + hook - O * 2) cy [ArcStartSerifWidth stroke] + glyph-block-export ArcStartHookTop define [ArcStartHookTop cx cy sw hookX hookY] : union VBarRight cx (cy - hookY + O * 2) cy sw