Hi, based on an observation by Karl Berry on the TeX Live list I discovered an inconsistency in LuaTeX's handling of `-recorder`: While LuaTeX does record files loaded through `loadfile`, files loaded through `require` are ignored: For example if the current directory contains two empty files l1.lua and l2.lua, then the document \directlua{ loadfile'l1.lua'() require'l2' } \bye compiled with `luatex -recorder recorded` IMO should write to recorded.fls the entries PWD /some/weird/pwd INPUT /usr/local/texlive/2019/texmf-var/web2c/luatex/luatex.fmt INPUT ./recorded.tex OUTPUT recorded.log INPUT l1.lua INPUT ./l2.lua but it does write PWD /some/weird/pwd INPUT /usr/local/texlive/2019/texmf-var/web2c/luatex/luatex.fmt INPUT ./recorded.tex OUTPUT recorded.log INPUT l1.lua I do not think that this is intentional, so I added a patch to add recorder entries iff the file is loaded successfully (similar to `loadfile`) -- Marcel
Hi All, I'm using dirty trick to write documents used .otf files to .fls by adding code to ...\tex\latex\fontspec\fontspec.cfg \bgroup \catcode`\ 10 % \gdef\opentype@write@to@fls{% \directlua{ local fontdata = fonts.hashes.identifiers local done = {} for id, fdata in pairs(fontdata) do if fdata.filename and not done[fdata.filename] then tex.sprint("\string\\IfFileExists{".. fdata.filename .."}{}{}") done[fdata.filename] = '' end end }} \egroup \AtEndDocument{\opentype@write@to@fls} Then example: \documentclass{article} \usepackage{fontspec} \begin{document} \fontfamily{ptm}\selectfont a \end{document} Maybe this could be solved directly in luatex engine that all the input would be written to .fls? Thanks in advance! Linas On 11/7/2019 4:21 PM, Marcel Fabian Krüger wrote:
Hi,
based on an observation by Karl Berry on the TeX Live list I discovered an inconsistency in LuaTeX's handling of `-recorder`: While LuaTeX does record files loaded through `loadfile`, files loaded through `require` are ignored:
For example if the current directory contains two empty files l1.lua and l2.lua, then the document
\directlua{ loadfile'l1.lua'() require'l2' } \bye
compiled with `luatex -recorder recorded` IMO should write to recorded.fls the entries
PWD /some/weird/pwd INPUT /usr/local/texlive/2019/texmf-var/web2c/luatex/luatex.fmt INPUT ./recorded.tex OUTPUT recorded.log INPUT l1.lua INPUT ./l2.lua
but it does write
PWD /some/weird/pwd INPUT /usr/local/texlive/2019/texmf-var/web2c/luatex/luatex.fmt INPUT ./recorded.tex OUTPUT recorded.log INPUT l1.lua
I do not think that this is intentional, so I added a patch to add recorder entries iff the file is loaded successfully (similar to `loadfile`)
-- Marcel
_______________________________________________ dev-luatex mailing list dev-luatex@ntg.nl https://mailman.ntg.nl/mailman/listinfo/dev-luatex
On 11/7/2019 3:57 PM, Linas Stonys wrote:
Hi All, I'm using dirty trick to write documents used .otf files to .fls by adding code to ...\tex\latex\fontspec\fontspec.cfg
\bgroup \catcode`\ 10 %
\gdef\opentype@write@to@fls{% \directlua{ local fontdata = fonts.hashes.identifiers local done = {} for id, fdata in pairs(fontdata) do if fdata.filename and not done[fdata.filename] then tex.sprint("\string\\IfFileExists{".. fdata.filename .."}{}{}") done[fdata.filename] = '' end end }}
\egroup \AtEndDocument{\opentype@write@to@fls}
Then example: \documentclass{article} \usepackage{fontspec}
\begin{document} \fontfamily{ptm}\selectfont a \end{document}
Maybe this could be solved directly in luatex engine that all the input would be written to .fls? i have no clue what that code is for but if it's a trick to get something recorded, you can probably use
fio.recordfilename(fdata.filename) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
executing \IfFileExists{d:/texroot/2019/texmf-dist/fonts/opentype/public/lm/lmroman10-bold.otf}{}{} writes an entry to .fls like: INPUT d:/texroot/2019/texmf-dist/fonts/opentype/public/lm/lmroman10-bold.otf that's what this code does for every used opentype font. I tried offered fio.recordfilename(fdata.filename) but did not see any difference in .fls On 11/7/2019 5:20 PM, Hans Hagen wrote:
On 11/7/2019 3:57 PM, Linas Stonys wrote:
Hi All, I'm using dirty trick to write documents used .otf files to .fls by adding code to ...\tex\latex\fontspec\fontspec.cfg
\bgroup \catcode`\ 10 %
\gdef\opentype@write@to@fls{% \directlua{ local fontdata = fonts.hashes.identifiers local done = {} for id, fdata in pairs(fontdata) do if fdata.filename and not done[fdata.filename] then tex.sprint("\string\\IfFileExists{".. fdata.filename .."}{}{}") done[fdata.filename] = '' end end }}
\egroup \AtEndDocument{\opentype@write@to@fls}
Then example: \documentclass{article} \usepackage{fontspec}
\begin{document} \fontfamily{ptm}\selectfont a \end{document}
Maybe this could be solved directly in luatex engine that all the input would be written to .fls? i have no clue what that code is for but if it's a trick to get something recorded, you can probably use
fio.recordfilename(fdata.filename)
On 11/8/2019 9:31 AM, Linas Stonys wrote:
executing \IfFileExists{d:/texroot/2019/texmf-dist/fonts/opentype/public/lm/lmroman10-bold.otf}{}{}
writes an entry to .fls like: INPUT d:/texroot/2019/texmf-dist/fonts/opentype/public/lm/lmroman10-bold.otf
that's what this code does for every used opentype font. I tried offered fio.recordfilename(fdata.filename) but did not see any difference in .fls hm, i'll check it (in plain)
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 -----------------------------------------------------------------
On 11/8/2019 9:31 AM, Linas Stonys wrote:
executing \IfFileExists{d:/texroot/2019/texmf-dist/fonts/opentype/public/lm/lmroman10-bold.otf}{}{}
writes an entry to .fls like: INPUT d:/texroot/2019/texmf-dist/fonts/opentype/public/lm/lmroman10-bold.otf
that's what this code does for every used opentype font. I tried offered fio.recordfilename(fdata.filename) but did not see any difference in .fls actually there is
record_input_file record_output_file in the kpse lib so i'll remove the other function as it only is used in kpse mode anyway; in kpse lib i'll add it to the main module too, so then you will have kpse.record_input_file(fdata.filename) 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 -----------------------------------------------------------------
On 11/7/2019 3:21 PM, Marcel Fabian Krüger wrote:
Hi,
based on an observation by Karl Berry on the TeX Live list I discovered an inconsistency in LuaTeX's handling of `-recorder`: While LuaTeX does record files loaded through `loadfile`, files loaded through `require` are ignored:
For example if the current directory contains two empty files l1.lua and l2.lua, then the document
\directlua{ loadfile'l1.lua'() require'l2' } \bye
compiled with `luatex -recorder recorded` IMO should write to recorded.fls the entries
PWD /some/weird/pwd INPUT /usr/local/texlive/2019/texmf-var/web2c/luatex/luatex.fmt INPUT ./recorded.tex OUTPUT recorded.log INPUT l1.lua INPUT ./l2.lua
but it does write
PWD /some/weird/pwd INPUT /usr/local/texlive/2019/texmf-var/web2c/luatex/luatex.fmt INPUT ./recorded.tex OUTPUT recorded.log INPUT l1.lua
I do not think that this is intentional, so I added a patch to add recorder entries iff the file is loaded successfully (similar to `loadfile`) i'll add recording but not conditional (as found means found, which is unrelated to a succesful load)
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 (3)
-
Hans Hagen
-
Linas Stonys
-
Marcel Fabian Krüger