Change of nuts.dimensions function ?
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
On 2/7/2018 2:57 PM, Joseph Canedo wrote:
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? i'll check it but if you're on windows you're running the (currently very) experimental version which can actually be broken in some aspects (so you then need to update regularaly)
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 -----------------------------------------------------------------
Hi Hans, Thanks a lot, the function nuts.dimensions seems to work again as before. Another issue I am seeing now is that for some reason the dir nodes push/pop are unbalanced. If I understand the logic of these whatsit nodes they behave like a stack to control the text direction, so I’d assume the number of push nodes and pop nodes is balanced. Currently I see 2 pop for 1 push in shipouts callback (but balanced pop/push nodes in processors callback). If that’s expected from now on I’ll change the logic in my handler. Simple MWE that reproduces is attached. Thanks Best regards Joseph De : Hans Hagen Envoyé le :jeudi 8 février 2018 10:14 À : ntg-context@ntg.nl Objet :Re: [NTG-context] Change of nuts.dimensions function ? On 2/7/2018 2:57 PM, Joseph Canedo wrote:
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? i'll check it but if you're on windows you're running the (currently very) experimental version which can actually be broken in some aspects (so you then need to update regularaly)
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 ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________
On 2/15/2018 9:29 PM, Joseph Canedo wrote:
Hi Hans,
Thanks a lot, the function nuts.dimensions seems to work again as before.
Another issue I am seeing now is that for some reason the dir nodes push/pop are unbalanced. If I understand the logic of these whatsit nodes they behave like a stack to control the text direction, so I’d assume the number of push nodes and pop nodes is balanced. Currently I see 2 pop for 1 push in shipouts callback (but balanced pop/push nodes in processors callback). If that’s expected from now on I’ll change the logic in my handler.
Simple MWE that reproduces is attached.
i get dir=+TRT level=2 dir=-TRT level=1 processor dir=+TRT level=2 dir=+TLT level=3 dir=-TLT level=2 dir=-TRT level=1 shipout dir=+TRT level=2 dir=-TRT level=1 shipout dir=+TRT level=2 dir=+TLT level=3 dir=-TLT level=2 dir=-TRT level=1 (latest experimental ... keep in mind that experimental is *not* really meant for production as it's the branch where we put in code that we work on .. it can even be a temporsary snapshot) (btw, there is a preliminary bidi manual in the distribution which i use when testing some of the low level cleanup in progress)
Thanks
Best regards
Joseph
*De : *Hans Hagen mailto:pragma@wxs.nl *Envoyé le :*jeudi 8 février 2018 10:14 *À : *ntg-context@ntg.nl mailto:ntg-context@ntg.nl *Objet :*Re: [NTG-context] Change of nuts.dimensions function ?
On 2/7/2018 2:57 PM, Joseph Canedo wrote:
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?
i'll check it but if you're on windows you're running the (currently
very) experimental version which can actually be broken in some aspects
(so you then need to update regularaly)
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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
___________________________________________________________________________________ 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 ___________________________________________________________________________________
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Joseph Canedo