Flat 5 (or whatever that is called) (#2010)

* flat 5

* SS Matching as mentioned in issue
This commit is contained in:
Logo 2023-09-29 04:46:20 +08:00 committed by GitHub
parent f0d92894be
commit 6f056eccde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 120 additions and 76 deletions

View file

@ -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).

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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"