Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luaotfload-tool --find fails due to missing functionality in luaonly mode #277

Open
wangweixuan opened this issue Mar 19, 2024 · 4 comments
Labels
bug Something isn't working fixed in dev already fixed

Comments

@wangweixuan
Copy link

Currently the command-line tool luaotfload-tool --find is not working:

...4/texmf-dist/tex/luatex/luaotfload/luaotfload-arabic.lua:19: attempt to index a nil value (global 'node')

It works if I comment out this line (introduced in 79e909f):

require'luaotfload-arabic'

The required module relies on the node table. However,luaotfload-tool runs in luaonly mode. That mode has limited functionality (from LuaTeX manual):

[...] the tables that deal with typesetting, like tex, token, node and pdf, are off-limits during the execution of the startup file (they are nil’d).

@zauguin zauguin added bug Something isn't working fixed in dev already fixed labels Apr 6, 2024
@zauguin
Copy link
Member

zauguin commented Apr 6, 2024

Resolved in dev with 12521e8.

@avidseeker
Copy link

avidseeker commented Jul 9, 2024

I applied this patch to the directory: kpsewhich luaotfload.sty and after luaotfload-tool --update --force, the tool is fixed:

$ luaotfload-tool --find="ScheherazadeNew"
luaotfload | resolve : Font "ScheherazadeNew" found!
luaotfload | resolve : Resolved file name "/usr/share/fonts/TTF/ScheherazadeNew-Regular.ttf"

However,

$ cat mwe.tex
\documentclass[mla8]{mla}
\usepackage{fontspec}
\setmainfont{FreeSerif}
\setmainfont[Script=Arabic]{ScheherazadeNew}

\begin{document}

\begin{paper}
        Testing
        تجربة
\end{paper}
\end{document}

and

$ lualatex mwe.tex
This is LuaHBTeX, Version 1.18.0 (TeX Live 2024/Arch Linux)
 restricted system commands enabled.
(./mwe.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-02-20>
 (/usr/share/texmf-dist/tex/latex/mlacls/mla.cls
Document Class: mla 2021/09/14 v1.0 MLA Paper Class
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2023/05/17 v1.4n Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size12.clo))
...
(/usr/share/texmf-dist/tex/latex/enumitem/enumitem.sty)
(/usr/share/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty)))

Package hyperref Warning: Option `pdfusetitle' has already been used,
(hyperref)                setting the option has no effect on input line 113.

)
luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: File not found: "ScheherazadeNew.otf".

! Package fontspec Error: The font "ScheherazadeNew" cannot be found.

For immediate help type H <return>.
 ...

For some reason, luaotfload-tool works, but not lualatex.

Edit: this issue doesn't happen with article documentclass but it happens with mla.cls. I filed a package bug here.

@avidseeker
Copy link

avidseeker commented Jul 20, 2024

Note: this isn't related to Arabic. Same problem for other fonts: luaotfload-tool --find="Noto Color Emoji". And for some reason, it complains about the .otfversion of the file despite explicitly setting the extension to.ttf`:

\fontspec{NotoColorEmoji}[
	Extension=.ttf,
	Path=/usr/share/texmf-dist/fonts/truetype/google/noto-emoji/,
	RawFeature={mode=harf}]
\setmainfont{NotoColorEmoji}
luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: File not found: "NotoColorEmoji.otf".

Curious.. I thought there is no need for luaotfload since I specified an absolute path as per the instructions of the manual for fontspec.

@zauguin
Copy link
Member

zauguin commented Jul 20, 2024

This is completely unrelated to the problem described here. Please create a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in dev already fixed
Projects
None yet
Development

No branches or pull requests

3 participants