---- On Tue, 25 Sep 2018 23:26:10 +0200 Hans Hagen
On 9/25/2018 9:33 PM, Marcel Krüger wrote:
Hi,
while looking into a [luaotfload bug][bug] caused by the fontloader being confused when LuaTeX overwrites the `parameters` in a cached font table, I wondered why `write_lua_parameters` always creates a new table instead of altering a potentially preexisting table.
Changing this should lead to some small performance improvement because Lua no longer has to create a new table every time a cached font table is queried and more importantly it allows additional string keys in `parameters` to be preserved.
sounds more like an issue of luaotfload ... it should manage the parameters well
I do not think luaotfload is responsible especially because Ulrike Fischer got a similar problem on ConTeXt with \starttext foo \ctxlua{for ii,vv in font.each() do end } bar \stoptext She proposed that the ConTeXt fontloader might benefit from overloading `font.each()` similar to `font.getfont` if the engine should not be changed. In some personal experiments local function fonteach_next(max, f) repeat f = f + 1 if f > max then return end until font.frozen(f) ~= nil return f, font.getfont(f) or font.fonts[f] end font.each = function() return fonteach_next, font.max(), 0 end seemed to fix the problem.
we're not going to change the current behaviour in the engine which is creating these tables (same for math constant etc) from mem (changing such things might solve your specific issue but introduce issues for others)
While I agree that keeping compatibility is important I do not really understand how this would lead to issues. Especially the parameters known to LuaTeX are still updated, so the only change I can see here would be if someone relies on LuaTeX dropping some table values... Is there a problem I missed? Best regards Marcel
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------