ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Change of nuts.dimensions function ?
@ 2018-02-07 13:57 Joseph Canedo
  2018-02-08  9:13 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Joseph Canedo @ 2018-02-07 13:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 840 bytes --]

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



[-- Attachment #1.2: Type: text/html, Size: 2821 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-16 11:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-07 13:57 Change of nuts.dimensions function ? Joseph Canedo
2018-02-08  9:13 ` Hans Hagen
2018-02-15 20:29   ` Joseph Canedo
2018-02-16 11:06     ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).