On 7/14/2017 8:26 PM, Ulrike Fischer wrote:
Am Fri, 14 Jul 2017 19:20:38 +0200 schrieb Hans Hagen:
local kern_injector = function (fillup, kern) if fillup then local g = new_glue(kern) local s = getfield(g, "spec") setfield(s, "stretch", kern) setfield(s, "stretch_order", 1) return g end return new_kern(kern) end
yes, i decided to limit the dependencies ... (also because the kern allocator was a plug outside context)
you can use:
local new = node.direct.new
local g = new("glue") setfield(g, "stretch", kern) setfield(g, "stretch_order", 1)
And what I should do about the "return new_kern(kern)"?
local g = new("kern") setfield(g,"kern",kern)
I tried various variants and got results from no letterspacing to "invalid node type id" to " This can't happen (invalid node found in discretionary)." to a luatex crash:
you can't put glue in discs so your letterspacing code should use kerns, not glue
-- UF changed 2017-07-14 local new = node.direct.new
local kern_injector = function (fillup, kern) if fillup then local g = new("glue") setfield(g, "stretch", kern) setfield(g, "stretch_order", 1) return g end --return new_kern(kern) --?? -- end --
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------