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>,
	"Michal Vlasák" <lahcim8@gmail.com>
Subject: Re: nuts.setfield is nil in generic code
Date: Thu, 8 Jul 2021 23:08:10 +0200	[thread overview]
Message-ID: <7e0765dd-5dab-babf-68e9-325f04efbf23@xs4all.nl> (raw)
In-Reply-To: <CCNTQFZ9TLDB.18MUTK8OVXM77@phobos>

On 7/8/2021 4:21 PM, Michal Vlasák wrote:
> Hello,
> 
> in the generic font loader code `nuts.setfield` is `nil`.
> 
> This is because in `luatex-basics-nod.lua` there is a wrong assignment
> for `nuts.setfield` on line 121 (there is no `setfield` at that scope,
> it should be `direct.setfield`). This is the required patch:
> 
> ```diff
> --- a/luatex-basics-nod.lua
> +++ b/luatex-basics-nod.lua
> @@ -118,7 +118,7 @@ nuts.setcomponents = direct.setcomponents
>   nuts.setdirection  = direct.setdirection
>   nuts.setdisc       = direct.setdisc
>   nuts.setreplace    = direct.setreplace
> -nuts.setfield      = setfield
> +nuts.setfield      = direct.setfield

ok, will do

>   nuts.setkern       = direct.setkern
>   nuts.setlink       = direct.setlink
>   nuts.setlist       = direct.setlist
> ```
> 
> This surfaced because `nuts.setreplace` in the generic code is defined
> in terms of `nuts.setfield`. Previously `nuts.setreplace` wasn't used
> anywhere (I think), but since 20th May 2021 it is used when injecting
> kerns into discretionaries (font-otj.lua):
> 
> See also https://www.mail-archive.com/ntg-context@ntg.nl/msg98463.html.
> 
> Minimal not working example is:
> 
> ```
> \font\f=file:{./BaskervilleF-BoldItalic.otf}:mode=node;script=latn;kern=yes; at10pt
> \f B\-C
> 
> \bye
> ```
> 
> Fails with:
> "warning  (node filter): error: ./luatex-fonts-merged.lua:5166: attempt to call a nil value (upvalue 'setfield')".
> 
> Interestingly I can't reproduce the issue with Latin Modern, although it
> seems to have a similar kern:
> 
> ```
> \font\f=file:lmroman10-regular.otf:mode=node;script=latn;kern=yes; at10pt
> \f V\-a
> 
> \bye

one is injected before and one after so one ends up in the replacement 
part which involves setfield

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	other threads:[~2021-07-08 21:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 14:21 Michal Vlasák
2021-07-08 21:08 ` Hans Hagen [this message]

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=7e0765dd-5dab-babf-68e9-325f04efbf23@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=lahcim8@gmail.com \
    --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).