> On 24 Dec 2021, at 18:34, Thomas Savary via ntg-context <ntg-context@ntg.nl> > wrote: > > Hello, dear list ! > > In order to fix a few bugs in some OpenType features included in EB Garamond > font provided by Google Fonts, I am trying to remove some ligatures > (erroneous in some contexts) with fonts.handlers.otf.addfeature. > > I must be missing something, because I can't get it to work. > > Here is a minimal —non working—example :-) > (The attempted removal (“f_i” → “fi” only before “o”) is of course > irrelevant. I chose it just for the sole purpose of this test, to provide a > simple example. What I am trying to achieve is more complex, with other > ligatures.) > > fonts.handlers.otf.addfeature{ > name = "unfio", > type = "chainsubstitution", > lookups = { > { type = "multiple", > data = { [ "f_i" ] = { "f", "i" } } > } > } > rules = { > { after = { { "o" } }, > current = { { "f_i" } }, > lookups = { 1 } } > } > } > } > > Could someone please explain to me what I did wrong ?
Firstly, you have an extra } in the example above. Secondly, rules need to come inside a data section. Thus (untested): fonts.handlers.otf.addfeature{ name = "unfio", type = "chainsubstitution", lookups = { { type = "substitution", data = { [ "f_i" ] = { "f", "i" } } } }, data = { rules = { { after = { { "o" } }, current = { { "f_i" } }, lookups = { 1 } } } } } Regards, — Bruce Horrocks Hampshire, UK ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________