diff --git a/doc/custom-build.md b/doc/custom-build.md index d688f9e99..17f42a3b2 100644 --- a/doc/custom-build.md +++ b/doc/custom-build.md @@ -133,23 +133,32 @@ Subsection `ligations` is used to customize the ligation set assigned to `calt` * `disables` and `enables`: Optional, String Array, Cherry-picking ligation groups to be disabled or enabled. Valid values include: - - `center-ops`: Vertically align some of the operators (like `*`) to the center position it is before or after a "center" operator (like `+`). - - `center-op-trigger-plus-minus-l`: Plus (`+`) and Minus (`-`) will trigger other operator characters at left to be centered. - - `center-op-trigger-plus-minus-r`: Plus (`+`) and Minus (`-`) will trigger other operator characters at right to be centered. - - `center-op-trigger-equal-l`: Equal (`=`) will trigger other operator characters at left to be centered. - - `center-op-trigger-equal-r`: Equal (`=`) will trigger other operator characters at right to be centered. - - `center-op-trigger-bar-l`: Bars (`|`) will trigger other operator characters at left to be centered. - - `center-op-trigger-bar-r`: Bars (`|`) will trigger other operator characters at right to be centered. - - `center-op-trigger-angle-inside`: Less (`<`) and Greater (`>`) will trigger other operator characters at inside to be centered. - - `center-op-trigger-angle-outside`: Less (`<`) and Greater (`>`) will trigger other operator characters at outside to be centered. - - `center-op-influence-dot`: Treat dot (`.`) as operator and perform chained centering. - - `center-op-influence-colon`: Treat colon (`:`) as operator and perform chained centering. - - `arrow-l`: Enable ligation set that forms left-pointing arrows. - - `arrow-r`: Enable ligation set that forms right-pointing arrows. - - `arrow-lr`: Enable ligation set that forms dual-pointing arrows. - - `counter-arrow-l`: Enable ligation that produces left-pointing counter-arrows. - - `counter-arrow-r`: Enable ligation that produces right-pointing counter-arrows. - - `trig`: Enable ligation for `<|`, `|>` , `<||`, and other bar-and-angle-bracket symbols. + - `arrow-l`: Left-pointing arrows. + - `arrow-r`: Right-pointing arrows. + - `arrow-lr`: Dual-pointing arrows. + - `counter-arrow-l`: Left-pointing counter-arrows. + - `counter-arrow-r`: Right-pointing counter-arrows. + - `arrow-hyphen`: Arrows using hyphen-minus (`-`) as the rod. + - `arrow-equal`: Arrows using equal sign (`=`) as the rod. + - `arrow-wave`: Arrows using tilde (`~`) as the rod. + - `counter-arrow-hyphen`: Counter-arrows using hyphen-minus (`-`) as the rod. + - `counter-arrow-equal`: Counter-arrows using equal sign (`=`) as the rod. + - `counter-arrow-wave`: Counter-arrows using tilde (`~`) as the rod. + - `arrow-l-hyphen`: Left-pointing arrows with hyphen-minus (`-`) being the rod. + - `arrow-r-hyphen`: Right-pointing arrows with hyphen-minus (`-`) being the rod. + - `arrow-lr-hyphen`: Dual-pointing arrows with hyphen-minus (`-`) being the rod. + - `counter-arrow-l-hyphen`: Left-pointing counter-arrows with hyphen-minus (`-`) being the rod. + - `counter-arrow-r-hyphen`: Right-pointing counter-arrows with hyphen-minus (`-`) being the rod. + - `arrow-l-equal`: Left-pointing arrows with equal sign (`=`) being the rod. + - `arrow-r-equal`: Right-pointing arrows with equal sign (`=`) being the rod. + - `arrow-lr-equal`: Dual-pointing arrows with equal sign (`=`) being the rod. + - `counter-arrow-l-equal`: Left-pointing counter-arrows with equal sign (`=`) being the rod. + - `counter-arrow-r-equal`: Right-pointing counter-arrows with equal sign (`=`) being the rod. + - `arrow-l-wave`: Left-pointing arrows with tilde (`~`) being the rod. + - `arrow-r-wave`: Right-pointing arrows with tilde (`~`) being the rod. + - `arrow-lr-wave`: Dual-pointing arrows with tilde (`~`) being the rod. + - `counter-arrow-l-wave`: Left-pointing counter-arrows with tilde (`~`) being the rod. + - `counter-arrow-r-wave`: Right-pointing counter-arrows with tilde (`~`) being the rod. - `eqeqeq`: Enable special ligation for `===` with triple lines. - `eqeq`: Enable ligation for `==` and `===`. - `lteq`: Enable ligation for `<=` as less-than-or-equal sign. @@ -166,6 +175,7 @@ Subsection `ligations` is used to customize the ligation set assigned to `calt` - `tildeeq`: Enable ligation for `~=` as inequality. - `eqslasheq`: Enable special triple-line ligation for `=/=` as inequality. - `slasheq`: Enable ligation for `/=` and `=/=` as inequality. + - `trig`: Enable ligation for `<|`, `|>` , `<||`, and other bar-and-angle-bracket symbols. - `ltgt-ne`: Enable ligation for `<>` as inequality. - `ltgt-diamond`: Enable ligation for `<>` as diamond. - `ltgt-diamond-tag`: Enable ligation for `<>` as diamond-shaped empty HTML/XML tag. @@ -174,13 +184,17 @@ Subsection `ligations` is used to customize the ligation set assigned to `calt` - `slash-asterisk`: Shift asterisk in `/*` and `*/`. - `kern-dotty`: Move connecting dotty punctuations closer, like for `::`, `:::` and `...`. - `kern-bars`: Move consecutive bars closer, like for `||`, `|||` and `//`. - - `logic`: Enable ligation for `/\` and `\/`. - - `llgg`: Enable ligation for `<<`, `>>` and other angle-bracket chaining. - - `llggeq`: Enable ligation for `<<=`, `>>=` as shift operator. - - `html-comment`: Enable ligation for ` diff --git a/images/cs-block-latin-extended-d.dark.svg b/images/cs-block-latin-extended-d.dark.svg index 127b67666..13ca2836f 100644 --- a/images/cs-block-latin-extended-d.dark.svg +++ b/images/cs-block-latin-extended-d.dark.svg @@ -141,7 +141,7 @@ - + diff --git a/images/cs-block-latin-extended-d.light.svg b/images/cs-block-latin-extended-d.light.svg index 32d7813ca..27917e88b 100644 --- a/images/cs-block-latin-extended-d.light.svg +++ b/images/cs-block-latin-extended-d.light.svg @@ -141,7 +141,7 @@ - + diff --git a/packages/font-otl/src/gsub-ligation.ptl b/packages/font-otl/src/gsub-ligation.ptl index 8a4aa1120..bae99bb99 100644 --- a/packages/font-otl/src/gsub-ligation.ptl +++ b/packages/font-otl/src/gsub-ligation.ptl @@ -415,7 +415,6 @@ define [buildLigationsImpl gsub para $LigGroup$] : begin hyphen ~> [lsx 'cf'] LigGroup "Arrows" : begin - define singular : hyphen.concat anyWave define [CBarSingular k] : begin local hyphenSet : new Set hyphen local fHyphen : arrowBarX k @@ -427,9 +426,10 @@ define [buildLigationsImpl gsub para $LigGroup$] : begin if [hyphenSet.has x] hyphenResults.(j) waveResults.(j) define ArrowFormationConfig : list - # rod dbl ltgt FBarCls - list equal 1 1 arrowBarX - list singular 0 0 CBarSingular + # rod dbl ltgt FBarCls groupNameSuffix + list equal 1 1 arrowBarX 'equal' + list hyphen 0 0 CBarSingular 'hyphen' + list anyWave 0 0 CBarSingular 'wave' define ArrowExtensionConfig : list # rod FBarCls @@ -437,13 +437,13 @@ define [buildLigationsImpl gsub para $LigGroup$] : begin list hyphen arrowBarX list anyWave [lambda [k] [just "wave.lig.\(k)"]] - foreach [{rodCls dbl ltgt CRod} : items-of ArrowFormationConfig] : do + foreach [{rodCls dbl ltgt CRod groupNameSuffix} : items-of ArrowFormationConfig] : do define heads {} define rods {} - define doLT : [not ltgt] || [hasLG 'arrow-l'] && ![hasLG 'lteq'] && ![hasLG 'lteq-separate'] - define doLTAlt : [not ltgt] || [hasLG 'counter-arrow-l'] && ![hasLG 'eqlt'] && ![hasLG 'eqlt-separate'] - define doRT : [not ltgt] || [hasLG 'counter-arrow-r'] && ![hasLG 'gteq'] && ![hasLG 'gteq-separate'] + define doLT : [not ltgt] || [hasLG "arrow-l-\(groupNameSuffix)"] && ![hasLG 'lteq'] && ![hasLG 'lteq-separate'] + define doLTAlt : [not ltgt] || [hasLG "counter-arrow-l-\(groupNameSuffix)"] && ![hasLG 'eqlt'] && ![hasLG 'eqlt-separate'] + define doRT : [not ltgt] || [hasLG "counter-arrow-r-\(groupNameSuffix)"] && ![hasLG 'gteq'] && ![hasLG 'gteq-separate'] # Disable regular expression lookaheads heads.push : chain-rule @@ -471,21 +471,21 @@ define [buildLigationsImpl gsub para $LigGroup$] : begin define [CAntiHeadForce] : if dbl [lsx 'hole'] [lsx 'shift0.anti'] define [CAntiHeadForceShiftN1] : if dbl [lsx 'hole.shiftN1'] [lsx 'shiftN1.anti'] - define [LJoinHeadForce] : if [hasLG 'arrow-l'] [CJoinHeadForce] advance - define [LJoinHeadForceLR] : if [hasLG 'arrow-lr'] [CJoinHeadForce] advance - define [LJoinHeadForceShift1] : if [hasLG 'arrow-l'] [CJoinHeadForceShift1] advance - define [LJoinHeadForceShift1LR] : if [hasLG 'arrow-lr'] [CJoinHeadForce] advance - define [LMiddleHead] : if [hasLG 'counter-arrow-l'] [CJoinHeadMid] : if [hasLG 'arrow-l'] [LJoinHeadForce] advance - define [LAntiHeadForce] : if [hasLG 'counter-arrow-l'] [CAntiHeadForce] advance - define [LAntiHeadForceShiftN1] : if [hasLG 'counter-arrow-l'] [CAntiHeadForceShiftN1] advance + define [LJoinHeadForce] : if [hasLG "arrow-l-\(groupNameSuffix)"] [CJoinHeadForce] advance + define [LJoinHeadForceLR] : if [hasLG "arrow-lr-\(groupNameSuffix)"] [CJoinHeadForce] advance + define [LJoinHeadForceShift1] : if [hasLG "arrow-l-\(groupNameSuffix)"] [CJoinHeadForceShift1] advance + define [LJoinHeadForceShift1LR] : if [hasLG "arrow-lr-\(groupNameSuffix)"] [CJoinHeadForce] advance + define [LMiddleHead] : if [hasLG "counter-arrow-l-\(groupNameSuffix)"] [CJoinHeadMid] : if [hasLG "arrow-l-\(groupNameSuffix)"] [LJoinHeadForce] advance + define [LAntiHeadForce] : if [hasLG "counter-arrow-l-\(groupNameSuffix)"] [CAntiHeadForce] advance + define [LAntiHeadForceShiftN1] : if [hasLG "counter-arrow-l-\(groupNameSuffix)"] [CAntiHeadForceShiftN1] advance - define [RJoinHeadForce] : if [hasLG 'arrow-r'] [CJoinHeadForce] advance - define [RJoinHeadForceLR] : if [hasLG 'arrow-lr'] [CJoinHeadForce] advance - define [RJoinHeadForceShift1] : if [hasLG 'arrow-r'] [CJoinHeadForceShift1] advance - define [RJoinHeadForceShift1LR] : if [hasLG 'arrow-lr'] [CJoinHeadForce] advance - define [RMiddleHead] : if [hasLG 'counter-arrow-r'] [CJoinHeadMid] : if [hasLG 'arrow-r'] [RJoinHeadForce] advance - define [RAntiHeadForce] : if [hasLG 'counter-arrow-r'] [CAntiHeadForce] advance - define [RAntiHeadForceShiftN1] : if [hasLG 'counter-arrow-r'] [CAntiHeadForceShiftN1] advance + define [RJoinHeadForce] : if [hasLG "arrow-r-\(groupNameSuffix)"] [CJoinHeadForce] advance + define [RJoinHeadForceLR] : if [hasLG "arrow-lr-\(groupNameSuffix)"] [CJoinHeadForce] advance + define [RJoinHeadForceShift1] : if [hasLG "arrow-r-\(groupNameSuffix)"] [CJoinHeadForceShift1] advance + define [RJoinHeadForceShift1LR] : if [hasLG "arrow-lr-\(groupNameSuffix)"] [CJoinHeadForce] advance + define [RMiddleHead] : if [hasLG "counter-arrow-r-\(groupNameSuffix)"] [CJoinHeadMid] : if [hasLG "arrow-r-\(groupNameSuffix)"] [RJoinHeadForce] advance + define [RAntiHeadForce] : if [hasLG "counter-arrow-r-\(groupNameSuffix)"] [CAntiHeadForce] advance + define [RAntiHeadForceShiftN1] : if [hasLG "counter-arrow-r-\(groupNameSuffix)"] [CAntiHeadForceShiftN1] advance # Ambiguous define [LAntiHeadAmbig] : if doLTAlt [LAntiHeadForce] advance diff --git a/params/ligation-set.toml b/params/ligation-set.toml index 77834a1d9..3ed0fcd84 100644 --- a/params/ligation-set.toml +++ b/params/ligation-set.toml @@ -1,72 +1,72 @@ -[simple.center-ops] -samples = [":=", ":-", ":+", "<*", "<*>", "*>", "+:", "-:", "=:", "<***>", "<:", ":>", "*-", "-*", "*=", "=*", "*+", "+*"] -desc = 'Vertically align some of the operators (like `*`) to the center position it is before or after a "center" operator (like `+`)' +################################################################################################### +# The following section defines the fine-grained ligation set for the ligature font. +# The ligation builder code (font-otl/src/gsub-ligation.ptl) will be driven by these settings. -[simple.center-op-trigger-plus-minus-l] -samples = ["*+", "*-", ":+", ":-", ".+", ".-"] -desc = 'Plus (`+`) and Minus (`-`) will trigger other operator characters at left to be centered' +### Arrows -[simple.center-op-trigger-plus-minus-r] -samples = ["+*", "-*", "+:", "-:", "+.", "-."] -desc = 'Plus (`+`) and Minus (`-`) will trigger other operator characters at right to be centered' +[simple.arrow-l-hyphen] +samples = ["<--", "<---", "<<-", "<-", "<-->", "<--->", "<---->", "<-<"] +desc = 'Left-pointing arrows with hyphen-minus (`-`) being the rod' -[simple.center-op-trigger-equal-l] -samples = ["*=", ":=", ".="] -desc = 'Equal (`=`) will trigger other operator characters at left to be centered' +[simple.arrow-r-hyphen] +samples = ["->", "->>", "-->", "--->", "<-->", "<--->", "<---->", ">->"] +desc = 'Right-pointing arrows with hyphen-minus (`-`) being the rod' -[simple.center-op-trigger-equal-r] -samples = ["=*", "=:", "=."] -desc = 'Equal (`=`) will trigger other operator characters at right to be centered' +[simple.arrow-lr-hyphen] +samples = ["<->"] +desc = 'Dual-pointing arrows with hyphen-minus (`-`) being the rod' -[simple.center-op-trigger-bar-l] -samples = ["*|", ":|"] -desc = 'Bars (`|`) will trigger other operator characters at left to be centered' +[simple.counter-arrow-l-hyphen] +samples = ["-<<", "-<", "-<-", "-<<", "-<", "-<-"] +desc = 'Left-pointing counter-arrows with hyphen-minus (`-`) being the rod' -[simple.center-op-trigger-bar-r] -samples = ["|*", "|:"] -desc = 'Bars (`|`) will trigger other operator characters at right to be centered' - -[simple.center-op-trigger-angle-inside] -samples = ["<:", "<:>", ":>", "<*", "<*>", "*>", "<.", "<.>", ".>"] -desc = 'Less (`<`) and Greater (`>`) will trigger other operator characters at inside to be centered' - -[simple.center-op-trigger-angle-outside] -samples = [">*", "*<"] -desc = 'Less (`<`) and Greater (`>`) will trigger other operator characters at outside to be centered' - -[simple.center-op-influence-dot] -samples = ["<.", "<.>", ".>"] -desc = 'Treat dot (`.`) as operator and perform chained centering' - -[simple.center-op-influence-colon] -samples = ["<:", "<:>", ":>", ":=", "=:", ":-", "-:"] -desc = 'Treat colon (`:`) as operator and perform chained centering' +[simple.counter-arrow-r-hyphen] +samples = ["->-", ">-", ">>-", "->-", ">-", ">>-"] +desc = 'Right-pointing counter-arrows with hyphen-minus (`-`) being the rod' +[simple.arrow-l-equal] +samples = ["<==", "<===", "<<=", "<=", "<==>", "<===>", "<====>", "<=<"] +desc = 'Left-pointing arrows with equal sign (`=`) being the rod' -[simple.arrow-l] -samples = ["<--", "<---", "<<-", "<-", "<-->", "<--->", "<---->", "<=", "<==", "<===", "<<=", "<==>", "<===>", "<====>", "<~~", "<~", "<=<", "<-<"] -desc = 'Enable ligation set that forms left-pointing arrows' +[simple.arrow-r-equal] +samples = ["=>", "=>>", "==>", "===>", "<==>", "<===>", "<====>", ">=>"] +desc = 'Right-pointing arrows with equal sign (`=`) being the rod' -[simple.arrow-r] -samples = ["->", "->>", "-->", "--->", "<-->", "<--->", "<---->", "=>", "=>>", "==>", "===>", "<==>", "<===>", "<====>", "~>", "~~>", "-------->", ">=>", ">->"] -desc = 'Enable ligation set that forms right-pointing arrows' +[simple.arrow-lr-equal] +samples = ["<=>"] +desc = 'Dual-pointing arrows with equal sign (`=`) being the rod' -[simple.arrow-lr] -samples = ["<->", "<=>", "<~>"] -desc = 'Enable ligation set that forms dual-pointing arrows' +[simple.counter-arrow-l-equal] +samples = ["=<<", "=<", "=<=", "=<<", "=<", "=<="] +desc = 'Left-pointing counter-arrows with equal sign (`=`) being the rod' -[simple.counter-arrow-l] -samples = ["-<<", "-<", "-<-", "=<<", "=<", "=<=", "<=<", "-<<", "-<", "-<-", "=<<", "=<", "=<="] -desc = 'Enable ligation that produces left-pointing counter-arrows' +[simple.counter-arrow-r-equal] +samples = ["=>=", ">=", ">>=", "=>=", ">=", ">>="] +desc = 'Right-pointing counter-arrows with equal sign (`=`) being the rod' -[simple.counter-arrow-r] -samples = ["->-", ">-", ">>-", "=>=", ">=>", "->-", ">-", ">>-", ">>=", "=>="] -desc = 'Enable ligation that produces right-pointing counter-arrows' -[simple.trig] -samples = ["<|", "<|>", "|>"] -desc = 'Enable ligation for `<|`, `|>` , `<||`, and other bar-and-angle-bracket symbols' +[simple.arrow-l-wave] +samples = ["<~~", "<~~~", "<<~", "<~", "<~~>", "<~~~>", "<~~~~>", "<~<"] +desc = 'Left-pointing arrows with tilde (`~`) being the rod' + +[simple.arrow-r-wave] +samples = ["~>", "~>>", "~~>", "~~~>", "<~~>", "<~~~>", "<~~~~>", ">~>"] +desc = 'Right-pointing arrows with tilde (`~`) being the rod' + +[simple.arrow-lr-wave] +samples = ["<~>"] +desc = 'Dual-pointing arrows with tilde (`~`) being the rod' + +[simple.counter-arrow-l-wave] +samples = ["~<<", "~<", "~<~", "~<<", "~<", "~<~"] +desc = 'Left-pointing counter-arrows with tilde (`~`) being the rod' + +[simple.counter-arrow-r-wave] +samples = ["~>~", ">~", ">>~", "~>~", ">~", ">>~"] +desc = 'Right-pointing counter-arrows with tilde (`~`) being the rod' + +### Equality and Inequality [simple.eqeqeq] samples = ["==="] @@ -142,6 +142,12 @@ desc = 'Enable special triple-line ligation for `=/=` as inequality' samples = ["/=", "=/="] desc = 'Enable ligation for `/=` and `=/=` as inequality' +### Triangles and Diamonds + +[simple.trig] +samples = ["<|", "<|>", "|>"] +desc = 'Enable ligation for `<|`, `|>` , `<||`, and other bar-and-angle-bracket symbols' + [simple.ltgt-ne] samples = ["<>"] sampleRank = 2 @@ -161,6 +167,8 @@ samples = ["", ""] sampleRank = 2 desc = 'Enable ligation for `` and ``' +### Comment symbols + [simple.brst] samples = ["(*", "*)", "(* comm *)"] desc = 'Center asterisk in `(*` and `*)`' @@ -169,6 +177,8 @@ desc = 'Center asterisk in `(*` and `*)`' samples = ["/*", "*/", "/* comm */"] desc = 'Shift asterisk in `/*` and `*/`' +### Distance arrangement + [simple.kern-dotty] samples = ["::", ":::"] desc = 'Move connecting dotty punctuations closer, like for `::`, `:::` and `...`' @@ -177,37 +187,54 @@ desc = 'Move connecting dotty punctuations closer, like for `::`, `:::` and `... samples = ["||", "|||"] desc = 'Move consecutive bars closer, like for `||`, `|||` and `//`' -[simple.logic] -samples = ["/\\", "\\/", "|-", "-|"] -desc = 'Enable ligation for `/\` and `\/`' +### Operator Centering -[simple.llgg] -samples = ["<<", ">>", "<<<", ">>>"] -desc = 'Enable ligation for `<<`, `>>` and other angle-bracket chaining' +[simple.center-ops] +samples = [":=", ":-", ":+", "<*", "<*>", "*>", "+:", "-:", "=:", "<***>", "<:", ":>", "*-", "-*", "*=", "=*", "*+", "+*"] +desc = 'Vertically align some of the operators (like `*`) to the center position it is before or after a "center" operator (like `+`)' -[simple.llggeq] -samples = ["<<=", ">>="] -sampleRank = 2 -desc = 'Enable ligation for `<<=`, `>>=` as shift operator' +[simple.center-op-trigger-plus-minus-l] +samples = ["*+", "*-", ":+", ":-", ".+", ".-"] +desc = 'Plus (`+`) and Minus (`-`) will trigger other operator characters at left to be centered' -[simple.html-comment] -samples = ["