On 12/12/2019 2:06 PM, Marcel Fabian Krüger wrote:
Hello,

could font.getfont get an option to always return a new font table
instead of returning the current one? While for many fonts a cached
table makes sense, sometimes it would be useful to also have access to
the ooriginal table, e.g. to see which characters are `used`, inspect
the result of `font.addcharacters` or inspect other changes which might
be applied to the underlying font from TeX.

I attached a patch implementing this by adding a `nocache` parameter to
`font.getfont`, such that `font.getfont(true, font_id)` always generates
a new table. IMO `font.getfont(font_id, true)` would look nicer, but
that wouldn't be compatible to older LuaTeX versions which always expect
the font is as last parameter.
For such a feature I prefer "font.getcopy(id)". I'll add it to my todo list.

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
-----------------------------------------------------------------
_______________________________________________
dev-luatex mailing list
dev-luatex@ntg.nl
https://mailman.ntg.nl/mailman/listinfo/dev-luatex

Reply via email to