Fix frac feature for better recognizing fraction patterns (#2214).

This commit is contained in:
be5invis 2024-02-26 18:05:52 -08:00
parent bcb50d4681
commit d076cf8320
3 changed files with 34 additions and 57 deletions

View file

@ -9,10 +9,6 @@ export : define [buildFrac gsub glyphStore] : begin
define frac : gsub.addCommonFeature : gsub.createFeature 'frac'
define { chain-rule reverse-rule } : gsub.ChainRuleBuilder
define subSolidus : gsub.createLookup : object
.type 'gsub_single'
.substitutions : object ['solidus' 'fractionBar'] ['slash' 'fractionBar']
define digitSet { }
define numSet { }
define denSet { }
@ -25,6 +21,11 @@ export : define [buildFrac gsub glyphStore] : begin
numSet.push numForm
denSet.push denForm
define subSolidus : gsub.createLookup : object
.type 'gsub_chaining'
.rules : list
chain-rule digitSet ({'solidus' 'slash'} ~> {'fractionBar' 'fractionBar'}) digitSet
define subDen : gsub.createLookup : object
.type 'gsub_chaining'
.rules : list