certik / slabikar-otf

https://certik.github.io/slabikar-otf/
MIT License
12 stars 3 forks source link

Font does not work in LuaTeX #7

Open certik opened 1 year ago

certik commented 1 year ago

The Slabikar.otf works in XeLaTeX and Tectonic, but not in LuaLaTeX:

$ git clone https://github.com/certik/slabikar-otf.git
$ cd slabikar-otf/examples/tex
$ cp ../../Slabikar.otf .
$ lualatex example.tex
This is LuaTeX, Version 1.10.0 (TeX Live 2019/Debian) 
 restricted system commands enabled.
(./example.tex
LaTeX2e <2020-02-02> patch level 2
 L3 programming layer <2020-02-14>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo
luaotfload | db : Font names database not found, generating new one.
luaotfload | db : This can take several minutes; please be patient.))
(/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/generic/iftex/ifvtex.sty
(/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty)))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def)))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
No file example.aux.
(/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd)
*geometry* driver: auto-detecting
*geometry* detected driver: luatex

warning  (node filter): error: ...xmf-dist/tex/luatex/luaotfload/fontloader-202
0-01-26.lua:23071: attempt to get length of a nil value (local 'chainlookup')

.
<recently read> \par 

l.17 

? 
! Emergency stop.
<recently read> \par 

l.17 

 1337 words of node memory still in use:
   2 hlist, 1 rule, 3 disc, 1 local_par, 1 dir, 23 glue, 3 kern, 13 penalty, 10
0 glyph, 10 attribute, 48 glue_spec, 10 attribute_list, 1 temp, 1 write nodes
   avail lists: 1:1,2:1,4:1,5:7,9:3
!  ==> Fatal error occurred, no output PDF file produced!

The error seems to be:

warning  (node filter): error: ...xmf-dist/tex/luatex/luaotfload/fontloader-202
0-01-26.lua:23071: attempt to get length of a nil value (local 'chainlookup')

So we need to debug it and fix it.

certik commented 1 year ago

Looking at the error:

warning  (node filter): error: 
...xmf-dist/tex/luatex/luaotfload/fontloader-2022
-06-15.lua:23994: attempt to get length of a nil value (local 'chainlookup')

and at the source code: http://tug.ctan.org/macros/luatex/generic/luaotfload/fontloader-2022-06-15.lua, the error comes from:

 if chainlookups then        
  if size==1 then            
   local chainlookup=chainlookups[1]
   for j=1,#chainlookup do   --- line 23994: "attempt to get length of a nil value (local 'chainlookup')"
    local chainstep=chainlookup[j]
    local chainkind=chainstep.type
    local chainproc=chainprocs[chainkind]
    if chainproc then        
...

So one should insert if chainlookup then before the for loop and then put else and handle the error in a more user friendly way.

olsak commented 1 year ago

If you mean that the problem is in the luaotfoad code and not in the font then you can create an issue at https://github.com/latex3/luaotfload

certik commented 1 year ago

Thanks, I reported it at https://github.com/latex3/luaotfload/issues/237.