<html><body><div>Greetings,<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Given the following Lua fragment:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>==========<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>xxx = fonts.definers.read("drm10.otf:mode=base;liga=false;kern=false;", tex.sp("10pt"))<br>x = font.define(xxx)<br>font.current(x)<br>print()<br>print("Current font: " .. font.current())<br>print()<br>print("font.fonts[font.current()] does work:")<br>print(font.fonts[font.current()])<br>print()<br>print("But font.getfont doesn't work.")<br>print(font.getfont(font.current()))<br></div><div><br data-mce-bogus="1"></div><div>==========<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>I get the following output:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>==========<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>system : loading luc file '/home/<name>/.texlive2020/texmf-var/luatex-cache/gene<br>ric/fonts/otl/drm10.luc'<br>Current font: 65<br><br>font.fonts[font.current()] does work:<br>table: 0x938bd4cc080<br><br>But font.getfont doesn't work.<br>nil<br></div><div><br data-mce-bogus="1"></div><div>==========<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Is there a better way to load a font from withing Lua code?<br data-mce-bogus="1"></div><div>I assume that this has something to do with this note:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Also note the following: assignments can only be made to fonts that have already been defined<br>in TEX, but have not been accessed at all since that definition.<br></div><div><br data-mce-bogus="1"></div><div>since I have not defined anything from within TeX. Should I just use the font.fonts table, instead of font.getfont()? Or am I doing something else wrong?<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>I am using:<br data-mce-bogus="1"></div><div>This is LuaTeX, Version 1.12.0 (TeX Live 2020-OpenBSD_Ports) </div><div>with the luatex-plain format. I built this format after moving the "merged" files as the warnings suggested on the first attempt, so I believe I am using the more current, supported files.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Many Thanks for all your work and the LuaTeX system,<br data-mce-bogus="1"></div><div>Robert<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div></body></html>