ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Bruce Horrocks via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Bruce Horrocks <ntg@scorecrow.com>
Subject: Re: Contextual removal of some ligatures using fonts.handlers.otf.addfeature (LuaTeX 1.13.2)
Date: Fri, 24 Dec 2021 23:04:51 +0000	[thread overview]
Message-ID: <3AD2C1F1-EAAA-48F6-94FE-45493BD0CF6A@scorecrow.com> (raw)
In-Reply-To: <3718224.1odTDXuOTV@debian>



> 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
___________________________________________________________________________________

  reply	other threads:[~2021-12-24 23:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-24 18:34 Thomas Savary via ntg-context
2021-12-24 23:04 ` Bruce Horrocks via ntg-context [this message]
2021-12-25 11:00   ` Hans Hagen via ntg-context
2021-12-25 11:35   ` Hans Hagen via ntg-context
2021-12-25 22:52   ` Thomas Savary via ntg-context
2021-12-26 12:52     ` Hans Hagen via ntg-context
2021-12-27 20:27       ` Thomas Savary via ntg-context
2021-12-27 23:01         ` (No subject header) Hans Hagen via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3AD2C1F1-EAAA-48F6-94FE-45493BD0CF6A@scorecrow.com \
    --to=ntg-context@ntg.nl \
    --cc=ntg@scorecrow.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).