[NTG-context] Change of nuts.dimensions function ?

Joseph Canedo josephcanedo at gmail.com
Wed Feb 7 14:57:20 CET 2018


Hello all,

It seems that with latest ConTeXt beta (with luatex 1.07.0) it seems that nuts.dimensions function behaviour has changed. Simple MWE shows the change.
Which function should be used now to get natural width of a range [n, t[ of nodes please?
Thanks a lot
Regards

Joseph Canedo

\startluacode

local nuts   = nodes.nuts
local getdimensions = nuts.dimensions
local tonut  = nuts.tonut
local tonode = nuts.tonode

local tasks = nodes.tasks

function handler(head)
   head = tonut(head)
   print('Width=' .. getdimensions(head, head)) // used to be 0 (as per luatex doc), now it’s most likely the natural width of the box.
   return tonode(head)
end

tasks.appendaction("processors", "after", "handler")
tasks.enableaction("processors", "handler")

\stopluacode

\starttext

Foo.

\stoptext


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20180207/b11a78ea/attachment.html>


More information about the ntg-context mailing list