Improve ligation set for logical operators; Add bar kerning to match JetBrains Mono (#1192).
This commit is contained in:
parent
5ec1291c65
commit
5e7a32a86c
6 changed files with 227 additions and 138 deletions
1
changes/10.1.0.md
Normal file
1
changes/10.1.0.md
Normal file
|
@ -0,0 +1 @@
|
|||
* Improve ligation set for logical operators; Add bar kerning to match JetBrains Mono (#1192).
|
|
@ -20,6 +20,9 @@ glyph-block Symbol-Ligation : begin
|
|||
if (rk !== 'f') : set k : k + Joining.Classes.Right
|
||||
Joining.set currentGlyph k
|
||||
|
||||
define RodBarHGap : Math.max (Width / 8) [AdviceStroke 6]
|
||||
define RodBarHOffset : 0.5 * Width - HalfStroke * HVContrast - RodBarHGap
|
||||
|
||||
define arrowheadSlope : 1 / LessSlope
|
||||
define [ArrowBarConfig extend kern join doubleBar] : begin
|
||||
define cleft O
|
||||
|
@ -38,6 +41,7 @@ glyph-block Symbol-Ligation : begin
|
|||
l arrowl
|
||||
l1 : arrowl - kern
|
||||
c cleft
|
||||
m (0 - RodBarHOffset)
|
||||
j (-join)
|
||||
j1 (-join - kern)
|
||||
z zleft
|
||||
|
@ -49,6 +53,7 @@ glyph-block Symbol-Ligation : begin
|
|||
r arrowr
|
||||
r1 : arrowr + kern
|
||||
c cright
|
||||
m (Width + RodBarHOffset)
|
||||
j (Width + join)
|
||||
j1 (Width + join + kern)
|
||||
z zright
|
||||
|
@ -64,7 +69,7 @@ glyph-block Symbol-Ligation : begin
|
|||
define [HyphenNotch x] : union
|
||||
VBar x (SymbolMid + OperatorStroke / 3) (SymbolMid + OperatorStroke) OperatorStroke
|
||||
VBar x (SymbolMid - OperatorStroke / 3) (SymbolMid - OperatorStroke) OperatorStroke
|
||||
foreach [{lS rS left right} : items-of [ArrowBarConfig arrowExtend arrowheadsKern arrowJ false]] : begin
|
||||
foreach [{lS rS left right} : items-of [ArrowBarConfig arrowExtend arrowheadsKern arrowJ 0]] : begin
|
||||
create-glyph "hyphen.lig.\(lS)\(rS)" : glyph-proc
|
||||
include : SetJoiningKind lS rS
|
||||
include : HBar left right SymbolMid OperatorStroke
|
||||
|
@ -81,12 +86,33 @@ glyph-block Symbol-Ligation : begin
|
|||
local dblExtend : clamp 0 Width (RightSB - (dblArrowD - dblArrowSw / 2) * arrowheadSlope)
|
||||
local dblArrowJ : clamp 0 Width (SB + (dblArrowD - dblArrowSw / 2) * arrowheadSlope)
|
||||
|
||||
foreach {lS rS left right} [items-of : ArrowBarConfig dblExtend arrowheadsKern dblArrowJ true]
|
||||
foreach {lS rS left right} [items-of : ArrowBarConfig dblExtend arrowheadsKern dblArrowJ 1]
|
||||
create-glyph "equal.lig.\(lS)\(rS)" : glyph-proc
|
||||
include : SetJoiningKind lS rS
|
||||
include : HBarTop left right (SymbolMid + dblArrowD) dblArrowSw
|
||||
include : HBarBottom left right (SymbolMid - dblArrowD) dblArrowSw
|
||||
|
||||
do "bottom sign derivatives"
|
||||
glyph-block-import Symbol-Punctuation-Dashes : UnderScoreConfig
|
||||
|
||||
foreach { suffix { yBar } } [Object.entries UnderScoreConfig] : do
|
||||
create-glyph "underscore.lig.zf.\(suffix)" : glyph-proc
|
||||
Joining.set currentGlyph Joining.Classes.Left
|
||||
include : HBarBottom (O - SB) RightSB yBar
|
||||
create-glyph "underscore.lig.fm.\(suffix)" : glyph-proc
|
||||
Joining.set currentGlyph Joining.Classes.Right
|
||||
include : HBarBottom SB (Width + RodBarHOffset) yBar
|
||||
create-glyph "underscore.lig.mf.\(suffix)" : glyph-proc
|
||||
Joining.set currentGlyph Joining.Classes.Left
|
||||
include : HBarBottom (0 - RodBarHOffset) RightSB yBar
|
||||
create-glyph "bar.lig.bottomMid.\(suffix)"
|
||||
VBar Middle yBar ParenTop
|
||||
|
||||
select-variant "underscore.lig.zf" (follow -- 'underscore')
|
||||
select-variant "underscore.lig.fm" (follow -- 'underscore')
|
||||
select-variant "underscore.lig.mf" (follow -- 'underscore')
|
||||
select-variant "bar.lig.bottomMid" (follow -- 'underscore')
|
||||
|
||||
do "Waves"
|
||||
glyph-block-import Shared-Symbol-Shapes : CreateWaveShape
|
||||
define WaveShape : CreateWaveShape dblArrowD dblArrowSw (-1 / 4)
|
||||
|
@ -104,6 +130,7 @@ glyph-block Symbol-Ligation : begin
|
|||
f { F nothing false }
|
||||
z { Z nothing false }
|
||||
c { C nothing false }
|
||||
m { J (0 - RodBarHOffset) true }
|
||||
j { J (-arrowJ) true }
|
||||
j1 { J (-arrowJ - arrowheadsKern) true }
|
||||
|
||||
|
@ -113,6 +140,7 @@ glyph-block Symbol-Ligation : begin
|
|||
f { F nothing false }
|
||||
z { Z nothing false }
|
||||
c { C nothing false }
|
||||
m { J (Width + RodBarHOffset) true }
|
||||
j { J (Width + arrowJ) true }
|
||||
j1 { J (Width + arrowJ + arrowheadsKern) true }
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ glyph-block Symbol-Punctuation-Dashes : begin
|
|||
VBarLeft SB y (y + openBoxGap)
|
||||
VBarRight RightSB y (y + openBoxGap)
|
||||
|
||||
glyph-block-export UnderScoreConfig
|
||||
define UnderScoreConfig : object
|
||||
aboveBaseline { 0 }
|
||||
high { (-Stroke) }
|
||||
|
@ -26,9 +27,6 @@ glyph-block Symbol-Punctuation-Dashes : begin
|
|||
|
||||
foreach { suffix { yBar } } [Object.entries UnderScoreConfig] : do
|
||||
create-glyph "underscore.\(suffix)" : HBarBottom SB RightSB yBar
|
||||
create-glyph "underscore.jr.\(suffix)" : glyph-proc
|
||||
Joining.set currentGlyph Joining.Classes.Left
|
||||
include : HBarBottom (joiningOverlap - SB) RightSB yBar
|
||||
create-glyph "doubleUnderscore.\(suffix)" : composite-proc
|
||||
HBarBottom SB RightSB yBar
|
||||
HBarBottom SB RightSB (yBar - openBoxGap)
|
||||
|
@ -37,7 +35,6 @@ glyph-block Symbol-Punctuation-Dashes : begin
|
|||
OpenBoxSide (yBar + Stroke / 2)
|
||||
|
||||
select-variant 'underscore' '_'
|
||||
select-variant 'underscore.jr' null (follow -- 'underscore')
|
||||
select-variant 'openBox' 0x2423 (follow -- 'underscore')
|
||||
select-variant 'doubleUnderscore' 0x2017 (follow -- 'underscore')
|
||||
|
||||
|
|
|
@ -20,6 +20,9 @@ glyph-block Symbol-Punctuation-Ligation-Variants : begin
|
|||
* "period/mid"
|
||||
* "comma"
|
||||
* "exclam"
|
||||
* "bar"
|
||||
* "slash"
|
||||
* "backslash"
|
||||
|
||||
define dotLikeTwoPartPunctuations : list
|
||||
* { "question" "question/hookPart" "question/dotPart" }
|
||||
|
|
|
@ -32,6 +32,7 @@ define [buildLigationsImpl sink para featureName mappedFeature rankedLookups] :
|
|||
define lessAndEquiv {'less' 'less.lig.shift0' 'less.lig.shift0.anti'}
|
||||
define hyphen {'hyphen'}
|
||||
define equal {'equal'}
|
||||
define anyStraightRod { 'hyphen' 'equal' }
|
||||
define exclam {'exclam'}
|
||||
define greater {'greater'}
|
||||
define greaterAndEquiv {'greater' 'greater.lig.shift0' 'greater.lig.shift0.anti'}
|
||||
|
@ -39,6 +40,7 @@ define [buildLigationsImpl sink para featureName mappedFeature rankedLookups] :
|
|||
define slash {'slash'}
|
||||
define backslash {'backslash'}
|
||||
define bar {'bar'}
|
||||
define underscore {'underscore'}
|
||||
define regexLookAround [less.concat hyphen equal exclam greater anyBar]
|
||||
|
||||
define [acops] {'less' 'greater' 'hyphen' 'equal' 'plus'}
|
||||
|
@ -195,8 +197,8 @@ define [buildLigationsImpl sink para featureName mappedFeature rankedLookups] :
|
|||
|
||||
foreach { dpShort dpTall } [items-of dottyPunctuationSets] : begin
|
||||
define dp : {}.concat dpShort dpTall
|
||||
define dLeft : [lsx 'dLeftHalf'] dp
|
||||
define dRight : [lsx 'dRightHalf'] dp
|
||||
define dLeft : [lsx 'dLeft'] dp
|
||||
define dRight : [lsx 'dRight'] dp
|
||||
define dLeftHalf : [lsx 'dLeftHalf'] dp
|
||||
define dRightHalf : [lsx 'dRightHalf'] dp
|
||||
define dMid : [lsx 'dMid'] dp
|
||||
|
@ -236,6 +238,19 @@ define [buildLigationsImpl sink para featureName mappedFeature rankedLookups] :
|
|||
boundary ~> look-around
|
||||
|
||||
CreateLigationLookup : list
|
||||
chain-rule
|
||||
dRight ~> look-around
|
||||
dMid ~> dRightHalf
|
||||
dMid ~> dLeftHalf
|
||||
dLeft ~> look-around
|
||||
chain-rule
|
||||
dRight ~> look-around
|
||||
dMid ~> dRightHalf
|
||||
dMid ~> look-around
|
||||
chain-rule
|
||||
dMid ~> look-around
|
||||
dMid ~> dLeftHalf
|
||||
dLeft ~> look-around
|
||||
chain-rule
|
||||
dRight ~> dRightHalf
|
||||
dLeft ~> dLeftHalf
|
||||
|
@ -366,7 +381,7 @@ define [buildLigationsImpl sink para featureName mappedFeature rankedLookups] :
|
|||
list hyphen lsx
|
||||
list anyWave [lambda [k] [just "wave.lig.\(k)"]]
|
||||
|
||||
foreach [{barCls dbl ltgt CBar} : items-of ArrowFormationConfig] : do
|
||||
foreach [{rodCls dbl ltgt CRod} : items-of ArrowFormationConfig] : do
|
||||
define heads {}
|
||||
define rods {}
|
||||
|
||||
|
@ -418,211 +433,209 @@ define [buildLigationsImpl sink para featureName mappedFeature rankedLookups] :
|
|||
# Arrow head identifier
|
||||
begin "Central"
|
||||
heads.push : chain-rule # = > > =
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
greater ~> [TJoinHeadForceShift1]
|
||||
greater ~> [TAntiHeadForce]
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
heads.push : chain-rule # = < < =
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
less ~> [TAntiHeadForce]
|
||||
less ~> [TJoinHeadForceShift1]
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
heads.push : chain-rule # = > < =
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
greater ~> [TJoinHeadForce]
|
||||
less ~> [TJoinHeadForce]
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
heads.push : chain-rule # = < > =
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
less ~> [TAntiHeadForce]
|
||||
greater ~> [TAntiHeadForce]
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
heads.push : chain-rule # = > =
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
greater ~> [TMiddleHead]
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
heads.push : chain-rule # = < =
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
less ~> [TMiddleHead]
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
begin "Boundary"
|
||||
heads.push : chain-rule # = > >
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
greater ~> [TJoinHeadForceShift1]
|
||||
greater ~> look-around
|
||||
heads.push : chain-rule # = < <
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
less ~> [TAntiHeadForceShiftN1]
|
||||
less ~> look-around
|
||||
heads.push : chain-rule # > > =
|
||||
greater ~> look-around
|
||||
greater ~> [TAntiHeadForceShiftN1]
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
heads.push : chain-rule # < < =
|
||||
less ~> look-around
|
||||
less ~> [TJoinHeadForceShift1]
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
heads.push : chain-rule # = = >
|
||||
barCls ~> look-around
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
greater ~> [TJoinHeadForce]
|
||||
heads.push : chain-rule # = = <
|
||||
barCls ~> look-around
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
less ~> [TAntiHeadForce]
|
||||
heads.push : chain-rule # > = =
|
||||
greater ~> [TAntiHeadForce]
|
||||
barCls ~> look-around
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
heads.push : chain-rule # < = =
|
||||
less ~> [TJoinHeadForce]
|
||||
barCls ~> look-around
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
heads.push : chain-rule # * = >
|
||||
arrowIndicator ~> look-around
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
greater ~> [TJoinHeadForce]
|
||||
heads.push : chain-rule # * = <
|
||||
arrowIndicator ~> look-around
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
less ~> [TAntiHeadForce]
|
||||
heads.push : chain-rule # > = *
|
||||
greater ~> [TAntiHeadForce]
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
arrowIndicator ~> look-around
|
||||
heads.push : chain-rule # < = *
|
||||
less ~> [TJoinHeadForce]
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
arrowIndicator ~> look-around
|
||||
begin "Ambiguous"
|
||||
heads.push : chain-rule # = >
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
greater ~> [TJoinHeadAmbig]
|
||||
heads.push : chain-rule # = <
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
less ~> [TAntiHeadAmbig]
|
||||
heads.push : chain-rule # > =
|
||||
greater ~> [TAntiHeadAmbig]
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
heads.push : chain-rule # < =
|
||||
less ~> [TJoinHeadAmbig]
|
||||
barCls ~> look-around
|
||||
rodCls ~> look-around
|
||||
|
||||
# Rod transformer
|
||||
define kindLeftMid : list
|
||||
list false 'l' : CollectApply less : list CJoinHeadForce CJoinHeadMid
|
||||
list false 'l1' : CollectApply less : list CJoinHeadForceShift1
|
||||
list false 'j' : CollectApply greater : list CAntiHeadForce CJoinHeadMid
|
||||
list true 'j' anyBar
|
||||
list true 'm' anyBar
|
||||
list false 'j1' : CollectApply greater : list CAntiHeadForceShiftN1
|
||||
define kindRightMid : list
|
||||
list false 'r' : CollectApply greater : list CJoinHeadForce CJoinHeadMid
|
||||
list false 'r1' : CollectApply greater : list CJoinHeadForceShift1
|
||||
list false 'j' : CollectApply less : list CAntiHeadForce CJoinHeadMid
|
||||
list true 'j' anyBar
|
||||
list true 'm' anyBar
|
||||
list false 'j1' : CollectApply less : list CAntiHeadForceShiftN1
|
||||
|
||||
# console.log featureName barCls kindLeftMid kindRightMid
|
||||
# console.log featureName rodCls kindLeftMid kindRightMid
|
||||
|
||||
foreach [{ lBar kl envL } : items-of kindLeftMid] : begin
|
||||
foreach [{ rBar kr envR } : items-of kindRightMid] : begin
|
||||
if (!lBar || !rBar) : begin
|
||||
rods.push : chain-rule # < - >
|
||||
envL ~> look-around
|
||||
barCls ~> [CBar "\(kl)\(kr)"]
|
||||
rodCls ~> [CRod "\(kl)\(kr)"]
|
||||
envR ~> look-around
|
||||
|
||||
foreach [{ lBar kl envL } : items-of kindLeftMid] : begin
|
||||
if (!lBar) : begin
|
||||
rods.push : chain-rule # < -
|
||||
envL ~> look-around
|
||||
barCls ~> [CBar "\(kl)f"]
|
||||
rodCls ~> [CRod "\(kl)f"]
|
||||
|
||||
foreach [{ rBar kr envR } : items-of kindRightMid] : begin
|
||||
if (!rBar) : begin
|
||||
rods.push : chain-rule # - >
|
||||
barCls ~> [CBar "f\(kr)"]
|
||||
rodCls ~> [CRod "f\(kr)"]
|
||||
envR ~> look-around
|
||||
|
||||
CreateLigationLookup heads
|
||||
CreateLigationLookup rods
|
||||
|
||||
foreach [{barCls CBar} : items-of ArrowExtensionConfig] : do
|
||||
do "Extended arrow sticks"
|
||||
# Extension
|
||||
local stickTermLeft {}
|
||||
local stickConnLeft {}
|
||||
foreach [lc : items-of {'l' 'l1' 'j' 'j1' 'c' 'z'}] : begin
|
||||
set stickTermLeft : stickTermLeft.concat : [CBar "\(lc)f"] barCls
|
||||
set stickConnLeft : stickConnLeft.concat : [CBar "\(lc)c"] barCls
|
||||
foreach [{rodCls CRod} : items-of ArrowExtensionConfig] : do "Extended arrow sticks"
|
||||
# Extension
|
||||
local rodTermLeft {}
|
||||
local rodConnLeft {}
|
||||
foreach [lc : items-of {'l' 'l1' 'j' 'j1' 'c' 'z' 'm'}] : begin
|
||||
set rodTermLeft : rodTermLeft.concat : [CRod "\(lc)f"] rodCls
|
||||
set rodConnLeft : rodConnLeft.concat : [CRod "\(lc)c"] rodCls
|
||||
|
||||
local stickTermRight {}
|
||||
local stickConnRight {}
|
||||
foreach [rc : items-of {'r' 'r1' 'j' 'j1' 'c' 'z'}] : begin
|
||||
set stickTermRight : stickTermRight.concat : [CBar "f\(rc)"] barCls
|
||||
set stickConnRight : stickConnRight.concat : [CBar "c\(rc)"] barCls
|
||||
local rodTermRight {}
|
||||
local rodConnRight {}
|
||||
foreach [rc : items-of {'r' 'r1' 'j' 'j1' 'c' 'z' 'm'}] : begin
|
||||
set rodTermRight : rodTermRight.concat : [CRod "f\(rc)"] rodCls
|
||||
set rodConnRight : rodConnRight.concat : [CRod "c\(rc)"] rodCls
|
||||
|
||||
CreateLigationLookup : list
|
||||
chain-rule
|
||||
stickTermLeft ~> look-around
|
||||
barCls ~> [CBar 'zf']
|
||||
CreateLigationLookup : list
|
||||
chain-rule
|
||||
rodTermLeft ~> look-around
|
||||
rodCls ~> [CRod 'zf']
|
||||
|
||||
CreateReverseLigationLookup : list
|
||||
reverse-rule
|
||||
barCls ~> [CBar 'fz']
|
||||
stickTermRight ~> look-around
|
||||
CreateReverseLigationLookup : list
|
||||
reverse-rule
|
||||
rodCls ~> [CRod 'fz']
|
||||
rodTermRight ~> look-around
|
||||
|
||||
# Fix for Apple : arrow bar at line start won't join with the rest (#548)
|
||||
CreateLigationLookup : list
|
||||
chain-rule
|
||||
barCls ~> [CBar 'fz']
|
||||
stickTermRight ~> look-around
|
||||
# Fix for Apple : arrow bar at line start won't join with the rest (#548)
|
||||
CreateLigationLookup : list
|
||||
chain-rule
|
||||
rodCls ~> [CRod 'fz']
|
||||
rodTermRight ~> look-around
|
||||
|
||||
CreateLigationLookup : list
|
||||
chain-rule
|
||||
stickTermLeft ~> look-around
|
||||
[[CBar 'zf'] barCls] ~> [[CBar 'zj'] barCls]
|
||||
anyBar ~> look-around
|
||||
chain-rule
|
||||
anyBar ~> look-around
|
||||
[[CBar 'fz'] barCls] ~> [[CBar 'jz'] barCls]
|
||||
stickTermRight ~> look-around
|
||||
CreateLigationLookup : list
|
||||
chain-rule
|
||||
rodTermLeft ~> look-around
|
||||
[[CRod 'zf'] rodCls] ~> [[CRod 'zm'] rodCls]
|
||||
anyBar ~> [lsx 'dMid']
|
||||
chain-rule
|
||||
anyBar ~> [lsx 'dMid']
|
||||
[[CRod 'fz'] rodCls] ~> [[CRod 'mz'] rodCls]
|
||||
rodTermRight ~> look-around
|
||||
|
||||
# Gap filling
|
||||
CreateLigationLookup : list
|
||||
chain-rule
|
||||
stickTermLeft ~> stickConnLeft
|
||||
stickTermRight ~> stickConnRight
|
||||
# Gap filling
|
||||
CreateLigationLookup : list
|
||||
chain-rule
|
||||
rodTermLeft ~> rodConnLeft
|
||||
rodTermRight ~> rodConnRight
|
||||
|
||||
foreach [{barCls dbl ltgt CBar} : items-of ArrowFormationConfig] : do
|
||||
foreach [{rodCls dbl ltgt CRod} : items-of ArrowFormationConfig] : do "Ambiguous rods"
|
||||
define [CJoinHeadForce] : if dbl [lsx 'dblhead'] [lsx 'shift0']
|
||||
define [CAntiHeadForce] : if dbl [lsx 'hole'] [lsx 'shift0.anti']
|
||||
|
||||
do "Ambiguous rods"
|
||||
define ambiguousRods {}
|
||||
ambiguousRods.push : chain-rule # =>
|
||||
barCls ~> [if [hasLG 'arrow'] [CBar 'fr'] advance]
|
||||
greater ~> [if [hasLG 'arrow'] [CJoinHeadForce] advance]
|
||||
if ltgt
|
||||
ambiguousRods.push : chain-rule # <=
|
||||
less ~> [if [hasLG 'arrowZALE'] [CJoinHeadForce] advance]
|
||||
barCls ~> [if [hasLG 'arrowZALE'] [CBar 'lf'] advance]
|
||||
ambiguousRods.push : chain-rule # <-
|
||||
less ~> [if [hasLG 'arrow'] [CJoinHeadForce] advance]
|
||||
barCls ~> [if [hasLG 'arrow'] [CBar 'lf'] advance]
|
||||
define ambiguousRods {}
|
||||
ambiguousRods.push : chain-rule # =>
|
||||
rodCls ~> [if [hasLG 'arrow'] [CRod 'fr'] advance]
|
||||
greater ~> [if [hasLG 'arrow'] [CJoinHeadForce] advance]
|
||||
if ltgt
|
||||
ambiguousRods.push : chain-rule # <=
|
||||
less ~> [if [hasLG 'arrowZALE'] [CJoinHeadForce] advance]
|
||||
rodCls ~> [if [hasLG 'arrowZALE'] [CRod 'lf'] advance]
|
||||
ambiguousRods.push : chain-rule # <-
|
||||
less ~> [if [hasLG 'arrow'] [CJoinHeadForce] advance]
|
||||
rodCls ~> [if [hasLG 'arrow'] [CRod 'lf'] advance]
|
||||
|
||||
ambiguousRods.push : chain-rule # =<
|
||||
barCls ~> [if [hasLG 'arrow2'] [CBar 'fj'] advance]
|
||||
less ~> [if [hasLG 'arrow2'] [CAntiHeadForce] advance]
|
||||
if ltgt
|
||||
ambiguousRods.push : chain-rule # >=
|
||||
greater ~> [if [hasLG 'arrowZAGE'] [CAntiHeadForce] advance]
|
||||
barCls ~> [if [hasLG 'arrowZAGE'] [CBar 'jf'] advance]
|
||||
ambiguousRods.push : chain-rule # >-
|
||||
greater ~> [if [hasLG 'arrow2'] [CAntiHeadForce] advance]
|
||||
barCls ~> [if [hasLG 'arrow2'] [CBar 'jf'] advance]
|
||||
ambiguousRods.push : chain-rule # =<
|
||||
rodCls ~> [if [hasLG 'arrow2'] [CRod 'fj'] advance]
|
||||
less ~> [if [hasLG 'arrow2'] [CAntiHeadForce] advance]
|
||||
if ltgt
|
||||
ambiguousRods.push : chain-rule # >=
|
||||
greater ~> [if [hasLG 'arrowZAGE'] [CAntiHeadForce] advance]
|
||||
rodCls ~> [if [hasLG 'arrowZAGE'] [CRod 'jf'] advance]
|
||||
ambiguousRods.push : chain-rule # >-
|
||||
greater ~> [if [hasLG 'arrow2'] [CAntiHeadForce] advance]
|
||||
rodCls ~> [if [hasLG 'arrow2'] [CRod 'jf'] advance]
|
||||
|
||||
CreateLigationLookup ambiguousRods
|
||||
CreateLigationLookup ambiguousRods
|
||||
|
||||
# <<, >>, <<<, >>>
|
||||
do "Less/Greater Chaining" : if [hasLG 'llgg'] : begin
|
||||
|
@ -701,17 +714,21 @@ define [buildLigationsImpl sink para featureName mappedFeature rankedLookups] :
|
|||
do "logical" : if [hasLG 'logic'] : begin
|
||||
CreateLigationLookup : list
|
||||
chain-rule
|
||||
slash ~> [csx 'left']
|
||||
backslash ~> [csx 'right']
|
||||
slash ~> [csx 'left']
|
||||
backslash ~> [csx 'right']
|
||||
chain-rule
|
||||
backslash ~> [csx 'left']
|
||||
slash ~> [csx 'right']
|
||||
backslash ~> [csx 'left']
|
||||
slash ~> [csx 'right']
|
||||
chain-rule
|
||||
bar ~> look-around
|
||||
hyphen ~> [lsx 'jf']
|
||||
bar ~> [lsx "dMid"]
|
||||
anyStraightRod ~> [lsx 'mf']
|
||||
chain-rule
|
||||
hyphen ~> [lsx 'fj']
|
||||
bar ~> look-around
|
||||
anyStraightRod ~> [lsx 'fm']
|
||||
bar ~> [lsx "dMid"]
|
||||
chain-rule
|
||||
underscore ~> [lsx 'fm']
|
||||
bar ~> [lsx 'bottomMid']
|
||||
underscore ~> [lsx 'mf']
|
||||
|
||||
# == and !=, and other related
|
||||
do "equals" : begin
|
||||
|
@ -911,8 +928,8 @@ define [buildLigationsImpl sink para featureName mappedFeature rankedLookups] :
|
|||
do "Underscore chains" : if [hasLG 'connected-underscore'] : begin
|
||||
CreateLigationLookup : list
|
||||
chain-rule
|
||||
{'underscore' 'underscore.jr'} ~> look-around
|
||||
{'underscore'} ~> {'underscore.jr'}
|
||||
[underscore.concat : [lsx 'zf'] underscore] ~> look-around
|
||||
underscore ~> [lsx 'zf']
|
||||
|
||||
do "Tilde chains" : if [hasLG 'connected-tilde-as-wave'] : begin
|
||||
CreateLigationLookup : list
|
||||
|
@ -968,3 +985,41 @@ define [buildLigationsImpl sink para featureName mappedFeature rankedLookups] :
|
|||
chain-rule
|
||||
{'numberSign' 'numberSign.jr'} ~> look-around
|
||||
{'numberSign'} ~> {'numberSign.jr'}
|
||||
|
||||
do "Kern Bars" : if [hasLG 'kern-bars'] : foreach chBar [items-of anyBar] : begin
|
||||
define dp { chBar }
|
||||
define dLeft : [lsx 'dLeft'] dp
|
||||
define dRight : [lsx 'dRight'] dp
|
||||
define dLeftHalf : [lsx 'dLeftHalf'] dp
|
||||
define dRightHalf : [lsx 'dRightHalf'] dp
|
||||
define dMid : [lsx 'dMid'] dp
|
||||
|
||||
CreateLigationLookup : list
|
||||
chain-rule
|
||||
[dRight.concat dMid] ~> look-around
|
||||
dp ~> dMid
|
||||
[dp.concat dMid] ~> look-around
|
||||
chain-rule
|
||||
[dRight.concat dMid] ~> look-around
|
||||
dp ~> dLeft
|
||||
chain-rule
|
||||
dp ~> dRight
|
||||
[dp.concat dMid] ~> look-around
|
||||
|
||||
CreateLigationLookup : list
|
||||
chain-rule
|
||||
dRight ~> look-around
|
||||
dMid ~> dRightHalf
|
||||
dMid ~> dLeftHalf
|
||||
dLeft ~> look-around
|
||||
chain-rule
|
||||
dRight ~> look-around
|
||||
dMid ~> dRightHalf
|
||||
dMid ~> look-around
|
||||
chain-rule
|
||||
dMid ~> look-around
|
||||
dMid ~> dLeftHalf
|
||||
dLeft ~> look-around
|
||||
chain-rule
|
||||
dRight ~> dRightHalf
|
||||
dLeft ~> dLeftHalf
|
||||
|
|
|
@ -121,6 +121,11 @@ ligGroup = "kern-dotty"
|
|||
samples = ["::", ":::"]
|
||||
desc = 'Move connecting dotty punctuations closer, like for `::`, `:::` and `...`'
|
||||
|
||||
[simple.kern-bars]
|
||||
ligGroup = "kern-bars"
|
||||
samples = ["||", "|||"]
|
||||
desc = 'Move consecutive bars closer, like for `||`, `|||` and `//`'
|
||||
|
||||
[simple.logic]
|
||||
ligGroup = "logic"
|
||||
samples = ["/\\", "\\/", "|-", "-|"]
|
||||
|
@ -206,89 +211,89 @@ desc = 'Make contiguous hyphen-minuses (like `--`) connected as a straight semi-
|
|||
# This feature is on by default by many software
|
||||
[composite.default-calt]
|
||||
tag = 'calt'
|
||||
buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'llgg', 'llggeq', 'eqeq', 'exeq', 'ineq', 'plusplus', 'kern-dotty']
|
||||
buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'llgg', 'llggeq', 'eqeq', 'exeq', 'ineq', 'plusplus', 'kern-dotty', 'kern-bars']
|
||||
brief = 'Default'
|
||||
desc = 'Default setting in text editors'
|
||||
readmeDesc = 'Inherit default ligation set'
|
||||
|
||||
[composite.dlig]
|
||||
tag = 'dlig'
|
||||
buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'arrow2', 'llgg', 'eqeq', 'exeq', 'ineq', 'ltgt-diamond', 'plusplus', 'kern-dotty', 'dot-as-operator', 'logic', 'brst', 'brace-bar', 'brack-bar', 'connected-underscore', 'connected-number-sign', 'connected-tilde-as-wave', 'connected-hyphen-as-semi-dashed-line']
|
||||
buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'arrow2', 'llgg', 'eqeq', 'exeq', 'ineq', 'ltgt-diamond', 'plusplus', 'kern-dotty', 'kern-bars', 'dot-as-operator', 'logic', 'brst', 'brace-bar', 'brack-bar', 'connected-underscore', 'connected-number-sign', 'connected-tilde-as-wave', 'connected-hyphen-as-semi-dashed-line']
|
||||
brief = 'Discretionary'
|
||||
desc = 'Discretionary ligatures'
|
||||
|
||||
[composite.clike]
|
||||
tag = 'CLIK'
|
||||
buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'llgg', 'llggeq', 'eqeqeq', 'eqeq', 'exeqeq', 'exeq', 'ineq', 'plusplus', 'kern-dotty']
|
||||
buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'llgg', 'llggeq', 'eqeqeq', 'eqeq', 'exeqeq', 'exeq', 'ineq', 'plusplus', 'kern-dotty', 'kern-bars']
|
||||
desc = 'C-Like'
|
||||
|
||||
[composite.javascript]
|
||||
tag = 'JSPT'
|
||||
buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'llgg', 'llggeq', 'eqeqeq', 'eqeq', 'exeqeq', 'exeq', 'ineq', 'plusplus', 'kern-dotty']
|
||||
buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'llgg', 'llggeq', 'eqeqeq', 'eqeq', 'exeqeq', 'exeq', 'ineq', 'plusplus', 'kern-dotty', 'kern-bars']
|
||||
desc = 'JavaScript'
|
||||
|
||||
[composite.php]
|
||||
tag = 'PHPX'
|
||||
buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'llgg', 'llggeq', 'eqeqeq', 'eqeq', 'exeqeq', 'exeq', 'ineq', 'plusplus', 'kern-dotty']
|
||||
buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'llgg', 'llggeq', 'eqeqeq', 'eqeq', 'exeqeq', 'exeq', 'ineq', 'plusplus', 'kern-dotty', 'kern-bars']
|
||||
desc = 'PHP'
|
||||
|
||||
[composite.ml]
|
||||
tag = 'MLXX'
|
||||
buildup = ['center-ops', 'arrow', 'trig', 'eqeq', 'ltgt-ne', 'ineq', 'brst', 'plusplus', 'logic']
|
||||
buildup = ['center-ops', 'arrow', 'trig', 'eqeq', 'ltgt-ne', 'ineq', 'brst', 'plusplus', 'logic', 'kern-dotty', 'kern-bars']
|
||||
desc = 'ML'
|
||||
|
||||
[composite.fsharp]
|
||||
tag = 'FSHP'
|
||||
buildup = ['center-ops', 'arrow', 'trig', 'eqeq', 'ltgt-ne', 'ineq', 'brst', 'plusplus', 'logic']
|
||||
buildup = ['center-ops', 'arrow', 'trig', 'eqeq', 'ltgt-ne', 'ineq', 'brst', 'plusplus', 'logic', 'kern-dotty', 'kern-bars']
|
||||
desc = 'F#'
|
||||
|
||||
[composite.fstar]
|
||||
tag = 'FSTA'
|
||||
buildup = ['center-ops', 'arrow', 'trig', 'eqeq', 'ltgt-ne', 'eqeqeq', 'eqexeq', 'ineq', 'brst', 'plusplus', 'logic']
|
||||
buildup = ['center-ops', 'arrow', 'trig', 'eqeq', 'ltgt-ne', 'eqeqeq', 'eqexeq', 'ineq', 'brst', 'plusplus', 'logic', 'kern-dotty', 'kern-bars']
|
||||
desc = 'F*'
|
||||
|
||||
[composite.haskell]
|
||||
tag = 'HSKL'
|
||||
buildup = ['center-ops', 'arrow', 'arrow2', 'trig', 'llgg', 'eqeq', 'slasheq', 'ineq', 'ltgt-diamond', 'plusplus', 'dot-as-operator', 'kern-dotty', 'logic']
|
||||
buildup = ['center-ops', 'arrow', 'arrow2', 'trig', 'llgg', 'eqeq', 'slasheq', 'ineq', 'ltgt-diamond', 'plusplus', 'dot-as-operator', 'kern-dotty', 'kern-bars', 'logic']
|
||||
desc = 'Haskell'
|
||||
|
||||
[composite.idris]
|
||||
tag = 'IDRS'
|
||||
buildup = ['center-ops', 'arrow', 'arrow2', 'trig', 'llgg', 'eqeq', 'slasheq', 'ineq', 'ltgt-diamond', 'plusplus', 'dot-as-operator', 'kern-dotty', 'logic']
|
||||
buildup = ['center-ops', 'arrow', 'arrow2', 'trig', 'llgg', 'eqeq', 'slasheq', 'ineq', 'ltgt-diamond', 'plusplus', 'dot-as-operator', 'kern-dotty', 'kern-bars', 'logic']
|
||||
desc = 'Idris'
|
||||
|
||||
[composite.elm]
|
||||
tag = 'ELMX'
|
||||
buildup = ['center-ops', 'arrow', 'arrow2', 'trig', 'llgg', 'eqeq', 'slasheq', 'ineq', 'ltgt-diamond', 'plusplus', 'dot-as-operator', 'kern-dotty', 'logic']
|
||||
buildup = ['center-ops', 'arrow', 'arrow2', 'trig', 'llgg', 'eqeq', 'slasheq', 'ineq', 'ltgt-diamond', 'plusplus', 'dot-as-operator', 'kern-dotty', 'kern-bars', 'logic']
|
||||
desc = 'Elm'
|
||||
|
||||
[composite.purescript]
|
||||
tag = 'PURS'
|
||||
buildup = ['center-ops', 'arrow', 'arrow2', 'trig', 'llgg', 'eqeq', 'slasheq', 'ineq', 'ltgt-diamond', 'plusplus', 'dot-as-operator', 'kern-dotty', 'logic']
|
||||
buildup = ['center-ops', 'arrow', 'arrow2', 'trig', 'llgg', 'eqeq', 'slasheq', 'ineq', 'ltgt-diamond', 'plusplus', 'dot-as-operator', 'kern-dotty', 'kern-bars', 'logic']
|
||||
desc = 'PureScript'
|
||||
|
||||
[composite.swift]
|
||||
tag = 'SWFT'
|
||||
buildup = ['center-ops', 'arrow', 'arrow2', 'trig', 'llgg', 'eqeq', 'exeq', 'ineq', 'ltgt-diamond', 'plusplus']
|
||||
buildup = ['center-ops', 'arrow', 'arrow2', 'trig', 'llgg', 'eqeq', 'exeq', 'ineq', 'ltgt-diamond', 'plusplus', 'kern-dotty', 'kern-bars']
|
||||
desc = 'Swift'
|
||||
|
||||
[composite.coq]
|
||||
tag = 'COQX'
|
||||
buildup = ['center-ops', 'arrow', 'arrow2', 'trig', 'llgg', 'eqeq', 'ltgt-ne', 'ineq', 'plusplus', 'dot-as-operator', 'logic', 'brst']
|
||||
buildup = ['center-ops', 'arrow', 'arrow2', 'trig', 'llgg', 'eqeq', 'ltgt-ne', 'ineq', 'plusplus', 'dot-as-operator', 'logic', 'brst', 'kern-dotty', 'kern-bars']
|
||||
desc = 'Coq'
|
||||
|
||||
[composite.matlab]
|
||||
tag = 'MTLB'
|
||||
buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'llgg', 'eqeq', 'tildeeq', 'ineq', 'plusplus', 'kern-dotty']
|
||||
buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'llgg', 'eqeq', 'tildeeq', 'ineq', 'plusplus', 'kern-dotty', 'kern-bars']
|
||||
desc = 'Matlab'
|
||||
|
||||
[composite.verilog]
|
||||
tag = 'VRLG'
|
||||
buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'llgg', 'llggeq', 'eqeqeq', 'eqeq', 'exeqeq', 'exeq', 'plusplus', 'kern-dotty', 'brst']
|
||||
buildup = ['center-ops', 'arrow', 'html-comment', 'trig', 'llgg', 'llggeq', 'eqeqeq', 'eqeq', 'exeqeq', 'exeq', 'plusplus', 'brst', 'kern-dotty', 'kern-bars']
|
||||
desc = 'Verilog'
|
||||
|
||||
[composite.wolfram]
|
||||
tag = 'WFLM'
|
||||
buildup = ['center-ops', 'arrow', 'trig', 'ltgt-diamond', 'eqeq', 'exeq', 'eqexeq-dl', 'ineq', 'brst', 'plusplus', 'logic', 'colon-greater-as-colon-arrow']
|
||||
buildup = ['center-ops', 'arrow', 'trig', 'ltgt-diamond', 'eqeq', 'exeq', 'eqexeq-dl', 'ineq', 'brst', 'plusplus', 'logic', 'colon-greater-as-colon-arrow', 'kern-dotty', 'kern-bars']
|
||||
brief = 'Wolfram'
|
||||
desc = 'Wolfram Language (Mathematica)'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue