diff --git a/font-src/glyphs/auto-build/composite.ptl b/font-src/glyphs/auto-build/composite.ptl index b9dd50449..650f114a9 100644 --- a/font-src/glyphs/auto-build/composite.ptl +++ b/font-src/glyphs/auto-build/composite.ptl @@ -35,30 +35,13 @@ glyph-block Autobuild-Enclosure-Shared : begin return name glyph-block-export EnsureComponentGlyphT - define [EnsureComponentGlyphT gidPart fnBuildup] : begin + define [EnsureComponentGlyphT gnPart fnBuildup] : begin local rs : new Set - local linksGnMap : new Map - - # Build the original - local gniPart : fnBuildup gidPart - linksGnMap.set gidPart gniPart - - # Build the related, using a mesh query to find out all variants - local mesh : getGrMesh { gidPart } AnyCv query-glyph - foreach { gr { from } { relatedGidPart } } [items-of mesh] : begin - local gniRelated : fnBuildup relatedGidPart - linksGnMap.set relatedGidPart gniRelated - - # Link relations - foreach { gr { from } { to } } [items-of mesh] : begin - local gniFrom : linksGnMap.get from - local gniTo : linksGnMap.get to - if (gniFrom && gniTo && [query-glyph gniFrom] && [query-glyph gniTo]) : begin - gr.set [query-glyph gniFrom] gniTo + return : DeriveMeshT { gnPart } AnyCv + function [gns gr] : fnBuildup gns.0 + function [gniFrom gniTo] : begin [query-glyph gniFrom].tryBecomeMirrorOf [query-glyph gniTo] rs - return gniPart - glyph-block-export getGlyphDefaultShift define [getGlyphDefaultShift bal baly g] : begin if (g && g.baseAnchors.above && g.baseAnchors.below) : begin diff --git a/font-src/glyphs/common/derivatives.ptl b/font-src/glyphs/common/derivatives.ptl index 83d0a9f6a..ad819c271 100644 --- a/font-src/glyphs/common/derivatives.ptl +++ b/font-src/glyphs/common/derivatives.ptl @@ -59,7 +59,7 @@ glyph-block Common-Derivatives : begin this.includeGlyph goal copyAnchors copyWidth glyph-block-export DeriveMeshT - define [DeriveMeshT gnSources Query Fn] : begin + define [DeriveMeshT gnSources Query Fn FnLink] : begin local linksGnMap : new Map # Build principal @@ -81,6 +81,7 @@ glyph-block Common-Derivatives : begin local gndTo : linksGnMap.get [keyOfGnList to] if (gndFrom && gndTo && [query-glyph gndFrom] && [query-glyph gndTo]) : begin gr.set [query-glyph gndFrom] gndTo + if FnLink : FnLink gndFrom gndTo from to return gndSource define [keyOfGnList gns] ".deriveKey{\[gns.join '}{']}" diff --git a/font-src/glyphs/letter/latin/lower-y.ptl b/font-src/glyphs/letter/latin/lower-y.ptl index 725ce28cb..de52f0b13 100644 --- a/font-src/glyphs/letter/latin/lower-y.ptl +++ b/font-src/glyphs/letter/latin/lower-y.ptl @@ -8,6 +8,7 @@ glyph-module glyph-block Letter-Latin-Lower-Y : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives + glyph-block-import Letter-Shared : CreateAccentedComposition glyph-block-import Mark-Below : belowMarkStack glyph-block-import Letter-Shared-Shapes : nShoulder FlatHookDepth SerifFrame @@ -287,11 +288,11 @@ glyph-block Letter-Latin-Lower-Y : begin link-reduced-variant 'y/sansSerif' 'y' MathSansSerif alias 'cyrl/u' 0x443 'y' - create-glyph 'yDotBelowDot1' : glyph-proc + WithDotVariants 'yDotBelowDot1' null : function [DrawAt kdr] : glyph-proc set-mark-anchor 'yBelowDot' 0 0 0 belowMarkStack - include : DotAt 0 (-AccentStackOffset) DotRadius + include : DrawAt 0 (-AccentStackOffset) (DotRadius * kdr) - derive-composites 'yDotBelow' 0x1EF5 'y' 'yDotBelowDot1' + CreateAccentedComposition 'yDotBelow' 0x1EF5 'y' 'yDotBelowDot1' create-glyph : glyph-proc include : MarkSet.p diff --git a/font-src/glyphs/marks/composite.ptl b/font-src/glyphs/marks/composite.ptl index 8810be787..fec3c7c52 100644 --- a/font-src/glyphs/marks/composite.ptl +++ b/font-src/glyphs/marks/composite.ptl @@ -49,9 +49,9 @@ glyph-block Mark-Composite : begin local yc : aboveMarkTop - commaAboveRadius + DotRadius * 0.3 + commaOvershoot - create-glyph 'psiliPerispomeni' : glyph-proc + derive-glyphs 'psiliPerispomeni' null 'commaAbove' : function [src gr] : glyph-proc set-width 0 - include : refer-glyph "commaAbove" + include : refer-glyph src local radius : Math.max (markExtend - commaAboveRadius) (commaAboveRadius * 1.25) include : dispiro widths.lhs : Math.min (markHalfStroke * 2) ([AdviceStroke 6.5] * 1.25) @@ -62,19 +62,19 @@ glyph-block Mark-Composite : begin g4.down.end (markMiddle + radius) yc [heading Downward] set-mark-anchor 'above' markMiddle XH markMiddle (aboveMarkStack + markHalfStroke * 2) - create-glyph 'psiliPerispomeniGrekUpperTonos' : glyph-proc + derive-glyphs 'psiliPerispomeniGrekUpperTonos' null 'psiliPerispomeni' : function [src gr] : glyph-proc set-width 0 - include : refer-glyph 'psiliPerispomeni' + include : refer-glyph src set-mark-anchor 'grekUpperTonos' markMiddle XH - create-glyph 'spaced_psiliPerispomeni' 0x1FCF : glyph-proc + derive-glyphs 'spaced_psiliPerispomeni' 0x1FCF 'psiliPerispomeni' : function [src gr] : glyph-proc include [refer-glyph 'markBaseSpace'] AS_BASE set-width [query-glyph 'markBaseSpace'].advanceWidth - include : refer-glyph "psiliPerispomeni" + include : refer-glyph src - create-glyph 'dasiaPerispomeni' : glyph-proc + derive-glyphs 'dasiaPerispomeni' null 'revCommaAbove' : function [src gr] : glyph-proc set-width 0 - include : refer-glyph "revCommaAbove" + include : refer-glyph src local radius : Math.max (markExtend - commaAboveRadius) (commaAboveRadius * 1.25) include : dispiro widths.lhs : Math.min (markHalfStroke * 2) ([AdviceStroke 6.5] * 1.25) @@ -85,14 +85,20 @@ glyph-block Mark-Composite : begin g4.down.end (markMiddle + radius) yc [heading Downward] set-mark-anchor 'above' markMiddle XH markMiddle (aboveMarkStack + markHalfStroke * 2) - create-glyph 'dasiaPerispomeniGrekUpperTonos' : glyph-proc + derive-glyphs 'dasiaPerispomeniGrekUpperTonos' null 'dasiaPerispomeni' : function [src gr] : glyph-proc set-width 0 - include : refer-glyph 'dasiaPerispomeni' + include : refer-glyph src set-mark-anchor 'grekUpperTonos' markMiddle XH - create-glyph 'cyrlPsiliPokrytieAbove' : glyph-proc + derive-glyphs 'spaced_dasiaPerispomeni' 0x1FDF 'dasiaPerispomeni' : function [src gr] : glyph-proc + include [refer-glyph 'markBaseSpace'] AS_BASE + set-width [query-glyph 'markBaseSpace'].advanceWidth + include : refer-glyph src + set-mark-anchor 'grekUpperTonos' markMiddle XH + + derive-glyphs 'cyrlPsiliPokrytieAbove' null 'commaAbove' : function [src gr] : glyph-proc set-width 0 - include : refer-glyph "commaAbove" + include : refer-glyph src local radius : Math.max (markExtend - commaAboveRadius) (commaAboveRadius * 1.25) local sw : Math.min (markHalfStroke * 2) ([AdviceStroke 6.5] * 1.25) include : dispiro @@ -103,8 +109,3 @@ glyph-block Mark-Composite : begin alsoThru.g2 0.5 0.5 g2.right.end (markMiddle + [Math.max radius (markExtend * 2)]) yc [heading Rightward] set-mark-anchor 'above' markMiddle XH markMiddle (aboveMarkStack + markHalfStroke * 2) - - create-glyph 'spaced_dasiaPerispomeni' 0x1FDF : glyph-proc - include [refer-glyph 'markBaseSpace'] AS_BASE - set-width [query-glyph 'markBaseSpace'].advanceWidth - include : refer-glyph "dasiaPerispomeni" \ No newline at end of file