From 6495d7d30d7c57a1096c89fa936ea062f9533f6c Mon Sep 17 00:00:00 2001 From: be5invis Date: Mon, 23 Oct 2023 17:42:35 -0700 Subject: [PATCH] Fix overlapping serifs of italic Yat (#2061). --- changes/27.3.2.md | 1 + font-src/glyphs/letter/cyrillic/nje.ptl | 7 ++--- font-src/glyphs/letter/cyrillic/yat.ptl | 3 ++- font-src/glyphs/letter/latin/lower-n.ptl | 34 +++++++++++++++++++----- params/variants.toml | 2 +- 5 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 changes/27.3.2.md diff --git a/changes/27.3.2.md b/changes/27.3.2.md new file mode 100644 index 000000000..7218ee731 --- /dev/null +++ b/changes/27.3.2.md @@ -0,0 +1 @@ +* Fix overlapping serifs of italic Yat (#2061). diff --git a/font-src/glyphs/letter/cyrillic/nje.ptl b/font-src/glyphs/letter/cyrillic/nje.ptl index 7aa3c581f..96db52cff 100644 --- a/font-src/glyphs/letter/cyrillic/nje.ptl +++ b/font-src/glyphs/letter/cyrillic/nje.ptl @@ -19,10 +19,11 @@ glyph-block Letter-Cyrillic-Nje : begin define SLAB-ALL 4 define [LeftHalf slabType df top] : glyph-proc - include : VBar.l df.leftSB 0 top df.mvs - include : HBar.m df.leftSB df.middle (top / 2) + local dfSub : df.slice 3 2 + include : VBar.l dfSub.leftSB 0 top dfSub.mvs + include : HBar.m dfSub.leftSB dfSub.rightSB (top / 2) - local sf : [SerifFrame.fromDf df top 0].slice 0 1 + local sf : SerifFrame.fromDf dfSub top 0 include : match slabType [Just SLAB-NONE] : glyph-proc [Just SLAB-TOP-LEFT] : begin sf.lt.outer diff --git a/font-src/glyphs/letter/cyrillic/yat.ptl b/font-src/glyphs/letter/cyrillic/yat.ptl index 986c0516c..5deb54405 100644 --- a/font-src/glyphs/letter/cyrillic/yat.ptl +++ b/font-src/glyphs/letter/cyrillic/yat.ptl @@ -101,12 +101,13 @@ glyph-block Letter-Cyrillic-Yat : begin local df : include : DivFrame para.diversityM 3 include : df.markSet.e - local xMidBarLeft : df.middle - [HSwToV : 0.5 * df.mvs] + local xMidBarLeft : df.middle - [HSwToV : 0.5 * df.mvs] include : Yeri XH xMidBarLeft df.rightSB stroke -- df.mvs yStart -- (XH - SmallArchDepthB) eject-contour 'serifYeriLT' + eject-contour 'serifYeriLB' select-variant 'cyrl/Yat' 0x462 (follow -- 'cyrl/YeriBar') select-variant 'cyrl/yat.upright' (follow -- 'cyrl/yeriBar') diff --git a/font-src/glyphs/letter/latin/lower-n.ptl b/font-src/glyphs/letter/latin/lower-n.ptl index 4a910788a..151b94f2e 100644 --- a/font-src/glyphs/letter/latin/lower-n.ptl +++ b/font-src/glyphs/letter/latin/lower-n.ptl @@ -19,9 +19,18 @@ glyph-block Letter-Latin-Lower-N : begin if trAnchor : set-base-anchor 'trailing' (trAnchor.x + SideJut) trAnchor.y define [NHTB df top] : VBar.l df.leftSB 0 top - define [NTopLeftSerif df top] : begin [local sf : SerifFrame.fromDf df top 0] sf.lt.outer - define [NBottomLeftSerif df y] : begin [local sf : SerifFrame.fromDf df Ascender y] sf.lb.full - define [NBottomLeftOuterSerif df y] : begin [local sf : SerifFrame.fromDf df Ascender y] sf.lb.outer + define [NTopLeftSerif df top] : begin + local sf : SerifFrame.fromDf df top 0 + return sf.lt.outer + define [NBottomLeftSerif df y] : begin + local sf : SerifFrame.fromDf df Ascender y + return sf.lb.full + define [NBottomLeftOuterSerif df y] : begin + local sf : SerifFrame.fromDf df Ascender y + return sf.lb.outer + define [NBottomLeftYatSerif df y] : begin + local sf : SerifFrame.fromDf df Ascender y + return : if sf.enoughSpaceForFullSerifs sf.lb.full sf.lb.outer define [NBottomRightSerifUpright df y] : glyph-proc local sf : SerifFrame.fromDf df Ascender y @@ -31,6 +40,9 @@ glyph-block Letter-Latin-Lower-N : begin local sf : SerifFrame.fromDf df Ascender y include sf.rb.outer include : AdjustTrailingAnchor + define [NBottomRightYatSerif df y] : begin + local sf : SerifFrame.fromDf df Ascender y + return : if sf.enoughSpaceForFullSerifs sf.rb.full [no-shape] define [EaredBody top left right yBR sw] : glyph-proc include : VBar.l left 0 top sw @@ -94,6 +106,13 @@ glyph-block Letter-Latin-Lower-N : begin __ NTopLeftSerif begin NBottomLeftSerif if (tail != 'tailed') NBottomRightSerifUpright + serifedItalicYat : list + match body + ([Just "earlessCorner"] || [Just "earlessRounded"]) nothing + ([Just "earlessCornerHTB"] || [Just "earlessRoundedHTB"]) NHTB + __ NTopLeftSerif + begin NBottomLeftYatSerif + begin NBottomRightYatSerif foreach { suffix { Body tailed {sLT sLB sRB} } } [Object.entries NConfig] : do create-glyph "n.\(suffix)" : glyph-proc @@ -219,11 +238,12 @@ glyph-block Letter-Latin-Lower-N : begin local df : include : DivFrame para.diversityM 3 include : df.markSet.e - local xMidBarRight : df.middle + [HSwToV : 0.5 * df.mvs] - include : Body XH df.leftSB xMidBarRight (XH - SmallArchDepthB - 0.1) df.mvs + local dfSub : df.slice 3 2 + include : Body XH dfSub.leftSB dfSub.rightSB (XH - SmallArchDepthB - 0.1) dfSub.mvs - if sLT : include : sLT df XH - if sLB : include : sLB df 0 + if sLT : include : sLT dfSub XH + if sLB : include : sLB dfSub 0 + if sRB : include : sRB dfSub 0 select-variant 'n' 'n' link-reduced-variant 'n/sansSerif' 'n' MathSansSerif diff --git a/params/variants.toml b/params/variants.toml index 260ad4cdf..d6be9734c 100644 --- a/params/variants.toml +++ b/params/variants.toml @@ -3051,7 +3051,7 @@ selectorAffix."grek/eta" = { if = [{ body = "normal" }], then = "topLeftSerifed" selectorAffix."grek/eta/sansSerif" = "serifless" selectorAffix."cyrl/pe.italic" = "serifed" selectorAffix."cyrl/peItalicDescBase" = "serifed" -selectorAffix."cyrl/yat.italic/base" = "serifed" +selectorAffix."cyrl/yat.italic/base" = "serifedItalicYat"