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
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 -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Michal Vlasák