ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* node.setglue broken in LuaMetaTeX
@ 2022-11-07 10:40 Max Chernoff via ntg-context
  2022-11-07 12:26 ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 2+ messages in thread
From: Max Chernoff via ntg-context @ 2022-11-07 10:40 UTC (permalink / raw)
  To: ntg-context; +Cc: Max Chernoff

Hi Hans,

Using node.setglue in LuaMetaTeX sets all of the glue components to
zero.

This example:

   \startluacode
       local stretch_order = "stretch_order"
       local shrink_order = "shrink_order"
       if status.luatex_engine == "luametatex" then
           stretch_order = "stretchorder"
           shrink_order  ="shrinkorder"
       end
   
       local glue = node.new "glue"
       print(node.getglue(glue))
       node.setglue(glue, 1, 2, 3, 4, 5)
       print(node.getglue(glue))
       glue.width = 1
       glue.stretch = 2
       glue.shrink = 3
       glue[stretch_order] = 4
       glue[shrink_order] = 5
       print(node.getglue(glue))
       node.setglue(glue, 1, 2, 3, 4, 5)
       print(node.getglue(glue))
   \stopluacode

produces this output in MkIV:

   0       0       0       0       0
   1       2       3       4       5
   1       2       3       4       5
   1       2       3       4       5
   
but this output in MkXL:

   0       0       0       0       0
   0       0       0       0       0
   1       2       3       4       5
   0       0       0       0       0
   
Thanks,
-- Max
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

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

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

* Re: node.setglue broken in LuaMetaTeX
  2022-11-07 10:40 node.setglue broken in LuaMetaTeX Max Chernoff via ntg-context
@ 2022-11-07 12:26 ` Hans Hagen via ntg-context
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen via ntg-context @ 2022-11-07 12:26 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

On 11/7/2022 11:40 AM, Max Chernoff via ntg-context wrote:
> Hi Hans,
> 
> Using node.setglue in LuaMetaTeX sets all of the glue components to
> zero.
> 
> This example:
> 
>     \startluacode
>         local stretch_order = "stretch_order"
>         local shrink_order = "shrink_order"
>         if status.luatex_engine == "luametatex" then
>             stretch_order = "stretchorder"
>             shrink_order  ="shrinkorder"
>         end
>     
>         local glue = node.new "glue"
>         print(node.getglue(glue))
>         node.setglue(glue, 1, 2, 3, 4, 5)
>         print(node.getglue(glue))
>         glue.width = 1
>         glue.stretch = 2
>         glue.shrink = 3
>         glue[stretch_order] = 4
>         glue[shrink_order] = 5
>         print(node.getglue(glue))
>         node.setglue(glue, 1, 2, 3, 4, 5)
>         print(node.getglue(glue))
>     \stopluacode
> 
> produces this output in MkIV:
> 
>     0       0       0       0       0
>     1       2       3       4       5
>     1       2       3       4       5
>     1       2       3       4       5
>     
> but this output in MkXL:
> 
>     0       0       0       0       0
>     0       0       0       0       0
>     1       2       3       4       5
>     0       0       0       0       0
it is unrelated to luametatex in the sense that it doesn't have that 
setter, so we emulate it in node-cmp.lmt:

function node.setglue   (n,...) return setglue   (todirect(n),...) end

but even then you won't get the '5' as bad values are intercepted ... 
i'll also add some extra checks to those field setters

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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2022-11-07 12:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-07 10:40 node.setglue broken in LuaMetaTeX Max Chernoff via ntg-context
2022-11-07 12:26 ` Hans Hagen via ntg-context

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).