ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Michal Vlasák" <lahcim8@gmail.com>
To: <ntg-context@ntg.nl>
Subject: nuts.setfield is nil in generic code
Date: Thu, 08 Jul 2021 16:21:50 +0200	[thread overview]
Message-ID: <CCNTQFZ9TLDB.18MUTK8OVXM77@phobos> (raw)

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

Originally reported at https://github.com/latex3/luaotfload/issues/194.

Regards,
Michal Vlasák
___________________________________________________________________________________
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 14:21 UTC|newest]

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

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=CCNTQFZ9TLDB.18MUTK8OVXM77@phobos \
    --to=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).