From 436a18a1bfdb2c49e7c958641e71a010133d4a31 Mon Sep 17 00:00:00 2001 From: be5invis Date: Thu, 3 Jun 2021 20:19:24 -0700 Subject: [PATCH] Add join suffix for NEQ ligatures (#1007) --- font-src/glyphs/symbol/ligation.ptl | 77 +++++++++++++++---- .../punctuation/slashes-and-number-sign.ptl | 4 + font-src/otl/gsub-ligation.ptl | 34 ++++---- 3 files changed, 82 insertions(+), 33 deletions(-) diff --git a/font-src/glyphs/symbol/ligation.ptl b/font-src/glyphs/symbol/ligation.ptl index aee1f13c1..88a7b0fce 100644 --- a/font-src/glyphs/symbol/ligation.ptl +++ b/font-src/glyphs/symbol/ligation.ptl @@ -233,13 +233,14 @@ glyph-block Symbol-Ligation : begin EqualHole Width create-glyph 'equal.fc+cc' : glyph-proc - Joining.set currentGlyph Joining.Classes.Right + Joining.set currentGlyph Joining.Classes.Mid include : difference EqualShape (SB - Width) (Width - joiningOverlap) EqualHole 0 EqualHole Width create-glyph 'equal.fc+cf' : glyph-proc + Joining.set currentGlyph Joining.Classes.Left include : difference EqualShape (SB - Width) RightSB EqualHole 0 @@ -277,13 +278,14 @@ glyph-block Symbol-Ligation : begin IdentHole Width create-glyph 'ident.fc+cc' : glyph-proc - Joining.set currentGlyph Joining.Classes.Right + 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 @@ -297,14 +299,17 @@ glyph-block Symbol-Ligation : begin glyph-block-import NotGlyphFn : notGlyph - define [slash t b l r sw sh] : dispiro - widths.center OperatorStroke - flat (sh + l) b - curl (sh + r) t + define [slash jk] : function [t b l r sw sh] : glyph-proc + Joining.set currentGlyph jk + include : dispiro + widths.center OperatorStroke + flat (sh + l) b + curl (sh + r) t - define [exSlash2 t b l r sw sh] : begin + define [exSlash2 jk] : function [t b l r sw sh] : glyph-proc local dr : PeriodRadius / Stroke * OperatorStroke - union + Joining.set currentGlyph jk + include : union DotAt (sh + l + dr * (r - l) / (t - b)) (b + dr) dr intersection Rect (SymbolMid + t) [Math.min (b + dr * 3.5) (SymbolMid - EqualHalfSpace)] (-Width * 4) (Width * 4) @@ -313,15 +318,55 @@ glyph-block Symbol-Ligation : begin flat (sh + l) b curl (sh + r) t - notGlyph.generic 'neq.1' null 'sp1' (shift -- (Width * 0.0)) (F -- slash) - notGlyph.generic 'neq.2' null 'sp1' (shift -- (Width * 0.5)) (F -- slash) - notGlyph.generic 'neq.3' null 'sp1' (shift -- (Width * 1.0)) (F -- slash) - notGlyph.generic 'neq.4' null 'sp1' (shift -- (Width * 1.5)) (F -- slash) + notGlyph.generic 'neq.1l' null 'sp1' + shift -- (Width * 0.0) + F -- [slash Joining.Classes.Right] + notGlyph.generic 'neq.2l' null 'sp1' + shift -- (Width * 0.5) + F -- [slash Joining.Classes.Right] + notGlyph.generic 'neq.3l' null 'sp1' + shift -- (Width * 1.0) + F -- [slash Joining.Classes.Right] + notGlyph.generic 'neq.4l' null 'sp1' + shift -- (Width * 1.5) + F -- [slash Joining.Classes.Right] + notGlyph.generic 'neq.1m' null 'sp1' + shift -- (Width * 0.0) + F -- [slash Joining.Classes.Mid] + notGlyph.generic 'neq.2m' null 'sp1' + shift -- (Width * 0.5) + F -- [slash Joining.Classes.Mid] + notGlyph.generic 'neq.3m' null 'sp1' + shift -- (Width * 1.0) + F -- [slash Joining.Classes.Mid] + notGlyph.generic 'neq.4m' null 'sp1' + shift -- (Width * 1.5) + F -- [slash Joining.Classes.Mid] - notGlyph.generic 'neq.1-dotted' null 'sp1' (shift -- (Width * 0.0)) (F -- exSlash2) - notGlyph.generic 'neq.2-dotted' null 'sp1' (shift -- (Width * 0.5)) (F -- exSlash2) - notGlyph.generic 'neq.3-dotted' null 'sp1' (shift -- (Width * 1.0)) (F -- exSlash2) - notGlyph.generic 'neq.4-dotted' null 'sp1' (shift -- (Width * 1.5)) (F -- exSlash2) + notGlyph.generic 'neq.1l-dotted' null 'sp1' + shift -- (Width * 0.0) + F -- [exSlash2 Joining.Classes.Right] + notGlyph.generic 'neq.2l-dotted' null 'sp1' + shift -- (Width * 0.5) + F -- [exSlash2 Joining.Classes.Right] + notGlyph.generic 'neq.3l-dotted' null 'sp1' + shift -- (Width * 1.0) + F -- [exSlash2 Joining.Classes.Right] + notGlyph.generic 'neq.4l-dotted' null 'sp1' + shift -- (Width * 1.5) + F -- [exSlash2 Joining.Classes.Right] + notGlyph.generic 'neq.1m-dotted' null 'sp1' + shift -- (Width * 0.0) + F -- [exSlash2 Joining.Classes.Mid] + notGlyph.generic 'neq.2m-dotted' null 'sp1' + shift -- (Width * 0.5) + F -- [exSlash2 Joining.Classes.Mid] + notGlyph.generic 'neq.3m-dotted' null 'sp1' + shift -- (Width * 1.0) + F -- [exSlash2 Joining.Classes.Mid] + notGlyph.generic 'neq.4m-dotted' null 'sp1' + shift -- (Width * 1.5) + F -- [exSlash2 Joining.Classes.Mid] do "<| , |> and <>" glyph-block-import Symbol-Math-Relation-Inequality : LessShape GreaterShape diff --git a/font-src/glyphs/symbol/punctuation/slashes-and-number-sign.ptl b/font-src/glyphs/symbol/punctuation/slashes-and-number-sign.ptl index dd835f94e..851521613 100644 --- a/font-src/glyphs/symbol/punctuation/slashes-and-number-sign.ptl +++ b/font-src/glyphs/symbol/punctuation/slashes-and-number-sign.ptl @@ -37,9 +37,11 @@ glyph-block Symbol-Punctuation-Slashes-And-Number-Sign : begin include : SlashShape (slashDefautLeft + b) (slashDefaultRight + b) nothing nothing w create-glyph 'slash.left' : glyph-proc + Joining.set currentGlyph Joining.Classes.Right include : SlashShape slashDefautLeft Width create-glyph 'slash.right' : glyph-proc + Joining.set currentGlyph Joining.Classes.Left include : SlashShape 0 slashDefaultRight local backslashWidth : (slashDefaultRight - slashDefautLeft) * (1 + TanSlope * 2) @@ -57,9 +59,11 @@ glyph-block Symbol-Punctuation-Slashes-And-Number-Sign : begin alias 'mathBackslash' 0x2216 'backslash' create-glyph 'backslash.left' : glyph-proc + Joining.set currentGlyph Joining.Classes.Right include : BackslashShape (Middle - backslashWidth / 2) Width create-glyph 'backslash.right' : glyph-proc + Joining.set currentGlyph Joining.Classes.Left include : BackslashShape 0 (Middle + backslashWidth / 2) do "number sign" diff --git a/font-src/otl/gsub-ligation.ptl b/font-src/otl/gsub-ligation.ptl index c85503b66..68099c785 100644 --- a/font-src/otl/gsub-ligation.ptl +++ b/font-src/otl/gsub-ligation.ptl @@ -724,19 +724,19 @@ define [buildLigationsImpl sink para featureName mappedFeature rankedLookups] : piecewise [hasLG 'eqexeq-dotted'] : chain-rule equal ~> {'ident.fc'} - exclam ~> {'neq.1-dotted'} + exclam ~> {'neq.1m-dotted'} equal ~> {'ident.cc+cf'} [hasLG 'eqexeq'] : chain-rule equal ~> {'ident.fc'} - exclam ~> {'neq.1'} + exclam ~> {'neq.1m'} equal ~> {'ident.cc+cf'} [hasLG 'eqexeq-dl-dotted'] : chain-rule equal ~> {'equal.fc'} - exclam ~> {'neq.1-dotted'} + exclam ~> {'neq.1m-dotted'} equal ~> {'equal.cc+cf'} [hasLG 'eqexeq-dl'] : chain-rule equal ~> {'equal.fc'} - exclam ~> {'neq.1'} + exclam ~> {'neq.1m'} equal ~> {'equal.cc+cf'} true : chain-rule AnyEqualEnding ~> look-around @@ -744,12 +744,12 @@ define [buildLigationsImpl sink para featureName mappedFeature rankedLookups] : equal ~> look-around piecewise [hasLG 'exeq-dotted'] : chain-rule - exclam ~> {'neq.4-dotted'} + exclam ~> {'neq.4l-dotted'} equal ~> {'equal.fc+cc'} equal ~> {'equal.cc'} equal ~> {'equal.cf'} [hasLG 'exeq'] : chain-rule - exclam ~> {'neq.4'} + exclam ~> {'neq.4l'} equal ~> {'equal.fc+cc'} equal ~> {'equal.cc'} equal ~> {'equal.cf'} @@ -761,29 +761,29 @@ define [buildLigationsImpl sink para featureName mappedFeature rankedLookups] : equal ~> {'equal.cf'} piecewise [hasLG 'exeqeq-dotted'] : chain-rule - exclam ~> {'neq.3-dotted'} + exclam ~> {'neq.3l-dotted'} equal ~> {'ident.fc+cc'} equal ~> {'ident.cf'} [hasLG 'exeqeq'] : chain-rule - exclam ~> {'neq.3'} + exclam ~> {'neq.3l'} equal ~> {'ident.fc+cc'} equal ~> {'ident.cf'} [hasLG 'exeq-dotted'] : chain-rule - exclam ~> {'neq.3-dotted'} + exclam ~> {'neq.3l-dotted'} equal ~> {'equal.fc+cc'} equal ~> {'equal.cf'} [hasLG 'exeq'] : chain-rule - exclam ~> {'neq.3'} + exclam ~> {'neq.3l'} equal ~> {'equal.fc+cc'} equal ~> {'equal.cf'} piecewise [hasLG 'eqslasheq'] : chain-rule equal ~> {'ident.fc'} - slash ~> {'neq.1'} + slash ~> {'neq.1m'} equal ~> {'ident.cc+cf'} [hasLG 'slasheq'] : chain-rule equal ~> {'equal.fc'} - slash ~> {'neq.1'} + slash ~> {'neq.1m'} equal ~> {'equal.cc+cf'} piecewise [hasLG 'eqeqeq'] : chain-rule @@ -792,25 +792,25 @@ define [buildLigationsImpl sink para featureName mappedFeature rankedLookups] : equal ~> {'ident.cf'} piecewise [hasLG 'tildeeq'] : chain-rule - anyWave ~> [just 'neq.2'] + anyWave ~> [just 'neq.2l'] equal ~> {'equal.fc+cf'} piecewise [hasLG 'slasheq'] : chain-rule - slash ~> {'neq.2'} + slash ~> {'neq.2l'} equal ~> {'equal.fc+cf'} piecewise [hasLG 'exeq-dotted'] : chain-rule - exclam ~> {'neq.2-dotted'} + exclam ~> {'neq.2l-dotted'} equal ~> {'equal.fc+cf'} [hasLG 'exeq'] : chain-rule - exclam ~> {'neq.2'} + exclam ~> {'neq.2l'} equal ~> {'equal.fc+cf'} piecewise [hasLG 'ltgt-diamond'] : chain-rule lessAndEquiv ~> [just 'less.lig.diamond'] greaterAndEquiv ~> [just 'greater.lig.diamond'] [hasLG 'ltgt-ne'] : chain-rule - lessAndEquiv ~> [just 'neq.2'] + lessAndEquiv ~> [just 'neq.2l'] greaterAndEquiv ~> [just 'equal.fc+cf'] piecewise [hasLG 'eqeq'] : chain-rule