Add variant selector to remove notches for equality ligations (#1425).

This commit is contained in:
be5invis 2022-10-01 15:40:08 -07:00
parent d5346169ad
commit b8f463a4d8
5 changed files with 55 additions and 88 deletions

View file

@ -1 +1,2 @@
* Add variant selector to remove notches for equality ligations (#1425).
* Fix `cv40`'s application to CYRILLIC SMALL LETTER ER (`U+0440`) (#1426).

View file

@ -255,100 +255,43 @@ glyph-block Symbol-Ligation : begin
glyph-block-import Symbol-Math-Relation-Common : EqualHalfSpace
glyph-block-import Symbol-Math-Relation-Equal : EqualShape EqualHole IdentShape IdentHole
define joiningOverlap (-Width / 6)
create-glyph 'equal.fc' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : difference
EqualShape SB (Width - joiningOverlap)
EqualHole Width
create-glyph 'equal.cf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : difference
EqualShape joiningOverlap RightSB
EqualHole 0
define SymbolConfig : object
"equal" { EqualShape EqualHole }
"ident" { IdentShape IdentHole }
create-glyph 'equal.jf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : difference
EqualShape (RightSB - Width + joiningOverlap) RightSB
EqualHole 0
define JoinConfig : object
# Shape Left Shape Right Hole positions
"fc" { SB (Width - joiningOverlap) { Width } }
"cf" { joiningOverlap RightSB { 0 } }
"jf" { (RightSB - Width + joiningOverlap) RightSB { 0 } }
"cc" { joiningOverlap (Width - joiningOverlap) { 0 Width } }
"fc+cc" { (SB - Width) (Width - joiningOverlap) { 0 Width } }
"fc+cf" { (SB - Width) RightSB { 0 } }
"cc+cf" { (joiningOverlap - Width) RightSB { (-Width) 0 } }
create-glyph 'equal.cc' : glyph-proc
Joining.set currentGlyph Joining.Classes.Mid
include : difference
EqualShape joiningOverlap (Width - joiningOverlap)
EqualHole 0
EqualHole Width
define NotchConfig : object
withNotch { true }
withoutNotch { false }
create-glyph 'equal.fc+cc' : glyph-proc
Joining.set currentGlyph Joining.Classes.Mid
include : difference
EqualShape (SB - Width) (Width - joiningOverlap)
EqualHole 0
EqualHole Width
foreach { prefix { Shape Hole } } [Object.entries SymbolConfig] : do
foreach { infix { shapeLeft shapeRight xHoles } } [Object.entries JoinConfig] : do
local joinCls 0
if (shapeLeft < 0) : set joinCls : joinCls + Joining.Classes.Left
if (shapeRight > Width) : set joinCls : joinCls + Joining.Classes.Right
create-glyph 'equal.fc+cf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
foreach { suffix { doNotch } } [Object.entries NotchConfig] : do
create-glyph "\(prefix).\(infix).\(suffix)" : glyph-proc
Joining.set currentGlyph joinCls
include : difference
EqualShape (SB - Width) RightSB
EqualHole 0
Shape shapeLeft shapeRight
if doNotch
: then : union.apply null [xHoles.map Hole]
: else : glyph-proc
create-glyph 'equal.cc+cf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : difference
EqualShape (joiningOverlap - Width) RightSB
EqualHole (-Width)
EqualHole 0
create-glyph 'ident.fc' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : difference
IdentShape SB (Width - joiningOverlap)
IdentHole Width
create-glyph 'ident.cf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : difference
IdentShape joiningOverlap RightSB
IdentHole 0
create-glyph 'ident.jf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : difference
IdentShape (RightSB - Width + joiningOverlap) RightSB
IdentHole 0
create-glyph 'ident.cc' : glyph-proc
Joining.set currentGlyph Joining.Classes.Mid
include : difference
IdentShape joiningOverlap (Width - joiningOverlap)
IdentHole 0
IdentHole Width
create-glyph 'ident.fc+cc' : glyph-proc
Joining.set currentGlyph Joining.Classes.Mid
include : difference
IdentShape (SB - Width) (Width - joiningOverlap)
IdentHole 0
IdentHole Width
create-glyph 'ident.fc+cf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : difference
IdentShape (SB - Width) RightSB
IdentHole 0
create-glyph 'ident.cc+cf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : difference
IdentShape (joiningOverlap - Width) RightSB
IdentHole (-Width)
IdentHole 0
select-variant "\(prefix).\(infix)" (follow -- "lig-\(prefix)")
### Inequality
define Neq : namespace
export : define Sw OperatorStroke
export : define Dr : Sw / Stroke * DotRadius

View file

@ -6690,6 +6690,25 @@ selector."neq.bar-only" = "moreSlanted"
[prime.lig-equal-chain]
sampler = "== "
samplerExplain = "Equality ligations"
tag = "VXAG"
[prime.lig-equal-chain.variants.with-notch]
rank = 1
description = "The bars in equality (`==`, etc.) ligation have notches in the middle"
selector."lig-equal" = "withNotch"
selector."lig-ident" = "withNotch"
[prime.lig-equal-chain.variants.without-notch]
rank = 2
description = "The bars in equality (`==`, etc.) ligation do not have notches in the middle"
selector."lig-equal" = "withoutNotch"
selector."lig-ident" = "withoutNotch"
# This is a special variant selector that controls digit form
[prime.digit-form]
isSpecial = true
@ -6824,6 +6843,7 @@ question = "smooth"
punctuation-dot = "round"
diacritic-dot = "round"
lig-neq = "slightly-slanted"
lig-equal-chain = "with-notch"
# m, n, h has tailed variant, but not very ideal
# Do not make them default
@ -7209,6 +7229,7 @@ at = "short"
cent = "open"
percent = "rings-continuous-slash"
lig-ltgteq = "slanted"
lig-equal-chain = "without-notch"
[composite.ss05.slab-override.design]
capital-d = "more-rounded-bilateral-serifed"
@ -7366,6 +7387,7 @@ at = "threefold"
dollar = "open"
cent = "open"
percent = "dots"
lig-equal-chain = "without-notch"
[composite.ss08.italic]
g = "single-storey-serifless"
@ -7666,6 +7688,7 @@ percent = "rings-continuous-slash"
lig-ltgteq = "slanted"
question = "corner-flat-hooked"
lig-neq = "more-slanted"
lig-equal-chain = "without-notch"
[composite.ss14.italic]
a = "single-storey-serifless"

View file

@ -5,7 +5,7 @@ const ssStrings = [
["ABC.DEF.GHI.JKL.MNO.PQRS.TUV.WXYZ", "abc.def.ghi.jkl.mno.pqrs.tuv.wxyz"],
["¢ ſß ΓΛΔ αδιλμξ КУЗЯЖэльфязычникж", "float il1[]={1-2/3.4,5+6=7/8%90};"],
["1234567890 ,._-+= >< ¯-¬_ >~–÷+×<", "{}[]()<>`+-=$*/#_%^@\\&|~?'\" !,.;:"],
["!iIlL17|¦ coO08BbDQ $5SZ2zsz 96G&", [..."dbqp E3 g9q CGQ vvw VVW ", "<=", " ", "!=", " ", ">="]]
["!iIlL17|¦ coO08BbDQ $5SZ2zsz 96G&", [..."dbqp E3 g9qCGQ vvwVVW ", "<=", " ", "!="," ","==", " ", ">="]]
];
function* makeSample(lbm, hotChars) {

View file

@ -5,7 +5,7 @@ const ssStrings = [
["ABC.DEF.GHI.JKL.MNO.PQRS.TUV.WXYZ", "abc.def.ghi.jkl.mno.pqrs.tuv.wxyz"],
["¢ ſß ΓΛΔ αδιλμξ КУЗЯЖэльфязычникж", "float il1[]={1-2/3.4,5+6=7/8%90};"],
["1234567890 ,._-+= >< ¯-¬_ >~–÷+×<", "{}[]()<>`+-=$*/#_%^@\\&|~?'\" !,.;:"],
["!iIlL17|¦ coO08BbDQ $5SZ2zsz 96G&", [..."dbqp E3 g9q CGQ vvw VVW ", "<=", " ", "!=", " ", ">="]]
["!iIlL17|¦ coO08BbDQ $5SZ2zsz 96G&", [..."dbqp E3 g9qCGQ vvwVVW ", "<=", " ", "!="," ","==", " ", ">="]]
];
function* makeSample(theme, lbm, features, hotChars) {