From 6f056eccdead95f0cb51fcae62a6294d9a230421 Mon Sep 17 00:00:00 2001 From: Logo <21302803+Logo121@users.noreply.github.com> Date: Fri, 29 Sep 2023 04:46:20 +0800 Subject: [PATCH] Flat 5 (or whatever that is called) (#2010) * flat 5 * SS Matching as mentioned in issue --- changes/27.1.0.md | 4 + font-src/glyphs/letter/cyrillic/zhe.ptl | 6 +- .../glyphs/letter/latin-ext/lower-ae-oe.ptl | 12 +-- font-src/glyphs/letter/latin/lower-g.ptl | 15 +-- font-src/glyphs/letter/latin/lower-n.ptl | 2 +- font-src/glyphs/letter/latin/o.ptl | 2 +- font-src/glyphs/letter/latin/upper-h.ptl | 4 +- font-src/glyphs/number/5.ptl | 101 ++++++++++-------- params/variants.toml | 50 ++++++--- 9 files changed, 120 insertions(+), 76 deletions(-) diff --git a/changes/27.1.0.md b/changes/27.1.0.md index 9e2aeb87f..db698021a 100644 --- a/changes/27.1.0.md +++ b/changes/27.1.0.md @@ -1,5 +1,9 @@ +* \[**Breaking**\] Change of variant names: + - `five`.`vertical-upper-left-bar` → `five`.`upright-arched` + - `five`.`oblique-upper-left-bar` → `five`.`oblique-arched` * Add characters: - CYRILLIC CAPITAL LETTER DCHE (`U+052C`) (#1897). - CYRILLIC SMALL LETTER DCHE (`U+052D`) (#1897). * Add separate variant selector `VXAA` for Cyrillic Lower Er (`р`) (#2006). * Add separate variant selector `VXAB` for Cyrillic Lower U (`у`) (#2006). +* Add flat middle stroke variant for `5` (#1995). diff --git a/font-src/glyphs/letter/cyrillic/zhe.ptl b/font-src/glyphs/letter/cyrillic/zhe.ptl index 1bec05ecc..06f7e00e6 100644 --- a/font-src/glyphs/letter/cyrillic/zhe.ptl +++ b/font-src/glyphs/letter/cyrillic/zhe.ptl @@ -183,7 +183,7 @@ glyph-block Letter-Cyrillic-Zhe : begin foreach { suffix { legShape fSlab fMidSlab } } [Object.entries ZheConfig] : do create-glyph "cyrl/Zhe.\(suffix)" : glyph-proc - define df : include : DivFrame para.diversityM 3 + local df : include : DivFrame para.diversityM 3 include : df.markSet.capital include : Zhe.Shape legShape fSlab fMidSlab df 0 CAP CAP @@ -193,7 +193,7 @@ glyph-block Letter-Cyrillic-Zhe : begin include : Zhe.Descender fSlab df create-glyph "cyrl/zhe.\(suffix)" : glyph-proc - define df : include : DivFrame para.diversityM 3 + local df : include : DivFrame para.diversityM 3 include : df.markSet.e include : Zhe.Shape legShape fSlab fMidSlab df 0 XH XH @@ -203,7 +203,7 @@ glyph-block Letter-Cyrillic-Zhe : begin include : Zhe.Descender fSlab df create-glyph "cyrl/zhe.BGR.\(suffix)" : glyph-proc - define df : include : DivFrame para.diversityM 3 + local df : include : DivFrame para.diversityM 3 include : df.markSet.b include : Zhe.Shape legShape fSlab fMidSlab df 0 XH Ascender diff --git a/font-src/glyphs/letter/latin-ext/lower-ae-oe.ptl b/font-src/glyphs/letter/latin-ext/lower-ae-oe.ptl index da5366b34..b2e134320 100644 --- a/font-src/glyphs/letter/latin-ext/lower-ae-oe.ptl +++ b/font-src/glyphs/letter/latin-ext/lower-ae-oe.ptl @@ -31,7 +31,7 @@ glyph-block Letter-Latin-Lower-AE-OE : begin doubleStoreyToothlessRounded { DoubleStorey.ToothlessRounded } create-glyph "ae/a" : glyph-proc - define df : include : DivFrame para.diversityM 3 + local df : include : DivFrame para.diversityM 3 include : df.markSet.e set-base-anchor 'cvDecompose' 0 0 include : AAShape 0 df DoubleStorey.ToothlessRounded 0 @@ -39,7 +39,7 @@ glyph-block Letter-Latin-Lower-AE-OE : begin foreach { suffix { bodyR } } [Object.entries DoubleStoreyConfig] : do create-glyph "aa.\(suffix)" : glyph-proc - define df : include : DivFrame para.diversityM 3 + local df : include : DivFrame para.diversityM 3 include : df.markSet.e local [left] : AAShape 0 df DoubleStorey.ToothlessRounded @@ -68,24 +68,24 @@ glyph-block Letter-Latin-Lower-AE-OE : begin subDf.archDepthB ad create-glyph 'oe/o' : glyph-proc - define df : include : DivFrame para.diversityM 3 + local df : include : DivFrame para.diversityM 3 include : df.markSet.e set-base-anchor 'cvDecompose' 0 0 include : oeOPart 0 df XH SmallArchDepth create-glyph 'ao/o' : glyph-proc - define df : include : DivFrame para.diversityM 3 + local df : include : DivFrame para.diversityM 3 set-mark-anchor 'cvDecompose' 0 0 include : oeOPart 1 df XH SmallArchDepth create-glyph 'OO/left' : glyph-proc - define df : include : DivFrame para.diversityM 3 + local df : include : DivFrame para.diversityM 3 include : df.markSet.capital set-base-anchor 'cvDecompose' 0 0 include : oeOPart 0 df CAP ArchDepth create-glyph 'OO/right' : glyph-proc - define df : include : DivFrame para.diversityM 3 + local df : include : DivFrame para.diversityM 3 set-mark-anchor 'cvDecompose' 0 0 include : oeOPart 1 df CAP ArchDepth diff --git a/font-src/glyphs/letter/latin/lower-g.ptl b/font-src/glyphs/letter/latin/lower-g.ptl index 98c65fbd9..2b3af5ca5 100644 --- a/font-src/glyphs/letter/latin/lower-g.ptl +++ b/font-src/glyphs/letter/latin/lower-g.ptl @@ -169,28 +169,29 @@ glyph-block Letter-Latin-Lower-G : begin foreach { suffix { hookShape {bodyShape hookStart} } } [Object.entries SingleStoreyConfig] : do create-glyph "g.\(suffix)" : glyph-proc - include : MarkSet.p + local df : include : DivFrame 1 + include : df.markSet.p set-base-anchor 'overlay' Middle (XH / 2) set-base-anchor 'strike' Middle (XH / 2) - define df : DivFrame 1 include : bodyShape df XH include : hookShape df (XH - hookStart) create-glyph "GScript.\(suffix)" : glyph-proc - include : MarkSet.capDesc + local df : include : DivFrame 1 + include : df.markSet.capDesc set-base-anchor 'overlay' Middle (CAP / 2) - define df : DivFrame 1 include : bodyShape df CAP include : hookShape df (CAP - hookStart) create-glyph "gPalatalHook.\(suffix)" : glyph-proc - include : MarkSet.p + local df : include : DivFrame para.diversityM 1 + include : df.markSet.p set-base-anchor 'overlay' Middle (XH / 2) - define dfSub : DivFrame 0.75 2 + local dfSub : DivFrame (0.75 * para.diversityM) 2 include : bodyShape dfSub XH include : hookShape dfSub (XH - hookStart) include : PalatalHook.r - x -- RightSB + x -- df.rightSB y -- 0 xLink -- dfSub.rightSB refSw -- dfSub.mvs diff --git a/font-src/glyphs/letter/latin/lower-n.ptl b/font-src/glyphs/letter/latin/lower-n.ptl index 09216fcd7..16d4ec472 100644 --- a/font-src/glyphs/letter/latin/lower-n.ptl +++ b/font-src/glyphs/letter/latin/lower-n.ptl @@ -203,7 +203,7 @@ glyph-block Letter-Latin-Lower-N : begin if sLT : include : sLT [DivFrame 1] XH create-glyph "cyrl/peMidHook.italic.\(suffix)" : glyph-proc - define df : include : DivFrame para.diversityM 3 + local df : include : DivFrame para.diversityM 3 include : df.markSet.p local dfHalf : df.slice 3 2 diff --git a/font-src/glyphs/letter/latin/o.ptl b/font-src/glyphs/letter/latin/o.ptl index 86ada8adb..f5d2703cd 100644 --- a/font-src/glyphs/letter/latin/o.ptl +++ b/font-src/glyphs/letter/latin/o.ptl @@ -155,7 +155,7 @@ glyph-block Letter-Latin-O : begin include : VBar.m Middle (O + 1) (XH - O - 1) fine create-glyph 'romanThousandCD' 0x2180 : glyph-proc - define df : include : DivFrame para.diversityM 3 + local df : include : DivFrame para.diversityM 3 include : df.markSet.capital include : OShape CAP 0 df.leftSB df.rightSB df.mvs ArchDepthA ArchDepthB include : VBar.m df.middle (df.mvs / 2) (CAP - df.mvs / 2) df.mvs diff --git a/font-src/glyphs/letter/latin/upper-h.ptl b/font-src/glyphs/letter/latin/upper-h.ptl index 721f7f678..59ee59d82 100644 --- a/font-src/glyphs/letter/latin/upper-h.ptl +++ b/font-src/glyphs/letter/latin/upper-h.ptl @@ -155,12 +155,12 @@ glyph-block Letter-Latin-Upper-H : begin eject-contour 'serifLB' create-glyph "cyrl/EnGhe.\(suffix)" : glyph-proc - define df : include : DivFrame para.diversityM 3 + local df : include : DivFrame para.diversityM 3 include : df.markSet.capital include : EnGheShape Body df CAP slabType enGheVSlab create-glyph "cyrl/enghe.\(suffix)" : glyph-proc - define df : include : DivFrame para.diversityM 3 + local df : include : DivFrame para.diversityM 3 include : df.markSet.e include : EnGheShape Body df XH slabType enGheVSlab diff --git a/font-src/glyphs/number/5.ptl b/font-src/glyphs/number/5.ptl index c23c309c6..5d589c057 100644 --- a/font-src/glyphs/number/5.ptl +++ b/font-src/glyphs/number/5.ptl @@ -1,6 +1,6 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [mix linreg clamp fallback SuffixCfg] from"../../support/utils.mjs" import [AnyCv getGrMesh] from"../../support/gr.mjs" glyph-module @@ -10,33 +10,45 @@ glyph-block Digits-Five : begin glyph-block-import Common-Derivatives glyph-block-import Digits-Shared : OnumMarks ShiftDown CodeLnum CodeOnum - define [FiveShape] : with-params [top bp [sw Stroke] [bbd 0] [obl 0] [zt 0]] : glyph-proc + define [FiveFlatStroke top xleft t2 ycurly sw] : dispiro + widths.rhs sw + flat (xleft + [HSwToV sw]) t2 + curl Middle t2 + archv + g4 (RightSB - OX) ycurly + hookend O + g4 SB (Hook * top / CAP) + + define [FiveArcStroke top xleft t2 ycurly sw] : dispiro + widths.rhs sw + g4 xleft (t2 - AHook * top / CAP) + hookstart (t2 - O) + g4 (RightSB - OX) ycurly + hookend O + g4 SB (Hook * top / CAP) + + define [FiveArcStrokeMask top xleft t2 ycurly sw] : spiro-outline + g4 (xleft + 1) (t2 - AHook * top / CAP) + hookstart (t2 - O - 1) + g4 (RightSB - OX - 1) ycurly + hookend (O + 1) + g4 (SB + 1) (Hook * top / CAP) + + define [FiveShape] : with-params [ + top bp [sw Stroke] [bbd 0] [obl 0] [zt 0] + [bottomShape FiveArcStroke] [bottomMaskShape FiveArcStrokeMask] + ] : glyph-proc local t1 : top * bp * 0.8 local t2 : top * bp local ycurly : YSmoothMidR t2 0 ArchDepthA ArchDepthB local xleft : [mix SB RightSB 0.025] + zt local xright : [mix RightSB SB 0.05] - (OX - O) - local FiveStroke : dispiro - widths.rhs sw - g4 xleft (t2 - AHook * top / CAP) - hookstart (t2 - O) - g4 (RightSB - OX) ycurly - hookend O - g4 SB (Hook * top / CAP) - - local FiveStrokeMask : spiro-outline - g4 (xleft + 1) (t2 - AHook * top / CAP) - hookstart (t2 - O - 1) - g4 (RightSB - OX - 1) ycurly - hookend (O + 1) - g4 (SB + 1) (Hook * top / CAP) - local kGap : 0.144 - 0.1 * sw / t2 include : difference glyph-proc - local fiveStroke : include FiveStroke + local fiveStroke : include : bottomShape top xleft t2 ycurly sw local firstKnot fiveStroke.rhsKnots.0 local oblCor : Math.hypot 1 obl @@ -52,44 +64,47 @@ glyph-block Digits-Five : begin flat (xVBar + xVBarOffset) top [heading Upward] if bbd : begin - include : intersection FiveStrokeMask [VBar.r (RightSB - OX - bbd) 0 CAP sw] + local fiveStrokeMask : bottomMaskShape top xleft t2 ycurly sw + include : intersection fiveStrokeMask [VBar.r (RightSB - OX - bbd) 0 CAP sw] include : difference VBar.r (firstKnot.x + bbd) 0 CAP sw - begin FiveStrokeMask + begin fiveStrokeMask Rect (t2 / 2) 0 0 Width Rect (t2 / 2 + t2 * kGap) (t2 / 2 - t2 * kGap) 0 Middle - if (!bbd && SLAB) : include : VSerif.dr xright top VJut + if (!bbd && SLAB) : include : VSerif.dr xright top [Math.min VJut ((top - t2) * 0.8)] - create-glyph 'five.lnum.verticalUpperLeftBar' : glyph-proc - include : MarkSet.capital - include : FiveShape CAP DesignParameters.fiveBarPos + define FiveConfig : SuffixCfg.weave + object # upper-left-bar + "upright" 0 + "oblique" (1 / 12) + object # middle + "arched" FiveArcStroke + "flat" FiveFlatStroke - create-glyph 'five.onum.verticalUpperLeftBar' : glyph-proc - include : OnumMarks.p - include : FiveShape CAP DesignParameters.fiveBarPos - include : ShiftDown + foreach { suffix { obl bottomShape } } [pairs-of FiveConfig] : do + create-glyph "five.lnum.\(suffix)" : glyph-proc + include : MarkSet.capital + include : FiveShape CAP DesignParameters.fiveBarPos (bottomShape -- bottomShape) (obl -- obl) - create-glyph 'five.lnum.obliqueUpperLeftBar' : glyph-proc - include : MarkSet.capital - include : FiveShape CAP DesignParameters.fiveBarPos (obl -- (1 / 12)) + create-glyph "five.onum.\(suffix)" : glyph-proc + include : OnumMarks.p + include : FiveShape CAP DesignParameters.fiveBarPos (bottomShape -- bottomShape) (obl -- obl) + include : ShiftDown - create-glyph 'five.onum.obliqueUpperLeftBar' : glyph-proc - include : OnumMarks.p - include : FiveShape CAP DesignParameters.fiveBarPos (obl -- (1 / 12)) - include : ShiftDown + create-glyph "zhuangToneFive.\(suffix)" : glyph-proc + include : MarkSet.capital + include : FiveShape CAP DesignParameters.fiveBarPos (bottomShape -- bottomShape) (zt -- ((RightSB - SB) * 0.05)) + + create-glyph "zhuangtonefive.\(suffix)" : glyph-proc + include : MarkSet.e + include : FiveShape XH DesignParameters.fiveBarPos (bottomShape -- bottomShape) (zt -- ((RightSB - SB) * 0.05)) select-variant 'five.lnum' [CodeLnum '5'] (follow -- 'five') select-variant 'five.onum' [CodeOnum '5'] (follow -- 'five') - - create-glyph 'zhuangToneFive' 0x1BC : glyph-proc - include : MarkSet.capital - include : FiveShape CAP DesignParameters.fiveBarPos (zt -- ((RightSB - SB) * 0.05)) - - create-glyph 'zhuangtonefive' 0x1BD : glyph-proc - include : MarkSet.e - include : FiveShape XH DesignParameters.fiveBarPos (zt -- ((RightSB - SB) * 0.05)) + select-variant 'zhuangToneFive' 0x1BC + select-variant 'zhuangtonefive' 0x1BD (follow -- 'zhuangToneFive') glyph-block-import Letter-Blackboard : BBS BBD create-glyph 'mathbb/five' 0x1D7DD : glyph-proc diff --git a/params/variants.toml b/params/variants.toml index d12a6f219..45c9c93b6 100644 --- a/params/variants.toml +++ b/params/variants.toml @@ -6098,15 +6098,37 @@ selector.four = "openNonCrossing" sampler = "5" tagKind = "digit" -[prime.five.variants.vertical-upper-left-bar] -rank = 1 -description = "`5` with a vertical upper-left bar" -selector.five = "verticalUpperLeftBar" +[prime.five.variants-buildup] +entry = "upper-left-bar" +descriptionLeader = "`5`" -[prime.five.variants.oblique-upper-left-bar] +[prime.five.variants-buildup.stages.upper-left-bar."*"] +next = "middle" + +[prime.five.variants-buildup.stages.upper-left-bar.upright] +rank = 1 +descriptionAffix = "upright upper-left bar" +selectorAffix.five = "upright" +selectorAffix.zhuangToneFive = "upright" + +[prime.five.variants-buildup.stages.upper-left-bar.oblique] rank = 2 -description = "`5` with an oblique upper-left bar" -selector.five = "obliqueUpperLeftBar" +description = "oblique upper-left bar" +selectorAffix.five = "oblique" +selectorAffix.zhuangToneFive = "upright" + +[prime.five.variants-buildup.stages.middle.arched] +rank = 1 +descriptionAffix = "arched middle part" +selectorAffix.five = "arched" +selectorAffix.zhuangToneFive = "arched" + +[prime.five.variants-buildup.stages.middle.flat] +rank = 2 +nonBreakingVariantAdditionPriority = 100 +descriptionAffix = "flat middle part" +selectorAffix.five = "flat" +selectorAffix.zhuangToneFive = "flat" @@ -7120,7 +7142,7 @@ two = "curly-neck" one = "no-base" three = "two-arcs" four = "semi-open" -five = "vertical-upper-left-bar" +five = "upright-arched" six = "straight-bar" seven = "straight-serifless" eight = "crossing" @@ -7751,7 +7773,7 @@ cyrl-u = "straight-turn-serifless" zero = "dotted" one = "base" four = "closed" -five = "oblique-upper-left-bar" +five = "oblique-arched" six = "closed-contour" seven = "bend-serifless" eight = "two-circles" @@ -7917,6 +7939,7 @@ cyrl-capital-ya = "curly-serifless" cyrl-ya = "curly-serifless" zero = "diamond-reverse-slashed-split" four = "closed" +five = "upright-flat" six = "closed-contour" seven = "curly-serifless" nine = "closed-contour" @@ -8025,7 +8048,7 @@ zero = "oval-dotted" one = "base-flat-top-serif" two = "straight-neck" four = "closed" -five = "oblique-upper-left-bar" +five = "oblique-arched" six = "closed-contour" seven = "bend-serifless" eight = "crossing-asymmetric" @@ -8210,7 +8233,7 @@ cyrl-u = "straight-turn-serifless" zero = "oval-dotted" one = "base" four = "closed" -five = "oblique-upper-left-bar" +five = "oblique-arched" six = "open-contour" seven = "bend-serifless" eight = "crossing-asymmetric" @@ -8389,6 +8412,7 @@ one = "base" two = "straight-neck" three = "flat-top" four = "semi-open-non-crossing" +five = "upright-flat" seven = "straight-serifed" eight = "two-circles" paren = "flat-arc" @@ -8479,7 +8503,7 @@ zero = "dotted" one = "base" two = "straight-neck" four = "closed" -five = "oblique-upper-left-bar" +five = "oblique-arched" six = "open-contour" seven = "straight-serifed" eight = "two-circles" @@ -8675,7 +8699,7 @@ cyrl-u = "straight-turn-serifless" cyrl-capital-ya = "straight-motion-serifed" one = "base" four = "semi-open" -five = "oblique-upper-left-bar" +five = "oblique-arched" six = "closed-contour" seven = "straight-serifed" nine = "closed-contour"