On 12/25/2021 12:04 AM, Bruce Horrocks via ntg-context wrote:


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 }
             }
         }
     }
}
the problem with this approach is that in a feature rich font like eb you never know where to kick this into the sequence and you even don't know how many variants of fi ligatures are there

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to