-------- Forwarded Message --------
Subject: Re: [NTG-context] Kerning feature not working
Date: Wed, 30 Aug 2023 22:17:43 +0200
From: Hans Hagen <j.ha...@xs4all.nl>
To: Marcus Vinicius Mesquita <marcusvinicius.mesqu...@gmail.com>

On 8/30/2023 9:37 PM, Marcus Vinicius Mesquita wrote:
Dear List

In the MWE below, the kerning feature works OK for ebgaramonditalic
but not for ebgaramondregular.
How do I fix it?

I'm using ConTeXt version: 2023.08.27 13:48


\startluacode
     fonts.handlers.otf.addfeature {
         name = "kernit",
         type = "kern",
        nocheck = true,
         data = {
           [0x27E8] = { ["f"] = 300, ["fi"] = 300, ["fl"] = 300 }
         }
     }
\stopluacode

you need to know the code points and eb garamond is not so predictable (welcome to fonts ...)

\startluacode
    fonts.handlers.otf.addfeature {
        name = "kernit",
        type = "kern",
     nocheck = true,
        data = {
          [0x27E8] = {
                ["f"]    = 300,
                ["f_l"]  = 300,
                ["f_i"]  = 300,
                [0xFB01] = 300,
                [0xFB02] = 300,
            }
        }
    }
\stopluacode

\definefontfeature[kernit][mode=node,kernit=yes]

\starttext
\definedfont[name:ebgaramondregular*default,kernit]

⟨f ile

⟨f lame

⟨file

⟨flame

\definedfont[name:ebgaramonditalic*default,kernit]

⟨f ile

⟨f lame

⟨file

⟨flame

\stoptext
but easier is this (an old mechanism, maybe time for an upgrade with merged vectors)

\definecharacterspacing [myspacing]

\setupcharacterspacing [myspacing] ["27E8] [right=0.25,alternative=1]
\setupcharacterspacing [myspacing] ["27E9] [left=0.25,alternative=1]

and then

\setcharacterspacing[myspacing]


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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

Reply via email to