ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Fwd: Kerning feature not working
Date: Wed, 30 Aug 2023 22:18:07 +0200	[thread overview]
Message-ID: <51ee3842-776d-1af9-dfd8-72055e95a0a4@xs4all.nl> (raw)
In-Reply-To: <124e4572-c4ae-0272-2416-511a6b9329d0@xs4all.nl>




-------- Forwarded Message --------
Subject: Re: [NTG-context] Kerning feature not working
Date: Wed, 30 Aug 2023 22:17:43 +0200
From: Hans Hagen <j.hagen@xs4all.nl>
To: Marcus Vinicius Mesquita <marcusvinicius.mesquita@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	other threads:[~2023-08-30 20:20 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <124e4572-c4ae-0272-2416-511a6b9329d0@xs4all.nl>]

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=51ee3842-776d-1af9-dfd8-72055e95a0a4@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=ntg-context@ntg.nl \
    /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).