diff --git a/changes/4.6.0.md b/changes/4.6.0.md index a8ab51b75..76edc6b53 100644 --- a/changes/4.6.0.md +++ b/changes/4.6.0.md @@ -2,4 +2,5 @@ * Add diagonal-tailed variant of `f`, `i`, `j`, `k`, `l`, `q` and `t` (#795). * Fix broken geometry of `K` and `%` under ultra-wide (#800). * 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 + * Refine the shape of Slab `S` and `s` to add serifs at both terminals (#800). + * Fix broken shape of tailed Cyrillic DJE (`U+0452`, #803). \ No newline at end of file diff --git a/font-src/glyphs/common/derivatives.ptl b/font-src/glyphs/common/derivatives.ptl index cfcd95b89..556c6b577 100644 --- a/font-src/glyphs/common/derivatives.ptl +++ b/font-src/glyphs/common/derivatives.ptl @@ -54,10 +54,16 @@ glyph-block Common-Derivatives : begin local glyphDst : create-glyph dstGid dstUnicode : glyph-proc include : Fn sourceGid null + local derivedGlyphIdMap : new Map if glyphDst : foreach [gr : items-of : AnyDerivingCv.query glyphSrc] : begin - gr.set glyphDst [gr.amendName dstGid] - create-glyph [gr.amendName dstGid] : glyph-proc - include : Fn [gr.get glyphSrc] gr.tag + local relGidSrc : gr.get glyphSrc + if [derivedGlyphIdMap.get relGidSrc] + : then : gr.set glyphDst : derivedGlyphIdMap.get relGidSrc + : else : begin + local relGidDst : gr.amendName dstGid + create-glyph relGidDst : glyph-proc : include : Fn [gr.get glyphSrc] gr.tag + gr.set glyphDst relGidDst + derivedGlyphIdMap.set relGidSrc relGidDst define [alias dstGid dstUnicode sourceGid] : begin if [not dstGid] : throw : new Error "Target ID not specified" diff --git a/font-src/glyphs/letter/cyrillic/dje.ptl b/font-src/glyphs/letter/cyrillic/dje.ptl index 4c188b397..35dd1be25 100644 --- a/font-src/glyphs/letter/cyrillic/dje.ptl +++ b/font-src/glyphs/letter/cyrillic/dje.ptl @@ -10,6 +10,7 @@ glyph-block Letter-Cyrillic-Dje : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives glyph-block-import Letter-Shared-Shapes : nShoulder + glyph-block-import Letter-Latin-Lower-H : HBarOverlay create-glyph 'cyrl/Dje' 0x402 : glyph-proc include : MarkSet.capital @@ -34,8 +35,6 @@ glyph-block Letter-Cyrillic-Dje : begin if SLAB : begin include : LeftwardBottomSerif left 0 SideJut - create-glyph 'cyrl/dje' 0x452 : glyph-proc - include : MarkSet.if - include : refer-glyph 'cyrl/tshe' - eject-contour 'serifRB' - include : VerticalHook (RightSB - HalfStroke * HVContrast) 0 (-Hook * 1.2) Hook + with-related-glyphs 'cyrl/dje' 0x452 'heng' : lambda [src sel] : glyph-proc + include [refer-glyph src] AS_BASE + include : HBarOverlay diff --git a/font-src/glyphs/letter/latin/lower-h.ptl b/font-src/glyphs/letter/latin/lower-h.ptl index 961085993..fce9808a1 100644 --- a/font-src/glyphs/letter/latin/lower-h.ptl +++ b/font-src/glyphs/letter/latin/lower-h.ptl @@ -96,12 +96,19 @@ glyph-block Letter-Latin-Lower-H : begin eject-contour 'serifRB' include : VerticalHook (RightSB - HalfStroke * HVContrast) 0 (-HookX) Hook - create-glyph 'heng' 0xA727 : glyph-proc + create-glyph 'heng.straight' : glyph-proc include : MarkSet.if include : refer-glyph "h.straight" eject-contour 'serifRB' include : VerticalHook (RightSB - HalfStroke * HVContrast) 0 (-HookX) Hook + create-glyph 'heng.motionSerifedStraight' : glyph-proc + include : MarkSet.if + include : refer-glyph "h.motionSerifedStraight" + eject-contour 'serifRB' + include : VerticalHook (RightSB - HalfStroke * HVContrast) 0 (-HookX) Hook + + select-variant 'heng' 0xA727 turned 'turnh' 0x265 'h.straight' Middle (XH / 2) [MarkSet.p] create-glyph 'hookturnh' 0x2AE : glyph-proc @@ -142,8 +149,8 @@ glyph-block Letter-Latin-Lower-H : begin if SLAB : begin include : LeftwardTopSerif (RightSB - Stroke * HVContrast) XH SideJut - with-related-glyphs 'hbar' 0x127 'h' : lambda [src sel] : glyph-proc - include [refer-glyph src] AS_BASE + glyph-block-export HBarOverlay + define [HBarOverlay] : glyph-proc local barSpaceTop : CAP - [if SLAB Stroke 0] local s : Math.min OverlayStroke (0.625 * (barSpaceTop - XH)) local xOverlayStart : mix SB 0 0.7 @@ -158,6 +165,10 @@ glyph-block Letter-Latin-Lower-H : begin corner (SB + HalfStroke * HVContrast) yOverlay corner xOverlayEnd yOverlay + with-related-glyphs 'hbar' 0x127 'h' : lambda [src sel] : glyph-proc + include [refer-glyph src] AS_BASE + include : HBarOverlay + alias 'cyrl/tshe' 0x45B 'hbar' glyph-block-import Letter-Blackboard : BBS BBD BBBarLeft diff --git a/params/variants.toml b/params/variants.toml index a8a2a81ce..4018d8a65 100644 --- a/params/variants.toml +++ b/params/variants.toml @@ -632,24 +632,28 @@ rank = 1 description = '`h` with straight ending' selector.h = 'straight' selector.hhooktop = 'straight' +selector.heng = 'straight' [prime.h.variants.tailed] rank = 2 description = '`h` with curly tailed ending' selector.h = 'tailed' selector.hhooktop = 'tailed' +selector.heng = 'straight' [prime.h.variants.motion-serifed-straight] rank = 3 description = '`h` with straight ending' selector.h = 'motionSerifedStraight' selector.hhooktop = 'straight' +selector.heng = 'motionSerifedStraight' [prime.h.variants.motion-serifed-tailed] rank = 4 description = '`h` with curly tailed ending' selector.h = 'motionSerifedTailed' selector.hhooktop = 'tailed' +selector.heng = 'motionSerifedStraight'