From b9af140fc24bb6a215448221ed6c00390c22c65b Mon Sep 17 00:00:00 2001 From: be5invis Date: Sun, 13 Aug 2023 16:44:23 -0700 Subject: [PATCH] Cleanup --- font-src/glyphs/letter/cyrillic/che.ptl | 3 ++- font-src/glyphs/letter/greek/upper-gamma.ptl | 4 +-- font-src/glyphs/letter/latin-ext/long-s.ptl | 8 +++++- font-src/glyphs/letter/latin/k.ptl | 4 +-- font-src/glyphs/letter/latin/lower-b.ptl | 5 ++-- font-src/glyphs/letter/latin/lower-d.ptl | 5 ++-- font-src/glyphs/letter/latin/lower-f.ptl | 19 +++++++------- font-src/glyphs/letter/latin/lower-h.ptl | 5 ++-- font-src/glyphs/letter/latin/lower-p.ptl | 4 +-- font-src/glyphs/letter/latin/lower-q.ptl | 3 ++- font-src/glyphs/letter/latin/lower-r.ptl | 10 +++++--- font-src/glyphs/letter/latin/lower-t.ptl | 19 ++++++++------ font-src/glyphs/letter/latin/upper-f.ptl | 4 ++- font-src/glyphs/letter/latin/upper-l.ptl | 4 ++- font-src/glyphs/letter/latin/upper-p.ptl | 5 ++-- font-src/glyphs/marks/adjust.ptl | 26 ++++++++++++++++++++ 16 files changed, 89 insertions(+), 39 deletions(-) diff --git a/font-src/glyphs/letter/cyrillic/che.ptl b/font-src/glyphs/letter/cyrillic/che.ptl index cbee41306..301a9aa54 100644 --- a/font-src/glyphs/letter/cyrillic/che.ptl +++ b/font-src/glyphs/letter/cyrillic/che.ptl @@ -7,6 +7,7 @@ glyph-module glyph-block Letter-Cyrillic-Che : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives + glyph-block-import Mark-Adjustment : LeaningAnchor glyph-block-import Letter-Shared-Shapes : SerifFrame RightwardTailedBar DToothlessRise glyph-block-import Letter-Shared-Shapes : CyrDescender @@ -22,7 +23,7 @@ glyph-block Letter-Cyrillic-Che : begin define SLAB-TAILED-BGR 6 define [CyrCheShape top pyBar bodyType slabType] : glyph-proc - set-base-anchor 'leaningBelow' (RightSB - [HSwToV HalfStroke]) 0 + include : LeaningAnchor.Below.VBar.r RightSB local bar : top * [fallback pyBar 0.5] include : match bodyType [Just BODY-TAILED] : RightwardTailedBar RightSB 0 top diff --git a/font-src/glyphs/letter/greek/upper-gamma.ptl b/font-src/glyphs/letter/greek/upper-gamma.ptl index f8a83bc7b..e62c91d2e 100644 --- a/font-src/glyphs/letter/greek/upper-gamma.ptl +++ b/font-src/glyphs/letter/greek/upper-gamma.ptl @@ -13,7 +13,7 @@ glyph-block Letter-Greek-Upper-Gamma: begin glyph-block-import Letter-Shared-Shapes : LetterBarOverlay PalatalHook glyph-block-import Letter-Blackboard : BBS BBD BBBarLeft glyph-block-import Letter-Latin-Upper-F : xMidBarShrink - glyph-block-import Mark-Adjustment : ExtendAboveBaseAnchors + glyph-block-import Mark-Adjustment : ExtendAboveBaseAnchors LeaningAnchor define SLAB-NONE 0 define SLAB-TR 1 @@ -23,7 +23,7 @@ glyph-block Letter-Greek-Upper-Gamma: begin define GammaBarLeft (SB * 1.5) define [GammaShape top slabType] : glyph-proc - set-base-anchor 'leaningBelow' (GammaBarLeft + [HSwToV HalfStroke]) 0 + include : LeaningAnchor.Below.VBar.l GammaBarLeft include : VBar.l GammaBarLeft 0 top include : HBar.t (GammaBarLeft - O) (RightSB - OX) top match slabType diff --git a/font-src/glyphs/letter/latin-ext/long-s.ptl b/font-src/glyphs/letter/latin-ext/long-s.ptl index 5773b4eac..c008d029e 100644 --- a/font-src/glyphs/letter/latin-ext/long-s.ptl +++ b/font-src/glyphs/letter/latin-ext/long-s.ptl @@ -9,6 +9,7 @@ glyph-module glyph-block Letter-Latin-Long-S : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives + glyph-block-import Mark-Adjustment : LeaningAnchor glyph-block-import Letter-Shared-Shapes : CurlyTail FlatHookDepth LetterBarOverlay glyph-block-import Letter-Shared-Shapes : PalatalHook RetroflexHook VerticalHook glyph-block-import Letter-Latin-Lower-F : StdSmallFBarLeftPos StdSmallFBarLeftPos0 fbar @@ -78,12 +79,14 @@ glyph-block Letter-Latin-Long-S : begin HSerif.mt xSerifPos XH serifLength define [LongSBentHookBase y0 m fSlab] : glyph-proc + local xTerminal : RightSB + RBalance2 + [Math.max 0 (m - [StdSmallFBarLeftPos0])] include : dispiro widths.lhs - g4 (RightSB + RBalance2 + [Math.max 0 (m - [StdSmallFBarLeftPos0])]) (Ascender - Hook) + g4 xTerminal (Ascender - Hook) hookstart (Ascender - O) flat m (Ascender - ArchDepthA) curl m 0 [heading Downward] + include : LeaningAnchor.Above.Hook m xTerminal set-base-anchor "overlay" (m + [HSwToV : 0.65 * Stroke]) (Ascender * OverlayPos) include : StandardSerifs m fSlab @@ -108,6 +111,7 @@ glyph-block Letter-Latin-Long-S : begin archv flat m (Ascender - hd.y) curl m yBot [heading Downward] + include : LeaningAnchor.Above.Hook m RightSB set-base-anchor "overlay" (m + [HSwToV : 0.65 * Stroke]) (Ascender * OverlayPos) include : StandardSerifs m fSlab @@ -157,6 +161,7 @@ glyph-block Letter-Latin-Long-S : begin create-glyph "longs.flatHookTailed\(suffix)" : glyph-proc include : MarkSet.bp + currentGlyph.copyBaseAnchorIfAbsent 'leaningAbove' 'above' include : LongSShape Ascender Descender (HookX + 0.25 * Stroke) Hook include : StandardSerifs (Middle - [HSwToV HalfStroke]) serifStyle create-forked-glyph "longsbar.flatHookTailed\(suffix)" : LongSSymmetricOverlayBar Middle @@ -167,6 +172,7 @@ glyph-block Letter-Latin-Long-S : begin create-glyph "longs.flatHookDiagonalTailed\(suffix)" : glyph-proc include : MarkSet.bp + currentGlyph.copyBaseAnchorIfAbsent 'leaningAbove' 'above' include : union intersection [MaskAbove 0] [LongSShape Ascender Descender (HookX + 0.25 * Stroke) Hook] SmallFDiagonalTail [DivFrame 1] (Middle - [HSwToV HalfStroke]) diff --git a/font-src/glyphs/letter/latin/k.ptl b/font-src/glyphs/letter/latin/k.ptl index 1cbd5d6c8..7cf854d63 100644 --- a/font-src/glyphs/letter/latin/k.ptl +++ b/font-src/glyphs/letter/latin/k.ptl @@ -11,7 +11,7 @@ glyph-block Letter-Latin-K : begin glyph-block-import Common-Derivatives glyph-block-import Mark-Shared-Metrics : markExtend glyph-block-import Mark-Above : aboveMarkMid - glyph-block-import Mark-Adjustment : ExtendBelowBaseAnchors + glyph-block-import Mark-Adjustment : ExtendBelowBaseAnchors LeaningAnchor glyph-block-import Letter-Shared-Shapes : DiagonalTailInnerRadius DiagonalTailF CyrDescender glyph-block-import Letter-Shared-Shapes : LetterBarOverlay PalatalHook TopHook @@ -498,12 +498,12 @@ glyph-block Letter-Latin-K : begin local straightBar : LegsImpl !== KLegs.Curly define [kBaseShape attachment] : glyph-proc + include : LeaningAnchor.Above.VBar.l (SB + [KBalance slabLT straightBar]) include : VBar.l (SB + [KBalance slabLT straightBar]) 0 Ascender include : LegsImpl false SB RightSB Stroke XH slabLT slabLegs attachment if slabLT : include : HSerif.lt (SB + [KBalance slabLT straightBar]) Ascender SideJut if slabLB : include : tagged 'serifLB' HSerif.mb (SB + [KBalance slabLT straightBar] + [HSwToV HalfStroke]) 0 Jut - set-base-anchor 'leaningAbove' (SB + [KBalance slabLT straightBar] + [HSwToV HalfStroke]) Ascender create-glyph "k.\(suffix)" : glyph-proc include : MarkSet.b diff --git a/font-src/glyphs/letter/latin/lower-b.ptl b/font-src/glyphs/letter/latin/lower-b.ptl index 88c5da969..c7de60e9c 100644 --- a/font-src/glyphs/letter/latin/lower-b.ptl +++ b/font-src/glyphs/letter/latin/lower-b.ptl @@ -8,6 +8,7 @@ glyph-module glyph-block Letter-Latin-Lower-B : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives + glyph-block-import Mark-Adjustment : LeaningAnchor glyph-block-import Letter-Shared : CreateAccentedComposition glyph-block-import Letter-Shared-Shapes : OBarLeft DToothlessRise DMBlend TopHook glyph-block-import Letter-Shared-Shapes : LetterBarOverlay PalatalHook @@ -43,9 +44,9 @@ glyph-block Letter-Latin-Lower-B : begin include : MarkSet.b include : Body Ascender include : Serifs + include : LeaningAnchor.Above.VBar.l SB set-base-anchor 'overlayOnExtension' (SB + [HSwToV : 0.5 * Stroke]) yOverlay set-base-anchor 'overlay' Middle (XH / 2) - set-base-anchor 'leaningAbove' (SB + [HSwToV HalfStroke]) Ascender create-glyph "bBar.\(suffix)" : glyph-proc include [refer-glyph "b.\(suffix)"] AS_BASE ALSO_METRICS @@ -89,7 +90,7 @@ glyph-block Letter-Latin-Lower-B : begin include : refer-glyph mark include : Translate (Width + [HSwToV HalfStroke]) 0 include [refer-glyph base] AS_BASE - set-base-anchor 'leaningAbove' (Middle + [HSwToV HalfStroke]) Ascender + include : LeaningAnchor.Above.VBar.l Middle glyph-block-import Letter-Blackboard : BBS BBD BBBarLeft create-glyph 'mathbb/b' 0x1D553 : glyph-proc diff --git a/font-src/glyphs/letter/latin/lower-d.ptl b/font-src/glyphs/letter/latin/lower-d.ptl index 8f09e0a27..a90ce1c12 100644 --- a/font-src/glyphs/letter/latin/lower-d.ptl +++ b/font-src/glyphs/letter/latin/lower-d.ptl @@ -9,6 +9,7 @@ glyph-block Letter-Latin-Lower-D : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives glyph-block-import Mark-Shared-Metrics : markExtend + glyph-block-import Mark-Adjustment : LeaningAnchor glyph-block-import Letter-Shared : CreateAccentedComposition CreateCommaCaronComposition glyph-block-import Letter-Shared-Shapes : OBarRight RightwardTailedBar DToothlessRise DMBlend glyph-block-import Letter-Shared-Shapes : CurlyTail LetterBarOverlay SerifFrame @@ -98,8 +99,8 @@ glyph-block Letter-Latin-Lower-D : begin include : Body df Ascender if topSerif : include : topSerif df Ascender if bottomSerif : include : bottomSerif df Ascender + include : LeaningAnchor.Above.VBar.r df.rightSB set-base-anchor 'overlayOnExtension' (df.rightSB - [HSwToV : 0.5 * Stroke]) yOverlay - set-base-anchor 'leaningAbove' (df.rightSB - [HSwToV HalfStroke]) Ascender create-glyph "dcroat.\(suffix)" : glyph-proc local df : DivFrame 1 @@ -174,7 +175,7 @@ glyph-block Letter-Latin-Lower-D : begin include : refer-glyph mark include : Translate (Width - [HSwToV HalfStroke]) 0 include [refer-glyph base] AS_BASE - set-base-anchor 'leaningAbove' (Middle - [HSwToV HalfStroke]) Ascender + include : LeaningAnchor.Above.VBar.r Middle derive-composites 'dBar' 0xA7C8 'd' HBar.m (SB - OX) (RightSB + OX) (XH * 0.5) OverlayStroke diff --git a/font-src/glyphs/letter/latin/lower-f.ptl b/font-src/glyphs/letter/latin/lower-f.ptl index f849d647b..2e060a6b8 100644 --- a/font-src/glyphs/letter/latin/lower-f.ptl +++ b/font-src/glyphs/letter/latin/lower-f.ptl @@ -8,6 +8,7 @@ glyph-module glyph-block Letter-Latin-Lower-F : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives + glyph-block-import Mark-Adjustment : LeaningAnchor glyph-block-import Letter-Shared : CreateAccentedComposition glyph-block-import Letter-Shared-Shapes : FlatHookDepth DiagonalTailL DiagonalTailStdDepth glyph-block-import Letter-Shared-Shapes : LetterBarOverlay PalatalHook @@ -27,13 +28,13 @@ glyph-block Letter-Latin-Lower-F : begin include : HSerif.mb df.middle 0 (LongJut * df.div) set-base-anchor 'palatalHookPos' (df.middle + LongJut * df.div + HalfStroke * TanSlope) 0 - define [StdFShapeT sink offset barleft sw] : sink + define [StdFShapeT sink df offset barleft sw] : sink widths.lhs sw - g4 [Math.max (barleft + offset + [HSwToV : 2.125 * sw]) (RightSB + RBalance2 - (OX - O) - offset)] (Ascender - Hook * 0.75) + g4 [Math.max (barleft + offset + [HSwToV : 2.125 * sw]) (df.rightSB + RBalance2 - (OX - O) - offset)] (Ascender - Hook * 0.75) hookstart (Ascender - O - offset) (tight -- true) flat (barleft + offset) (Ascender - ArchDepthA * 0.8) [if offset corner curl] (barleft + offset) 0 [heading Downward] - if offset {[corner (RightSB + RBalance2 - (OX - O) - offset) 0]} {} + if offset {[corner (df.rightSB + RBalance2 - (OX - O) - offset) 0]} {} define [SmallFDownExtension barLeft] : VBar.l barLeft 0.1 (Descender * 0.9) @@ -65,12 +66,12 @@ glyph-block Letter-Latin-Lower-F : begin local barLeft0 : StdSmallFBarLeftPos0 local barLeft : StdSmallFBarLeftPos barAtCenter + include : LeaningAnchor.Above.Hook barLeft (df.rightSB + barLeft - barLeft0) set-base-anchor 'overlay' (barLeft + [HSwToV : 0.5 * Stroke]) (bh / 2) - set-base-anchor 'leaningAbove' (barLeft - barLeft0 + [mix barLeft0 RightSB 0.375]) Ascender - include : StdFShapeT dispiro 0 barLeft0 Stroke + include : StdFShapeT dispiro df 0 barLeft0 Stroke include : Translate (barLeft - barLeft0) 0 - include : HCrossBar.top SB [mix SB RightSB m] bh + include : HCrossBar.top SB [mix df.leftSB df.rightSB m] bh match counterHook [Just CH-NONE] : include : SetPalatalHookPos barLeft @@ -106,7 +107,7 @@ glyph-block Letter-Latin-Lower-F : begin local hd : FlatHookDepth df set-base-anchor 'overlay' (barLeft + [HSwToV : 0.5 * Stroke]) (bh / 2) - set-base-anchor 'leaningAbove' [mix barLeft (crossRight + topHookExt) 0.375] Ascender + include : LeaningAnchor.Above.Hook barLeft (crossRight + topHookExt) include : dispiro widths.lhs @@ -186,10 +187,10 @@ glyph-block Letter-Latin-Lower-F : begin create-glyph 'mathbb/f' 0x1D557 : glyph-proc include : MarkSet.b local barLeft : [mix SB RightSB 0.35] - [HSwToV : 0.25 * BBD] - include : StdFShapeT dispiro 0 barLeft BBS + include : StdFShapeT dispiro [DivFrame 1] 0 barLeft BBS include : intersection VBar.l (barLeft + BBD) 0 Ascender BBS - StdFShapeT spiro-outline 1 barLeft BBS + StdFShapeT spiro-outline [DivFrame 1] 1 barLeft BBS include : difference HCrossBar.top SB [mix SB RightSB 0.95] fbar BBS Rect Ascender 0 barLeft (barLeft + BBD) diff --git a/font-src/glyphs/letter/latin/lower-h.ptl b/font-src/glyphs/letter/latin/lower-h.ptl index abcdee55b..06897e129 100644 --- a/font-src/glyphs/letter/latin/lower-h.ptl +++ b/font-src/glyphs/letter/latin/lower-h.ptl @@ -11,6 +11,7 @@ glyph-block Letter-Latin-Lower-H : begin glyph-block-import Mark-Shared-Metrics : markExtend glyph-block-import Mark-Above : aboveMarkMid glyph-block-import Mark-Below : belowMarkMid + glyph-block-import Mark-Adjustment : LeaningAnchor glyph-block-import Letter-Shared-Shapes : RightwardTailedBar nShoulder nShoulderMask CyrDescender glyph-block-import Letter-Shared-Shapes : TopHook PalatalHook EngHook RetroflexHook @@ -57,7 +58,7 @@ glyph-block Letter-Latin-Lower-H : begin foreach { suffix { fTailed {fHasTopSerif Serifs} } } [Object.entries HConfig] : do create-glyph "h.\(suffix)" : glyph-proc include : MarkSet.b - set-base-anchor 'leaningAbove' (SB + [HSwToV HalfStroke]) Ascender + include : LeaningAnchor.Above.VBar.l SB include : VBar.l SB 0 Ascender include : nShoulder left -- (SB + [HSwToV Stroke]) @@ -146,7 +147,7 @@ glyph-block Letter-Latin-Lower-H : begin local { base mark } srcs include [refer-glyph base] AS_BASE ALSO_METRICS include : with-transform [ApparentTranslate [HSwToV HalfStroke] (XH - Ascender)] [refer-glyph mark] - set-base-anchor 'leaningAbove' (Middle + [HSwToV HalfStroke]) Ascender + include : LeaningAnchor.Above.VBar.l Middle derive-glyphs 'hCedilla' 0x1E29 'h' : lambda [src gr] : glyph-proc local shift : Width + SB - Middle + [HSwToV HalfStroke] diff --git a/font-src/glyphs/letter/latin/lower-p.ptl b/font-src/glyphs/letter/latin/lower-p.ptl index 01557bc0c..695230f06 100644 --- a/font-src/glyphs/letter/latin/lower-p.ptl +++ b/font-src/glyphs/letter/latin/lower-p.ptl @@ -8,7 +8,7 @@ glyph-module glyph-block Letter-Latin-Lower-P : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives - glyph-block-import Mark-Adjustment : ExtendAboveBaseAnchors + glyph-block-import Mark-Adjustment : ExtendAboveBaseAnchors LeaningAnchor glyph-block-import Letter-Shared : CreateAccentedComposition glyph-block-import Letter-Shared-Shapes : OBarLeft DToothlessRise DMBlend glyph-block-import Letter-Shared-Shapes : TopHook PalatalHook SerifFrame @@ -49,9 +49,9 @@ glyph-block Letter-Latin-Lower-P : begin include : MarkSet.p include : Body XH include : Serifs XH + include : LeaningAnchor.Below.VBar.l SB set-base-anchor 'overlayOnExtension' (SB + [HSwToV : 0.5 * Stroke]) yOverlay set-base-anchor 'strike' Middle (XH / 2) - set-base-anchor 'leaningBelow' (SB + [HSwToV HalfStroke]) Descender create-glyph "thorn.\(suffix)" : glyph-proc include : MarkSet.bp diff --git a/font-src/glyphs/letter/latin/lower-q.ptl b/font-src/glyphs/letter/latin/lower-q.ptl index e7dc42578..a86045b34 100644 --- a/font-src/glyphs/letter/latin/lower-q.ptl +++ b/font-src/glyphs/letter/latin/lower-q.ptl @@ -9,6 +9,7 @@ glyph-block Letter-Latin-Lower-Q : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives glyph-block-import Mark-Shared-Metrics : markHalfStroke + glyph-block-import Mark-Adjustment : LeaningAnchor glyph-block-import Letter-Shared-Shapes : OBarLeft OBarRight RightwardTailedBar DToothlessRise glyph-block-import Letter-Shared-Shapes : DMBlend DiagonalTailR DiagonalTailStdDepth glyph-block-import Letter-Shared-Shapes : TopHook RetroflexHook @@ -77,7 +78,7 @@ glyph-block Letter-Latin-Lower-Q : begin include : Body terminal XH Descender if sRT : include : sRT XH if sRB : include : sRB Descender - set-base-anchor 'leaningBelow' (RightSB - [HSwToV HalfStroke]) Descender + include : LeaningAnchor.Below.VBar.r RightSB create-glyph "QRTail.\(suffix)" : glyph-proc include : MarkSet.capDesc diff --git a/font-src/glyphs/letter/latin/lower-r.ptl b/font-src/glyphs/letter/latin/lower-r.ptl index f0daf9aae..402e8466c 100644 --- a/font-src/glyphs/letter/latin/lower-r.ptl +++ b/font-src/glyphs/letter/latin/lower-r.ptl @@ -8,6 +8,7 @@ glyph-module glyph-block Letter-Latin-Lower-R : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives + glyph-block-import Mark-Adjustment : LeaningAnchor glyph-block-import Letter-Shared : CreateAccentedComposition glyph-block-import Letter-Shared-Shapes : DToothlessRise DMBlend PalatalHook RetroflexHook glyph-block-import Letter-Blackboard : BBS BBD BBBarRight @@ -73,11 +74,15 @@ glyph-block Letter-Latin-Lower-R : begin [Just rNarrow] : xArchMiddle + 0.1 __ rHookX local [setMarks doTopSerif top bottom] : glyph-proc - set-base-anchor 'above' [mix [mix df.leftSB (xBar - [HSwToV Stroke]) : if doTopSerif 0.5 1] df.rightSB 0.5] top - set-base-anchor 'leaningBelow' (xBar - [HSwToV HalfStroke]) bottom + include : LeaningAnchor.Below.VBar.r xBar + include : LeaningAnchor.Above.Hook + mix df.leftSB (xBar - [HSwToV Stroke]) : if doTopSerif 0.5 1 + begin df.rightSB set-base-anchor 'overlay' (xBar - Stroke * 0.25) [mix bottom top 0.5] set-base-anchor 'palatalHookAttach' xBar bottom set-base-anchor 'palatalHookPos' (xBar + [PalatalHook.adviceGap Stroke]) bottom + currentGlyph.copyBaseAnchorIfAbsent 'leaningAbove' 'above' + currentGlyph.copyBaseAnchorIfAbsent 'leaningBelow' 'below' return : object xBar rBottomSerif rTopSerif fine xArchMiddle skew rHookX rHookXN rHookY hookSuperness setMarks @@ -185,7 +190,6 @@ glyph-block Letter-Latin-Lower-R : begin include : setMarks doTS XH 0 include : F df mode doTS doBS - currentGlyph.copyBaseAnchorIfAbsent 'leaningBelow' 'below' create-glyph "rLongLeg.\(suffix)" : glyph-proc set-width df.width diff --git a/font-src/glyphs/letter/latin/lower-t.ptl b/font-src/glyphs/letter/latin/lower-t.ptl index 59348cf24..fb32ededd 100644 --- a/font-src/glyphs/letter/latin/lower-t.ptl +++ b/font-src/glyphs/letter/latin/lower-t.ptl @@ -8,6 +8,7 @@ glyph-module glyph-block Letter-Latin-Lower-T : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives + glyph-block-import Mark-Adjustment : LeaningAnchor glyph-block-import Letter-Shared : CreateAccentedComposition CreateCommaCaronComposition glyph-block-import Letter-Shared-Shapes : CurlyTail FlatHookDepth ConnectedCedilla SerifedArcEnd glyph-block-import Letter-Shared-Shapes : DiagonalTailR DiagonalTailStdDepth DToothlessRise @@ -69,9 +70,10 @@ glyph-block Letter-Latin-Lower-T : begin local gEnd g.knots.(g.knots.length - 1) local xLeft : BarLeftPos df sym - set-base-anchor 'leaningAbove' (xLeft + [HSwToV HalfStroke]) top + + include : LeaningAnchor.Above.VBar.l xLeft + include : LeaningAnchor.Below.Hook xLeft gEnd.x set-base-anchor 'hooktopAttach' (xLeft + [HSwToV HalfStroke]) top - set-base-anchor 'leaningBelow' [mix xLeft gEnd.x 0.375] bot set-base-anchor 'bottomRight' gEnd.x gEnd.y set-base-anchor 'overlay' (g.knots.0.x + [HSwToV : 0.625 * Stroke]) (XH * 0.58) @@ -96,8 +98,8 @@ glyph-block Letter-Latin-Lower-T : begin local gEnd g.rhsKnots.(g.rhsKnots.length - 1) - set-base-anchor 'leaningAbove' ([BarLeftPos df sym] + [HSwToV HalfStroke]) top - set-base-anchor 'leaningBelow' ([BarLeftPos df sym] + [HSwToV Stroke]) bot + include : LeaningAnchor.Above.VBar.l [BarLeftPos df sym] + include : LeaningAnchor.Below.VBar.l [BarLeftPos df sym] (2 * Stroke) set-base-anchor 'hooktopAttach' ([BarLeftPos df sym] + [HSwToV HalfStroke]) top set-base-anchor 'bottomRight' gEnd.x gEnd.y set-base-anchor 'overlay' (g.knots.0.x + [HSwToV : 0.125 * Stroke]) (XH * 0.58) @@ -148,8 +150,8 @@ glyph-block Letter-Latin-Lower-T : begin flat xBarLeft [if (shape === RETROFLEX) (bot + Hook + HalfStroke) hd.y] curl xBarLeft top [heading Upward] - set-base-anchor 'leaningAbove' (xBarLeft + [HSwToV HalfStroke]) top - set-base-anchor 'leaningBelow' [mix xBarLeft xCrossRight 0.375] bot + include : LeaningAnchor.Above.VBar.l xBarLeft + include : LeaningAnchor.Below.Hook xBarLeft xCrossRight set-base-anchor 'hooktopAttach' (xBarLeft + [HSwToV HalfStroke]) top set-base-anchor 'topRight' xCrossRight Ascender set-base-anchor 'overlay' (xBarLeft + [HSwToV : 0.625 * Stroke]) (XH * 0.58) @@ -171,10 +173,11 @@ glyph-block Letter-Latin-Lower-T : begin local xEnd : xLeft + [HSwToV : 1.75 * Stroke] include : VBar.l xLeft 0 top include : HCrossBar.top xcl xcr yCrossBar + + include : LeaningAnchor.Above.VBar.l xLeft + include : LeaningAnchor.Below.VBar.l xLeft set-base-anchor 'overlay' (xLeft + [HSwToV HalfStroke]) (XH * 0.58) set-base-anchor 'hooktopAttach' (xLeft + [HSwToV HalfStroke]) top - set-base-anchor 'leaningAbove' (xLeft + [HSwToV HalfStroke]) top - set-base-anchor 'leaningBelow' (xLeft + [HSwToV HalfStroke]) bot set-base-anchor 'bottomRight' xEnd (bot + Stroke) set-base-anchor 'lTailHookAttach' xEnd (bot + Stroke) diff --git a/font-src/glyphs/letter/latin/upper-f.ptl b/font-src/glyphs/letter/latin/upper-f.ptl index 2bba5a806..37c25e685 100644 --- a/font-src/glyphs/letter/latin/upper-f.ptl +++ b/font-src/glyphs/letter/latin/upper-f.ptl @@ -8,6 +8,7 @@ glyph-module glyph-block Letter-Latin-Upper-F : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives + glyph-block-import Mark-Adjustment : LeaningAnchor glyph-block-import Letter-Shared-Shapes : LetterBarOverlay PalatalHook glyph-block-export xMidBarShrink @@ -27,7 +28,6 @@ glyph-block Letter-Latin-Upper-F : begin define xFBarRight : Width - SB * 1.5 define [FShape] : with-params [top pyBar serifLT serifLB serifV [stroke : AdviceStroke2 2 3 top]] : glyph-proc - set-base-anchor 'leaningBelow' (xFBarLeft + [HSwToV : 0.5 * stroke]) 0 include : VBar.l (xFBarLeft) 0 top stroke include : HBar.t (xFBarLeft - O) RightSB top stroke include : tagged 'crossBar' @@ -48,6 +48,7 @@ glyph-block Letter-Latin-Upper-F : begin foreach { suffix { lt lb v } } [Object.entries FConfig] : do create-glyph "F.\(suffix)" : glyph-proc include : MarkSet.capital + include : LeaningAnchor.Below.VBar.l xFBarLeft [AdviceStroke2 2 3 CAP] include : FShape CAP (serifLT -- lt) (serifLB -- lb) (serifV -- v) create-glyph "currency/frenchFrancSign.\(suffix)" : glyph-proc @@ -75,6 +76,7 @@ glyph-block Letter-Latin-Upper-F : begin create-glyph "smcpF.\(suffix)" : glyph-proc include : MarkSet.e + include : LeaningAnchor.Below.VBar.l xFBarLeft [AdviceStroke2 2 3 XH] include : FShape XH (serifLT -- lt) (serifLB -- lb) (serifV -- v) select-variant 'F' 'F' diff --git a/font-src/glyphs/letter/latin/upper-l.ptl b/font-src/glyphs/letter/latin/upper-l.ptl index 2253d430c..58dbc980b 100644 --- a/font-src/glyphs/letter/latin/upper-l.ptl +++ b/font-src/glyphs/letter/latin/upper-l.ptl @@ -10,13 +10,13 @@ glyph-block Letter-Latin-Upper-L : begin glyph-block-import Common-Derivatives glyph-block-import Mark-Shared-Metrics : markMiddle glyph-block-import Mark-Above : aboveMarkMid + glyph-block-import Mark-Adjustment : LeaningAnchor glyph-block-import Letter-Blackboard : BBS BBD glyph-block-import Letter-Shared-Shapes : BeltOverlay LetterBarOverlay define [LBarLeftX df] : df.leftSB * 1.5 define [LRightX df] : df.rightSB - 0.75 * OX define [LShape df top sgr swv] : glyph-proc - set-base-anchor 'leaningAbove' ([LBarLeftX df] + [HSwToV : 0.5 * swv]) top include : VBar.l [LBarLeftX df] 0 top swv include : HBar.b ([LBarLeftX df] - O) [LRightX df] 0 if (sgr > 1) : begin @@ -35,6 +35,7 @@ glyph-block Letter-Latin-Upper-L : begin create-glyph "L.\(suffix)" : glyph-proc set-width df.width include : df.markSet.capital + include : LeaningAnchor.Above.VBar.l [LBarLeftX df] include : LShape df CAP serifGrade Stroke set-base-anchor 'cvDecompose' [mix df.leftSB df.rightSB 0.65] + [HSwToV : 0.25 * Stroke] @@ -43,6 +44,7 @@ glyph-block Letter-Latin-Upper-L : begin create-glyph "smcpL.\(suffix)" : glyph-proc set-width df.width include : df.markSet.e + include : LeaningAnchor.Above.VBar.l [LBarLeftX df] include : LShape df XH serifGrade Stroke create-glyph "LLWelsh.\(suffix)" : glyph-proc diff --git a/font-src/glyphs/letter/latin/upper-p.ptl b/font-src/glyphs/letter/latin/upper-p.ptl index dea236428..6757408e3 100644 --- a/font-src/glyphs/letter/latin/upper-p.ptl +++ b/font-src/glyphs/letter/latin/upper-p.ptl @@ -8,6 +8,7 @@ glyph-module glyph-block Letter-Latin-Upper-P : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives + glyph-block-import Mark-Adjustment : LeaningAnchor glyph-block-import Letter-Shared : SetGrekUpperTonos glyph-block-import Letter-Shared-Metrics : BowlXDepth glyph-block-import Letter-Shared-Shapes : LetterBarOverlay LeftHook @@ -141,7 +142,7 @@ glyph-block Letter-Latin-Upper-P : begin create-glyph "P.\(suffix)" : glyph-proc include : MarkSet.capital - set-base-anchor 'leaningBelow' (SB * PShape.defaultMul + [HSwToV HalfStroke]) 0 + include : LeaningAnchor.Below.VBar.l (SB * PShape.defaultMul) include : difference PShape CAP (slab -- slabs) if fGap [PShape.OpenGap (top -- CAP) (bot -- [if fSlabBot Stroke 0])] [glyph-proc] @@ -152,7 +153,7 @@ glyph-block Letter-Latin-Upper-P : begin create-glyph "smcpP.\(suffix)" : glyph-proc include : MarkSet.e - set-base-anchor 'leaningBelow' (SB * PShape.defaultMul + [HSwToV HalfStroke]) 0 + include : LeaningAnchor.Below.VBar.l (SB * PShape.defaultMul) include : difference PShape XH (slab -- slabs) if fGap [PShape.OpenGap (top -- XH) (bot -- [if fSlabBot Stroke 0])] [glyph-proc] diff --git a/font-src/glyphs/marks/adjust.ptl b/font-src/glyphs/marks/adjust.ptl index 01164f5f9..43ed0b211 100644 --- a/font-src/glyphs/marks/adjust.ptl +++ b/font-src/glyphs/marks/adjust.ptl @@ -1,5 +1,8 @@ $$include '../../meta/macros.ptl' +import [mix fallback] from"../../support/utils.mjs" + + glyph-module glyph-block Mark-Adjustment : begin @@ -20,3 +23,26 @@ glyph-block Mark-Adjustment : begin if currentGlyph.baseAnchors.leaningAbove : begin local a : currentGlyph.gizmo.unapply currentGlyph.baseAnchors.leaningAbove if (a.y < y) : set-base-anchor 'leaningAbove' a.x y + + glyph-block-export LeaningAnchor + define LeaningAnchor : namespace + define [SetProcImpl mkCenter mkLeaning x] : glyph-proc + local existing currentGlyph.baseAnchors.(mkCenter) + if [not existing] : return nothing + local existingNT : currentGlyph.gizmo.unapply existing + currentGlyph.setBaseAnchor mkLeaning x existingNT.y + + define [Impl mkCenter mkLeaning] : namespace + export : define [At x] : SetProcImpl mkCenter mkLeaning x + + export : define VBar : namespace + export : define [m x] : At x + export : define [l x sw] : At (x + [HSwToV : 0.5 * [fallback sw Stroke]]) + export : define [r x sw] : At (x - [HSwToV : 0.5 * [fallback sw Stroke]]) + + export : define [Hook xOutsideBar xOutsideHook sw] : begin + local xAnchor : mix xOutsideBar xOutsideHook (7/16) + return : SetProcImpl mkCenter mkLeaning xAnchor + + export : define Above : Impl 'above' 'leaningAbove' + export : define Below : Impl 'below' 'leaningBelow'