From b9ab3af082c7a9c01bfb0d90cae233fc500e9f2d Mon Sep 17 00:00:00 2001 From: John McWilliams <37010132+jmcwilliams403@users.noreply.github.com> Date: Mon, 18 Sep 2023 13:53:24 -0400 Subject: [PATCH] =?UTF-8?q?Harmonize=20serifs=20of=20`u`,=20`=C9=A5`,=20`?= =?UTF-8?q?=C9=AF`,=20and=20`=C9=B0`.=20(#2001)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changes/27.0.2.md | 2 + font-src/glyphs/letter/latin/lower-h.ptl | 103 ++++++++++++++--------- font-src/glyphs/letter/latin/lower-m.ptl | 44 +++++++--- font-src/glyphs/letter/shared.ptl | 2 + params/variants.toml | 44 +++++++--- 5 files changed, 129 insertions(+), 66 deletions(-) diff --git a/changes/27.0.2.md b/changes/27.0.2.md index a22c5964d..3bcb2e74a 100644 --- a/changes/27.0.2.md +++ b/changes/27.0.2.md @@ -1,5 +1,7 @@ * Add Characters - LATIN LETTER SMALL CAPITAL R WITH RIGHT LEG (`U+AB46`). * Fix serifs in `U+01A6`. +* Improve serifs of Turn M (`U+019C`, `U+026F`) under quasi-proportional. +* Make Turn h (`U+0265`) and Turn M with Long Leg (`U+0270`) follow serif variants of `u`. * Optimize geometry for `U+A65A` and `U+A65B` under extended width. * Fix assignment of `8` for `ss14` (#1999). diff --git a/font-src/glyphs/letter/latin/lower-h.ptl b/font-src/glyphs/letter/latin/lower-h.ptl index c6b04b4de..7cae788ea 100644 --- a/font-src/glyphs/letter/latin/lower-h.ptl +++ b/font-src/glyphs/letter/latin/lower-h.ptl @@ -30,6 +30,14 @@ glyph-block Letter-Latin-Lower-H : begin define [SmallHTopLeftSerifs tailed hookTop] : glyph-proc if [not hookTop] : include : tagged 'serifLT' : HSerif.lt SB Ascender SideJut + define [SmallTurnHSerifs tailed hookTop] : glyph-proc : begin + include : SmallTurnHLeftSerifs tailed hookTop + if [not tailed] : include : tagged 'serifRB' : HSerif.rb RightSB 0 SideJut + + define [SmallTurnHLeftSerifs tailed hookTop] : glyph-proc : begin + if [not hookTop] : include : tagged 'serifLT' : HSerif.lt SB Ascender SideJut + include : tagged 'serifLB' : HSerif.rb (SB + [HSwToV HalfStroke]) 0 Jut + define [HBar.mOverlay fHasTopSerif] : glyph-proc local barSpaceTop : Ascender - [if fHasTopSerif Stroke 0] local s : Math.min OverlayStroke (0.625 * (barSpaceTop - XH)) @@ -97,6 +105,58 @@ glyph-block Letter-Latin-Lower-H : begin include [refer-glyph "heng.\(suffix)"] AS_BASE ALSO_METRICS include : HBar.mOverlay fHasTopSerif + select-variant 'h' 'h' + link-reduced-variant 'h/descBase' 'h' + link-reduced-variant 'h/sansSerif' 'h' MathSansSerif + + select-variant 'hBar' 0x127 (follow -- 'h') + + select-variant 'hHookTop' 0x266 + select-variant 'hengHookTop' 0x267 + select-variant 'heng' 0xA727 + select-variant 'cyrl/dje' 0x452 (follow -- 'heng') (shapeFrom -- 'hengBar') + + select-variant 'cyrl/shha' 0x4BB (shapeFrom -- 'h') + + derive-composites 'hPalatalHook' 0xA795 'h/descBase' [PalatalHook.rSideJut RightSB 0] + derive-composites 'hDescender' 0x2C68 'h/descBase' [CyrDescender.rSideJut RightSB 0] + alias 'cyrl/shhaDescender' 0x527 'hDescender' + + derive-multi-part-glyphs 'hDot' 0x1E23 { 'h' 'dotAbove' } : lambda [srcs gr] : glyph-proc + local { base mark } srcs + include : refer-glyph mark + include : Translate (Width + [HSwToV HalfStroke]) 0 + include [refer-glyph base] AS_BASE ALSO_METRICS + include : LeaningAnchor.Above.VBar.l Middle + + derive-glyphs 'hCedilla' 0x1E29 'h' : lambda [src gr] : glyph-proc + local shift : Width + SB - Middle + [HSwToV HalfStroke] + include [refer-glyph 'cedillaBelow'] + include : ApparentTranslate shift 0 + include [refer-glyph src] + include : MarkSet.bp + set-base-anchor 'belowBraceL' ((-Middle) + shift - 0.5 * markExtend) belowMarkMid + set-base-anchor 'belowBraceR' ((-Middle) + shift + 0.5 * markExtend) belowMarkMid + + alias 'cyrl/tshe' 0x45B 'hBar' + + define TurnHConfig : object + serifless { no-shape } + serifed { SmallTurnHSerifs } + motionSerifed { SmallHMotionSerifs } + bottomRightSerifed { SmallHTopLeftSerifs } + + foreach { suffix { Serifs } } [Object.entries TurnHConfig] : do + create-glyph "turnh.\(suffix)" : glyph-proc + include : nShoulder + left -- (SB + [HSwToV Stroke]) + right -- RightSB + bottom -- 0 + include : VBar.l SB 0 Ascender + include : Serifs false false + include : FlipAround Middle (XH / 2) + include : MarkSet.p + create-glyph "hookturnh.\(suffix)" : glyph-proc include : nShoulder left -- (SB + [HSwToV Stroke]) @@ -120,46 +180,9 @@ glyph-block Letter-Latin-Lower-H : begin include : RetroflexHook.rExt RightSB (Descender + TailY + HalfStroke) (yAttach -- 0) include : MarkSet.p - - select-variant 'h' 'h' - select-variant 'h/tailless' (shapeFrom -- 'h') - link-reduced-variant 'h/descBase' 'h' - link-reduced-variant 'h/sansSerif' 'h' MathSansSerif - - select-variant 'hBar' 0x127 (follow -- 'h') - turned 'turnh' 0x265 'h/tailless' Middle (XH / 2) [MarkSet.p] - - select-variant 'hHookTop' 0x266 - select-variant 'hengHookTop' 0x267 - select-variant 'heng' 0xA727 - select-variant 'cyrl/dje' 0x452 (follow -- 'heng') (shapeFrom -- 'hengBar') - - select-variant 'cyrl/shha' 0x4BB (shapeFrom -- 'h') - - derive-composites 'hPalatalHook' 0xA795 'h/descBase' [PalatalHook.rSideJut RightSB 0] - derive-composites 'hDescender' 0x2C68 'h/descBase' [CyrDescender.rSideJut RightSB 0] - alias 'cyrl/shhaDescender' 0x527 'hDescender' - - select-variant 'hookturnh' 0x2AE (follow -- 'heng') - select-variant 'hookturnhrtail' 0x2AF (follow -- 'hengHookTop') - - derive-multi-part-glyphs 'hDot' 0x1E23 { 'h' 'dotAbove' } : lambda [srcs gr] : glyph-proc - local { base mark } srcs - include : refer-glyph mark - include : Translate (Width + [HSwToV HalfStroke]) 0 - include [refer-glyph base] AS_BASE ALSO_METRICS - include : LeaningAnchor.Above.VBar.l Middle - - derive-glyphs 'hCedilla' 0x1E29 'h' : lambda [src gr] : glyph-proc - local shift : Width + SB - Middle + [HSwToV HalfStroke] - include [refer-glyph 'cedillaBelow'] - include : ApparentTranslate shift 0 - include [refer-glyph src] - include : MarkSet.bp - set-base-anchor 'belowBraceL' ((-Middle) + shift - 0.5 * markExtend) belowMarkMid - set-base-anchor 'belowBraceR' ((-Middle) + shift + 0.5 * markExtend) belowMarkMid - - alias 'cyrl/tshe' 0x45B 'hBar' + select-variant 'turnh' 0x265 + select-variant 'hookturnh' 0x2AE + select-variant 'hookturnhrtail' 0x2AF glyph-block-import Letter-Blackboard : BBS BBD BBBarLeft create-glyph 'mathbb/h' 0x1D559 : glyph-proc diff --git a/font-src/glyphs/letter/latin/lower-m.ptl b/font-src/glyphs/letter/latin/lower-m.ptl index cc5f3a25a..e3ab6e514 100644 --- a/font-src/glyphs/letter/latin/lower-m.ptl +++ b/font-src/glyphs/letter/latin/lower-m.ptl @@ -68,10 +68,18 @@ glyph-block Letter-Latin-Lower-M : begin local sf : SerifFrame.fromDf df top lbot return : if fFull sf.lb.full sf.lb.outer + define [SmallMBottomMotionLeftSerif df top lbot fFull] : begin + local sf : SerifFrame.fromDf df top lbot + return : if fFull sf.lb.inner sf.lb.outer + define [SmallMBottomMiddleSerif df top mbot fFull mid] : begin local sf : SerifFrame.fromDf df top mbot return : if fFull [sf.mb.fullAt mid] [no-shape] + define [SmallMBottomMotionMiddleSerif df top mbot fFull mid] : begin + local sf : SerifFrame.fromDf df top mbot + return : if fFull [sf.mb.rightAt mid] [no-shape] + define [SmallMBottomRightSerif df top rbot fFull] : begin local sf : SerifFrame.fromDf df top rbot return : if fFull sf.rb.full sf.rb.outer @@ -94,6 +102,14 @@ glyph-block Letter-Latin-Lower-M : begin include : SmallMBottomMiddleSerif df top mbot fFull mid if [not tailed] : include : SmallMBottomRightSerif df top rbot fFull + define [FullTurnMSerifs df top lbot mbot rbot tailed earless _mid] : glyph-proc + local mid : fallback _mid df.middle + local fFull : MEnoughSpaceForFullSerifs df mid + if [not earless] : include : SmallMTopLeftSerif df top lbot fFull + include : SmallMBottomMotionLeftSerif df top lbot fFull + include : SmallMBottomMotionMiddleSerif df top mbot fFull mid + if [not tailed] : include : SmallMBottomMotionRightSerif df top rbot fFull + define [AutoSerifs df top lbot mbot rbot tailed earless _mid] : begin if SLAB [FullSerifs df top lbot mbot rbot tailed earless _mid] [no-shape] @@ -224,18 +240,6 @@ glyph-block Letter-Latin-Lower-M : begin eject-contour 'serifRB' include : PalatalHook.rExt df.rightSB 0 (sw -- df.mvs) - create-glyph "turnmLeg.\(suffix)" : glyph-proc - local df : include : dfM - include : df.markSet.p - include [refer-glyph "m.\(suffix)"] - eject-contour 'serifLT' - include : FlipAround df.middle (XH / 2) - include : VBar.r df.rightSB Descender XH df.mvs - - if (Serifs !== no-shape) : begin - local sf : SerifFrame.fromDf df XH Descender - include sf.rb.outer - create-glyph "mCrossedTail.\(suffix)" : glyph-proc local df : include : DivFrame para.diversityM 4 include : df.markSet.e @@ -292,7 +296,6 @@ glyph-block Letter-Latin-Lower-M : begin refSw -- df.mvs select-variant 'meng' 0x271 - select-variant 'turnmLeg' 0x270 select-variant 'mCrossedTail' 0xAB3A (follow -- 'meng') define TurnMConfig : SuffixCfg.weave @@ -303,7 +306,7 @@ glyph-block Letter-Latin-Lower-M : begin "toothlessRounded" { EarlessRoundedDoubleArchSmallMShape 1 0 } object "serifless" { no-shape } - "serifed" { FullSerifs } + "serifed" { FullTurnMSerifs } "topLeftSerifed" { RbSerifs } # The name-shapipng mapping is swapped by design "bottomRightSerifed" { LtSerifs } # The name-shapipng mapping is swapped by design "motionSerifed" { LtRbSerifs } @@ -328,6 +331,18 @@ glyph-block Letter-Latin-Lower-M : begin include : df.markSet.capital include : turnMShapeBody df CAP + if (!toothless && !tailed) : begin + create-glyph "turnmLeg.\(suffix)" : glyph-proc + local df : include : DivFrame para.diversityM 3 + include : df.markSet.p + include : turnMShapeBody df XH + eject-contour 'serifLT' + include : VBar.r df.rightSB Descender XH df.mvs + + if (Serifs !== no-shape) : begin + local sf : SerifFrame.fromDf df XH Descender + include sf.rb.outer + create-glyph "turnmSideways.\(suffix)" : glyph-proc local realHeight : XH * para.diversityM local realTop : XH / 2 + realHeight / 2 @@ -347,6 +362,7 @@ glyph-block Letter-Latin-Lower-M : begin select-variant 'turnm' 0x26F select-variant 'capitalTurnm' 0x19C (follow -- 'turnm') + select-variant 'turnmLeg' 0x270 select-variant 'turnmSideways' 0x1D1F (follow -- 'turnm') select-variant 'cyrl/sha.italic' (shapeFrom -- 'turnm') diff --git a/font-src/glyphs/letter/shared.ptl b/font-src/glyphs/letter/shared.ptl index 7e5e739a1..6b788dbcd 100644 --- a/font-src/glyphs/letter/shared.ptl +++ b/font-src/glyphs/letter/shared.ptl @@ -737,7 +737,9 @@ glyph-block Letter-Shared-Shapes : begin full : tagged 'serifMB' : HSerif.mbAsymmetric [mix lBarCenter rBarCenter 0.5] bot jutIn jutIn swSerif [fullAt x] : tagged 'serifMB' : HSerif.mbAsymmetric x bot jutIn jutIn swSerif left : tagged 'serifMB' : HSerif.mbAsymmetric [mix lBarCenter rBarCenter 0.5] bot jutIn 0 swSerif + [leftAt x] : tagged 'serifMB' : HSerif.mbAsymmetric x bot jutIn 0 swSerif right : tagged 'serifMB' : HSerif.mbAsymmetric [mix lBarCenter rBarCenter 0.5] bot 0 jutIn swSerif + [rightAt x] : tagged 'serifMB' : HSerif.mbAsymmetric x bot 0 jutIn swSerif set this.mt : object full : tagged 'serifMT' : HSerif.mtAsymmetric [mix lBarCenter rBarCenter 0.5] top jutIn jutIn swSerif diff --git a/params/variants.toml b/params/variants.toml index a2fa93574..233c8c6f7 100644 --- a/params/variants.toml +++ b/params/variants.toml @@ -2119,81 +2119,69 @@ next = "serifs" rank = 1 descriptionAffix = "straight terminal" selectorAffix.h = "straight" -selectorAffix."h/tailless" = "straight" selectorAffix."h/descBase" = "straight" selectorAffix."h/sansSerif" = "straight" selectorAffix.hHookTop = "straight" selectorAffix.hengHookTop = "straight" selectorAffix.heng = "straight" selectorAffix."cyrl/shha" = "straight" -selectorAffix.turnmLeg = "" [prime.h.variants-buildup.stages.tail.tailed] rank = 2 descriptionAffix = "curly tailed terminal" selectorAffix.h = "tailed" -selectorAffix."h/tailless" = "straight" selectorAffix."h/descBase" = "straight" selectorAffix."h/sansSerif" = "tailed" selectorAffix.hHookTop = "tailed" selectorAffix.hengHookTop = "straight" selectorAffix.heng = "straight" selectorAffix."cyrl/shha" = "tailed" -selectorAffix.turnmLeg = "" [prime.h.variants-buildup.stages.serifs.serifless] rank = 1 descriptionAffix = "serifs" descriptionJoiner = "without" selectorAffix.h = "serifless" -selectorAffix."h/tailless" = "serifless" selectorAffix."h/descBase" = "serifless" selectorAffix."h/sansSerif" = "serifless" selectorAffix.hHookTop = "serifless" selectorAffix.hengHookTop = "serifless" selectorAffix.heng = "serifless" selectorAffix."cyrl/shha" = "serifless" -selectorAffix.turnmLeg = "serifless" [prime.h.variants-buildup.stages.serifs.top-left-serifed] rank = 2 disableIf = [{ tail = "NOT straight" }] descriptionAffix = "serif at top left" selectorAffix.h = "topLeftSerifed" -selectorAffix."h/tailless" = "topLeftSerifed" selectorAffix."h/descBase" = "topLeftSerifed" selectorAffix."h/sansSerif" = "serifless" selectorAffix.hHookTop = "serifless" selectorAffix.hengHookTop = "serifless" selectorAffix.heng = "topLeftSerifed" selectorAffix."cyrl/shha" = "topLeftSerifed" -selectorAffix.turnmLeg = "topLeftSerifed" [prime.h.variants-buildup.stages.serifs.motion-serifed] rank = 3 descriptionAffix = "serifs at top left and bottom right" selectorAffix.h = "motionSerifed" -selectorAffix."h/tailless" = "motionSerifed" selectorAffix."h/descBase" = "topLeftSerifed" selectorAffix."h/sansSerif" = "serifless" selectorAffix.hHookTop = { if = [{ tail = "straight" }], then = "motionSerifed", else = "serifless" } selectorAffix.hengHookTop = "serifless" selectorAffix.heng = "topLeftSerifed" selectorAffix."cyrl/shha" = "motionSerifed" -selectorAffix.turnmLeg = "topLeftAndBottomRightSerifed" [prime.h.variants-buildup.stages.serifs.serifed] rank = 4 descriptionAffix = "serifs" selectorAffix.h = "serifed" -selectorAffix."h/tailless" = "serifed" selectorAffix."h/descBase" = "serifed" selectorAffix."h/sansSerif" = "serifless" selectorAffix.hHookTop = "serifed" selectorAffix.hengHookTop = "serifed" selectorAffix.heng = "serifed" selectorAffix."cyrl/shha" = "serifed" -selectorAffix.turnmLeg = "serifed" [prime.i] @@ -3523,7 +3511,11 @@ descriptionAffix = "toothed shape" selectorAffix.u = "toothed" selectorAffix."u/sansSerif" = "toothed" selectorAffix."u/uRTailBase" = "urtBase" +selectorAffix.turnh = "" +selectorAffix.hookturnh = "" +selectorAffix.hookturnhrtail = "" selectorAffix.turnm = "toothed" +selectorAffix.turnmLeg = "toothed" selectorAffix."cyrl/i.italic" = "toothed" selectorAffix."cyrl/sha.italic" = "toothed" selectorAffix."cyrl/shcha.italic" = "toothed" @@ -3538,7 +3530,11 @@ descriptionAffix = "tailed shape" selectorAffix.u = "tailed" selectorAffix."u/sansSerif" = "tailed" selectorAffix."u/uRTailBase" = "urtBase" +selectorAffix.turnh = "" +selectorAffix.hookturnh = "" +selectorAffix.hookturnhrtail = "" selectorAffix.turnm = "tailed" +selectorAffix.turnmLeg = "toothed" selectorAffix."cyrl/i.italic" = "tailed" selectorAffix."cyrl/sha.italic" = "tailed" selectorAffix."cyrl/shcha.italic" = "toothed" @@ -3553,7 +3549,11 @@ descriptionAffix = "toothless (corner bottom-right) shape" selectorAffix.u = "toothlessCorner" selectorAffix."u/sansSerif" = "toothlessCorner" selectorAffix."u/uRTailBase" = "urtBase" +selectorAffix.turnh = "" +selectorAffix.hookturnh = "" +selectorAffix.hookturnhrtail = "" selectorAffix.turnm = "toothlessCorner" +selectorAffix.turnmLeg = "toothed" selectorAffix."cyrl/i.italic" = "toothed" selectorAffix."cyrl/sha.italic" = "toothed" selectorAffix."cyrl/shcha.italic" = "toothed" @@ -3568,7 +3568,11 @@ descriptionAffix = "toothless (rounded) shape" selectorAffix.u = "toothlessRounded" selectorAffix."u/sansSerif" = "toothlessRounded" selectorAffix."u/uRTailBase" = "urtBase" +selectorAffix.turnh = "" +selectorAffix.hookturnh = "" +selectorAffix.hookturnhrtail = "" selectorAffix.turnm = "toothlessRounded" +selectorAffix.turnmLeg = "toothed" selectorAffix."cyrl/i.italic" = "toothed" selectorAffix."cyrl/sha.italic" = "toothed" selectorAffix."cyrl/shcha.italic" = "toothed" @@ -3584,7 +3588,11 @@ descriptionJoiner = "without" selectorAffix.u = "serifless" selectorAffix."u/sansSerif" = "serifless" selectorAffix."u/uRTailBase" = "serifless" +selectorAffix.turnh = "serifless" +selectorAffix.hookturnh = "serifless" +selectorAffix.hookturnhrtail = "serifless" selectorAffix.turnm = "serifless" +selectorAffix.turnmLeg = "serifless" selectorAffix."cyrl/i.italic" = "serifless" selectorAffix."cyrl/sha.italic" = "serifless" selectorAffix."cyrl/shcha.italic" = "serifless" @@ -3599,7 +3607,11 @@ descriptionAffix = "motion serifs at top-left and bottom-right" selectorAffix.u = "motionSerifed" selectorAffix."u/sansSerif" = "serifless" selectorAffix."u/uRTailBase" = "motionSerifed" +selectorAffix.turnh = "motionSerifed" +selectorAffix.hookturnh = "bottomRightSerifed" +selectorAffix.hookturnhrtail = "serifless" selectorAffix.turnm = {if = [{body = "toothed"}], then = "motionSerifed", else = "topLeftSerifed"} +selectorAffix.turnmLeg = "motionSerifed" selectorAffix."cyrl/i.italic" = "motionSerifed" selectorAffix."cyrl/sha.italic" = "motionSerifed" selectorAffix."cyrl/shcha.italic" = "motionSerifed" @@ -3615,7 +3627,11 @@ descriptionAffix = "motion serifs at left side" selectorAffix.u = "bottomRightSerifed" selectorAffix."u/sansSerif" = "serifless" selectorAffix."u/uRTailBase" = "serifless" +selectorAffix.turnh = "bottomRightSerifed" +selectorAffix.hookturnh = "bottomRightSerifed" +selectorAffix.hookturnhrtail = "serifless" selectorAffix.turnm = "bottomRightSerifed" +selectorAffix.turnmLeg = "bottomRightSerifed" selectorAffix."cyrl/i.italic" = "bottomRightSerifed" selectorAffix."cyrl/sha.italic" = "bottomRightSerifed" selectorAffix."cyrl/shcha.italic" = "serifless" @@ -3630,7 +3646,11 @@ descriptionAffix = "serifs" selectorAffix.u = "serifed" selectorAffix."u/sansSerif" = "serifless" selectorAffix."u/uRTailBase" = "serifed" +selectorAffix.turnh = "serifed" +selectorAffix.hookturnh = "serifed" +selectorAffix.hookturnhrtail = "serifed" selectorAffix.turnm = "serifed" +selectorAffix.turnmLeg = "serifed" selectorAffix."cyrl/i.italic" = "serifed" selectorAffix."cyrl/sha.italic" = "serifed" selectorAffix."cyrl/shcha.italic" = "serifed"