diff --git a/Lib/fontTools/feaLib/builder.py b/Lib/fontTools/feaLib/builder.py index 342327be7..a44a89b5b 100644 --- a/Lib/fontTools/feaLib/builder.py +++ b/Lib/fontTools/feaLib/builder.py @@ -1049,11 +1049,13 @@ class Builder(object): def add_ligatureCaretByIndex_(self, location, glyphs, carets): for glyph in glyphs: - self.ligCaretPoints_.setdefault(glyph, set()).update(carets) + if glyph not in self.ligCaretPoints_: + self.ligCaretPoints_[glyph] = carets def add_ligatureCaretByPos_(self, location, glyphs, carets): for glyph in glyphs: - self.ligCaretCoords_.setdefault(glyph, set()).update(carets) + if glyph not in self.ligCaretCoords_: + self.ligCaretCoords_[glyph] = carets def add_name_record(self, location, nameID, platformID, platEncID, langID, string): diff --git a/Tests/feaLib/data/LigatureCaretByIndex.fea b/Tests/feaLib/data/LigatureCaretByIndex.fea index 19681724a..5f74fc641 100644 --- a/Tests/feaLib/data/LigatureCaretByIndex.fea +++ b/Tests/feaLib/data/LigatureCaretByIndex.fea @@ -1,10 +1,6 @@ table GDEF { LigatureCaretByIndex [c_t s_t] 11; - # The OpenType Feature File specification does not define what should - # happen when there are multiple LigatureCaretByIndex statements for - # the same glyph. Our behavior matches that of Adobe makeotf v2.0.90. - # https://github.com/adobe-type-tools/afdko/issues/95 LigatureCaretByIndex o_f_f_i 66 33; LigatureCaretByIndex o_f_f_i 55; } GDEF; diff --git a/Tests/feaLib/data/LigatureCaretByIndex.ttx b/Tests/feaLib/data/LigatureCaretByIndex.ttx index a75807728..f3a378c94 100644 --- a/Tests/feaLib/data/LigatureCaretByIndex.ttx +++ b/Tests/feaLib/data/LigatureCaretByIndex.ttx @@ -17,14 +17,11 @@ - + - - - diff --git a/Tests/feaLib/data/LigatureCaretByPos.fea b/Tests/feaLib/data/LigatureCaretByPos.fea index a8ccf6f98..e799c3c2a 100644 --- a/Tests/feaLib/data/LigatureCaretByPos.fea +++ b/Tests/feaLib/data/LigatureCaretByPos.fea @@ -1,10 +1,6 @@ table GDEF { LigatureCaretByPos [c_h c_k] 500; - # The OpenType Feature File specification does not define what should - # happen when there are multiple LigatureCaretByPos statements for - # the same glyph. Our behavior matches that of Adobe makeotf v2.0.90. - # https://github.com/adobe-type-tools/afdko/issues/95 LigatureCaretByPos o_f_f_i 700 300; LigatureCaretByPos o_f_f_i 900; } GDEF; diff --git a/Tests/feaLib/data/LigatureCaretByPos.ttx b/Tests/feaLib/data/LigatureCaretByPos.ttx index 911db6b26..8c0bf8cb8 100644 --- a/Tests/feaLib/data/LigatureCaretByPos.ttx +++ b/Tests/feaLib/data/LigatureCaretByPos.ttx @@ -23,16 +23,13 @@ - + - - -