Fix shape of y-ogonek (used by Elfdalian) (#1437).

This commit is contained in:
be5invis 2022-10-29 14:57:01 -07:00
parent 0c9b46ac9b
commit b3b7646f5b
7 changed files with 70 additions and 125 deletions

View file

@ -1,5 +1,5 @@
import [AddCommonFeature AddFeature AddLookup AddFeatureLookup ChainRuleBuilder BeginLookupBlock EndLookupBlock UkMapToLookup UkMap2ToLookup] from"./table-util.mjs"
import [AnyCv Dotless TieMark TieGlyph CcmpDecompose] from"../support/gr.mjs"
import [AnyCv Dotless TieMark TieGlyph CcmpDecompose OgonekTrY] from"../support/gr.mjs"
import as UnicodeKnowledge from"../meta/unicode-knowledge.mjs"
extern Set
@ -234,22 +234,32 @@ export : define [buildCCMPPostCvSs sink ccmpFeature glyphStore markGlyphs] : beg
define ccmp : AddFeature sink 'ccmp'
define {chain-rule} : ChainRuleBuilder sink
define groupTR {}
define triggerGlyphs_Normal { }
define triggerGlyphs_Y { }
foreach { gid g } [glyphStore.namedEntries] : if (gid.(0) !== "."): begin
if g.baseAnchors.trailing : groupTR.push gid
if g.baseAnchors.trailing : piecewise
[OgonekTrY.get g] : triggerGlyphs_Y.push gid
true : triggerGlyphs_Normal.push gid
define [OgonekTrailing] : UkMapToLookup UnicodeKnowledge.ogonekBelowToTRTf
define [markTransform_Normal] : UkMapToLookup UnicodeKnowledge.ogonekBelowToTRTf
define [markTransform_Y] : UkMapToLookup UnicodeKnowledge.ogonekBelowToTRTf_Y
define [pushTransforms sink triggers tf] : begin
sink.push : chain-rule triggers [tf]
sink.push : chain-rule triggers markGlyphs.all [tf]
sink.push : chain-rule triggers markGlyphs.all markGlyphs.all [tf]
sink.push : chain-rule triggers markGlyphs.all markGlyphs.all markGlyphs.all [tf]
sink.push : chain-rule triggers markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all [tf]
sink.push : chain-rule triggers markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all [tf]
sink.push : chain-rule triggers markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all [tf]
define ogonekTransforms {}
pushTransforms ogonekTransforms triggerGlyphs_Normal markTransform_Normal
pushTransforms ogonekTransforms triggerGlyphs_Y markTransform_Y
define lookupMarks1 : AddLookup sink : object
.type 'gsub_chaining'
.rules : list
# Ogonek transform (max 6 middle marks are supported)
chain-rule groupTR [OgonekTrailing]
chain-rule groupTR markGlyphs.all [OgonekTrailing]
chain-rule groupTR markGlyphs.all markGlyphs.all [OgonekTrailing]
chain-rule groupTR markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all [OgonekTrailing]
chain-rule groupTR markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all [OgonekTrailing]
chain-rule groupTR markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all [OgonekTrailing]
.rules ogonekTransforms
ccmpFeature.lookups.push lookupMarks1
EndLookupBlock rec sink