From 2ec32801d56365db129d01d66ebc2bc58b00ad16 Mon Sep 17 00:00:00 2001 From: be5invis Date: Wed, 26 May 2021 18:32:21 -0700 Subject: [PATCH] Fix #1071 Fix top hooks on some phonetic letters (`U+0253`, `U+0266`, `U+0267`, `U+01A5`) (#1072). --- changes/7.0.0.md | 1 + font-src/glyphs/common/shapes.ptl | 10 +--------- font-src/glyphs/letter/latin/lower-b.ptl | 5 +++-- font-src/glyphs/letter/latin/lower-h.ptl | 4 ++-- font-src/glyphs/letter/latin/lower-p.ptl | 4 ++-- font-src/glyphs/letter/shared.ptl | 9 +++++++++ font-src/meta/macros.ptl | 5 +++-- params/variants.toml | 6 ++++++ 8 files changed, 27 insertions(+), 17 deletions(-) diff --git a/changes/7.0.0.md b/changes/7.0.0.md index 753145df9..6a5a57ab5 100644 --- a/changes/7.0.0.md +++ b/changes/7.0.0.md @@ -124,6 +124,7 @@ - Fix missing dot on Latin Small Letter I with Stroke (`U+0268`) and Modifier Letter Small I with Stroke (`U+1DA4`) (#1043, #1066). - Fix incorrect slope of Circled Italic Latin Capital C (`U+1F12B`) and Circled Italic Latin Capital R (`U+1F12C`) (#1051). - Fix wrong glyphs for Letter Tone Five (`U+01BC`, `U+01BD`) (#1074). + - Fix top hooks on some phonetic letters (`U+0253`, `U+0266`, `U+0267`, `U+01A5`) (#1072). * Geometry refinements: - Balance stroke width of curly W/w in bold weights (#1011). - Increase visibility of Cyrillic Descender (#1018). diff --git a/font-src/glyphs/common/shapes.ptl b/font-src/glyphs/common/shapes.ptl index 51aa23a54..025eb50f2 100644 --- a/font-src/glyphs/common/shapes.ptl +++ b/font-src/glyphs/common/shapes.ptl @@ -417,14 +417,6 @@ glyph-block CommonShapes : begin g4.down.end (x - LeftHook.extension) (y - HookX) [heading Downward] set LeftHook.extension [Math.max (Width * 0.15) ([AdviceStroke 4.25] * 1.5)] - define [HooktopLeftBar] : params [stroke bottom] : glyph-proc - include : dispiro - widths.lhs [fallback stroke Stroke] - g4 RightSB (CAP - Hook) - hookstart (CAP - O) - flat SB (CAP - SmallSmoothA) - curl SB [fallback bottom 0] [heading Downward] - define [FlatSlashShape middlex middle fine kx ky] : glyph-proc include : dispiro flat (middlex - LongJut * [fallback kx 0.8]) (middle - LongJut * [fallback ky 0.4]) [widths fine fine] @@ -587,4 +579,4 @@ glyph-block CommonShapes : begin corner [mix x1 x2 (-k)] [mix y1 y2 (-k)] corner [mix x1 x2 (1+k)] [mix y1 y2 (1+k)] - glyph-block-export Rect SquareAt Ring RingAt DotAt RingStroke RingStrokeAt DotStrokeAt CircleRing CircleRingAt CircleDotAt OShape OShapeOutline OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterTopSerifAsymmetric CenterBottomSerif CenterBottomSerifAsymmetric DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif NeedSlab NeedNotItalic HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LeftHook HooktopLeftBar FlatSlashShape hookstart hookend FlipAround ScaleAround Realign ForceUpright DiagCor NameUni PointingTo WithTransform clear-anchors OBarLeftToothlessShape OBarLeftRoundedShape OBarRightToothlessShape OBarRightRoundedShape AsRadical ExtLineCenter ExtLineLhs DiagCorDs HCrossBar VERY-FAR MaskAbove MaskBelow MaskLeft MaskRight + glyph-block-export Rect SquareAt Ring RingAt DotAt RingStroke RingStrokeAt DotStrokeAt CircleRing CircleRingAt CircleDotAt OShape OShapeOutline OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterTopSerifAsymmetric CenterBottomSerif CenterBottomSerifAsymmetric DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif NeedSlab NeedNotItalic HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LeftHook FlatSlashShape hookstart hookend FlipAround ScaleAround Realign ForceUpright DiagCor NameUni PointingTo WithTransform clear-anchors OBarLeftToothlessShape OBarLeftRoundedShape OBarRightToothlessShape OBarRightRoundedShape AsRadical ExtLineCenter ExtLineLhs DiagCorDs HCrossBar VERY-FAR MaskAbove MaskBelow MaskLeft MaskRight diff --git a/font-src/glyphs/letter/latin/lower-b.ptl b/font-src/glyphs/letter/latin/lower-b.ptl index e23f4ad9b..87f8c3343 100644 --- a/font-src/glyphs/letter/latin/lower-b.ptl +++ b/font-src/glyphs/letter/latin/lower-b.ptl @@ -9,7 +9,7 @@ glyph-module glyph-block Letter-Latin-Lower-B : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives - glyph-block-import Letter-Shared-Shapes : DToothlessRise DMBlend + glyph-block-import Letter-Shared-Shapes : DToothlessRise DMBlend HooktopLeftBar create-glyph 'b.toothed' : glyph-proc include : MarkSet.b @@ -57,6 +57,7 @@ glyph-block Letter-Latin-Lower-B : begin select-variant 'b' 'b' link-reduced-variant 'b/sansSerif' 'b' MathSansSerif + link-reduced-variant 'b/zhuangToneSixBase' 'b' create-glyph 'bhooktop.toothed' : glyph-proc include : MarkSet.b @@ -92,7 +93,7 @@ glyph-block Letter-Latin-Lower-B : begin if SLAB : begin include : DownwardRightSerif [mix SB RightSB 0.9] CAP VJut - derive-glyphs 'zhuangtonesix' 0x185 'b' : lambda [src sel] : glyph-proc + derive-glyphs 'zhuangtonesix' 0x185 'b/zhuangToneSixBase' : lambda [src sel] : glyph-proc include [refer-glyph src] AS_BASE eject-contour 'serifLT' local s : Math.max (XH * 0.1) Stroke diff --git a/font-src/glyphs/letter/latin/lower-h.ptl b/font-src/glyphs/letter/latin/lower-h.ptl index 555005258..90c55a7c7 100644 --- a/font-src/glyphs/letter/latin/lower-h.ptl +++ b/font-src/glyphs/letter/latin/lower-h.ptl @@ -10,7 +10,7 @@ glyph-block Letter-Latin-Lower-H : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives glyph-block-import Letter-Shared-Shapes : RightwardTailedBar nShoulder nShoulderMask - glyph-block-import Letter-Shared-Shapes : CyrDescender CyrLeftDescender + glyph-block-import Letter-Shared-Shapes : CyrDescender CyrLeftDescender HooktopLeftBar define [SmallHSerifs tailed hookTop] : glyph-proc : if SLAB : begin if [not hookTop] : include : tagged 'serifLT' : LeftwardTopSerif SB CAP SideJut @@ -26,7 +26,7 @@ glyph-block Letter-Latin-Lower-H : begin if [not tailed] : include : tagged 'serifRB' : RightwardBottomSerif RightSB 0 SideJut define [SmallHTopLeftSerifs tailed hookTop] : glyph-proc - if [not tailed] : include : tagged 'serifRB' : RightwardBottomSerif RightSB 0 SideJut + if [not hookTop] : include : tagged 'serifLT' : LeftwardTopSerif SB CAP SideJut define HConfig : object straight { 0 SmallHSerifs } diff --git a/font-src/glyphs/letter/latin/lower-p.ptl b/font-src/glyphs/letter/latin/lower-p.ptl index 3c3dcf309..76e3a0c80 100644 --- a/font-src/glyphs/letter/latin/lower-p.ptl +++ b/font-src/glyphs/letter/latin/lower-p.ptl @@ -9,7 +9,7 @@ glyph-module glyph-block Letter-Latin-Lower-P : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives - glyph-block-import Letter-Shared-Shapes : DToothlessRise DMBlend + glyph-block-import Letter-Shared-Shapes : DToothlessRise DMBlend HooktopLeftBar define [SmallPSerifLT] : tagged 'serifLT' : LeftwardTopSerif SB XH SideJut define [SmallPSerifLB] : tagged 'serifLB' : union @@ -78,6 +78,6 @@ glyph-block Letter-Latin-Lower-P : begin create-glyph 'phooktop' 0x1A5 : glyph-proc include : MarkSet.if include : OBarLeftShape - include : HooktopLeftBar nothing Descender + include : HooktopLeftBar (bottom -- Descender) if SLAB : begin include : SmallPSerifLB \ No newline at end of file diff --git a/font-src/glyphs/letter/shared.ptl b/font-src/glyphs/letter/shared.ptl index 47a2f156e..ff368d11d 100644 --- a/font-src/glyphs/letter/shared.ptl +++ b/font-src/glyphs/letter/shared.ptl @@ -488,3 +488,12 @@ glyph-block Letter-Shared-Shapes : begin if (!SLAB && descenderOverflow > Stroke * 0.75 || connex) HBarTop (x + connex * Stroke * HVContrast) (x - descenderOverflow) Stroke glyph-proc + + glyph-block-export HooktopLeftBar + define [HooktopLeftBar] : params [bottom] : glyph-proc + include : dispiro + widths.lhs + straight.left.start (SB + HalfStroke * HVContrast + HookX) CAP + archv + flat SB (CAP - Hook - HalfStroke) + curl SB [fallback bottom 0] [heading Downward] diff --git a/font-src/meta/macros.ptl b/font-src/meta/macros.ptl index 0ff41f0aa..6e6539f18 100644 --- a/font-src/meta/macros.ptl +++ b/font-src/meta/macros.ptl @@ -138,8 +138,9 @@ define-macro glyph-block-import : syntax-rules CenterTopSerif CenterTopSerifAsymmetric CenterBottomSerif CenterBottomSerifAsymmetric DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif NeedSlab NeedNotItalic HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook - LeftHook HooktopLeftBar FlatSlashShape hookstart hookend FlipAround ScaleAround Realign - ForceUpright DiagCor NameUni PointingTo WithTransform clear-anchors OBarLeftToothlessShape OBarLeftRoundedShape OBarRightToothlessShape + LeftHook FlatSlashShape hookstart hookend FlipAround ScaleAround Realign + ForceUpright DiagCor NameUni PointingTo WithTransform clear-anchors + OBarLeftToothlessShape OBarLeftRoundedShape OBarRightToothlessShape OBarRightRoundedShape AsRadical ExtLineCenter ExtLineLhs DiagCorDs HCrossBar VERY-FAR MaskAbove MaskBelow MaskLeft MaskRight] diff --git a/params/variants.toml b/params/variants.toml index ec38eeac7..6e88c8861 100644 --- a/params/variants.toml +++ b/params/variants.toml @@ -1798,6 +1798,7 @@ rank = 1 description = "`b` with bottom-left tooth" selector.b = "toothed" selector."b/sansSerif" = "toothed" +selector."b/zhuangToneSixBase" = "toothed" selector.bhooktop = "toothed" [prime.b.variants.toothless-corner] @@ -1805,6 +1806,7 @@ rank = 2 description = "`b` without bottom-left tooth, with a corner transition" selector.b = "toothlessCorner" selector."b/sansSerif" = "toothlessCorner" +selector."b/zhuangToneSixBase" = "toothlessCorner" selector.bhooktop = "toothlessCorner" [prime.b.variants.toothless-rounded] @@ -1812,6 +1814,7 @@ rank = 3 description = "`b` without bottom-left tooth, with a rounded transition" selector.b = "toothlessRounded" selector."b/sansSerif" = "toothlessRounded" +selector."b/zhuangToneSixBase" = "toothlessRounded" selector.bhooktop = "toothlessRounded" [prime.b.variants.toothed-motion-serifed] @@ -1819,6 +1822,7 @@ rank = 4 description = "`b` with motion serif, and with bottom-left tooth" selector.b = "toothedMotionSerifed" selector."b/sansSerif" = "toothed" +selector."b/zhuangToneSixBase" = "toothed" selector.bhooktop = "toothed" [prime.b.variants.toothless-corner-motion-serifed] @@ -1826,6 +1830,7 @@ rank = 5 description = "`b` with motion serif, and without bottom-left tooth, with a corner transition" selector.b = "toothlessCornerMotionSerifed" selector."b/sansSerif" = "toothlessCorner" +selector."b/zhuangToneSixBase" = "toothlessCorner" selector.bhooktop = "toothlessCorner" [prime.b.variants.toothless-rounded-motion-serifed] @@ -1833,6 +1838,7 @@ rank = 6 description = "`b` with motion serif, and without bottom-left tooth, with a rounded transition" selector.b = "toothlessRoundedMotionSerifed" selector."b/sansSerif" = "toothlessRounded" +selector."b/zhuangToneSixBase" = "toothlessRounded" selector.bhooktop = "toothlessRounded"