Enforce lookup order of CV/SS
This commit is contained in:
parent
ca3f0b9396
commit
ec1cae38a7
1 changed files with 24 additions and 17 deletions
|
@ -11,6 +11,7 @@ export : define [buildCVSS sink para glyphStore] : begin
|
||||||
|
|
||||||
local rec : BeginLookupBlock sink
|
local rec : BeginLookupBlock sink
|
||||||
local cvLookupNameSet : new Set
|
local cvLookupNameSet : new Set
|
||||||
|
local ssLookupNameSet : new Set
|
||||||
|
|
||||||
# Decomposition of enclosures
|
# Decomposition of enclosures
|
||||||
define decompositions {.}
|
define decompositions {.}
|
||||||
|
@ -22,19 +23,23 @@ export : define [buildCVSS sink para glyphStore] : begin
|
||||||
.type 'gsub_multiple'
|
.type 'gsub_multiple'
|
||||||
.substitutions decompositions
|
.substitutions decompositions
|
||||||
|
|
||||||
|
define [addFeatureAndLookup tag lookupName init] : begin
|
||||||
|
define feature : pick-feature sink [FeatureName tag]
|
||||||
|
add-common-feature sink feature
|
||||||
|
|
||||||
|
define lookup : pick-lookup sink lookupName init
|
||||||
|
add-feature-lookup feature lookupNameCvDecompose
|
||||||
|
add-feature-lookup feature lookupName
|
||||||
|
sink.lookupDep.push { lookupNameCvDecompose lookupName }
|
||||||
|
cvLookupNameSet.add lookupName
|
||||||
|
|
||||||
|
|
||||||
# cvxx
|
# cvxx
|
||||||
foreach {gn glyph} [glyphStore.namedEntries] : if [not : CvDecompose.get glyph] : do
|
foreach {gn glyph} [glyphStore.namedEntries] : if [not : CvDecompose.get glyph] : do
|
||||||
foreach [gr : items-of : AnyCv.query glyph] : if gr.tag : begin
|
foreach [gr : items-of : AnyCv.query glyph] : if gr.tag : begin
|
||||||
local lookupName : CvLookupName gr.tag
|
define lookupName : CvLookupName gr.tag
|
||||||
if [not : cvLookupNameSet.has lookupName] : begin
|
if [not : cvLookupNameSet.has lookupName] : begin
|
||||||
local feature : pick-feature sink [FeatureName gr.tag]
|
addFeatureAndLookup gr.tag lookupName {.type 'gsub_alternate' .substitutions {.}}
|
||||||
add-common-feature sink feature
|
|
||||||
|
|
||||||
local lookup : pick-lookup sink lookupName
|
|
||||||
begin {.type 'gsub_alternate' .substitutions {.}}
|
|
||||||
add-feature-lookup feature lookupNameCvDecompose
|
|
||||||
add-feature-lookup feature lookupName
|
|
||||||
sink.lookupDep.push { lookupNameCvDecompose lookupName }
|
|
||||||
cvLookupNameSet.add lookupName
|
cvLookupNameSet.add lookupName
|
||||||
|
|
||||||
local st [pick-lookup sink lookupName].substitutions
|
local st [pick-lookup sink lookupName].substitutions
|
||||||
|
@ -43,15 +48,13 @@ export : define [buildCVSS sink para glyphStore] : begin
|
||||||
|
|
||||||
# ssxx
|
# ssxx
|
||||||
foreach {name composition} para.variants.composites : if composition.tag : do
|
foreach {name composition} para.variants.composites : if composition.tag : do
|
||||||
local feature : pick-feature sink [FeatureName composition.tag]
|
define lookupName : SsLookupName composition.tag
|
||||||
add-common-feature sink feature
|
if [not : ssLookupNameSet.has lookupName] : begin
|
||||||
add-feature-lookup feature lookupNameCvDecompose
|
addFeatureAndLookup composition.tag lookupName {.type 'gsub_single' .substitutions {.}}
|
||||||
local lookupNameSub : add-lookup sink {.type 'gsub_single' .substitutions {.}}
|
cvLookupNameSet.add lookupName
|
||||||
sink.lookupDep.push { lookupNameCvDecompose lookupNameSub }
|
|
||||||
add-feature-lookup feature lookupNameSub
|
|
||||||
|
|
||||||
define st [pick-lookup sink lookupNameSub].substitutions
|
define st [pick-lookup sink lookupName].substitutions
|
||||||
local decomp : composition.decompose para para.variants.selectorTree
|
define decomp : composition.decompose para para.variants.selectorTree
|
||||||
foreach { prime pv } [items-of decomp] : if (pv.tag && pv.rank) : begin
|
foreach { prime pv } [items-of decomp] : if (pv.tag && pv.rank) : begin
|
||||||
local gr : Cv pv.tag pv.rank
|
local gr : Cv pv.tag pv.rank
|
||||||
foreach {gn glyph} [glyphStore.namedEntries] : if [not : CvDecompose.get glyph] : begin
|
foreach {gn glyph} [glyphStore.namedEntries] : if [not : CvDecompose.get glyph] : begin
|
||||||
|
@ -64,4 +67,8 @@ export : define [buildCVSS sink para glyphStore] : begin
|
||||||
foreach { k v } [pairs-of st] : foreach idx [range 0 v.length] : if [not v.(idx)]
|
foreach { k v } [pairs-of st] : foreach idx [range 0 v.length] : if [not v.(idx)]
|
||||||
set v.(idx) k
|
set v.(idx) k
|
||||||
|
|
||||||
|
# Lookup dependency
|
||||||
|
foreach lutnCv cvLookupNameSet : foreach lutnSS ssLookupNameSet : begin
|
||||||
|
sink.lookupDep.push { lutnCv lutnSS }
|
||||||
|
|
||||||
EndLookupBlock rec sink
|
EndLookupBlock rec sink
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue