Re: [NTG-context] Defineenumeration head offset

2022-11-07 Thread Wolfgang Schuster via ntg-context

Alexandre Christe via ntg-context schrieb am 07.11.2022 um 21:04:

Dear list,

Is there a trick to not apply the leftoffset to the header of a 
defineenumeration?


MWE:

[...]


You can use \offset to shift the enumeration title.

\defineframed
  [ExampleHeadFrame]
  [location=low,
   background=color,
   backgroundcolor=darkgreen,
   width=\textwidth]

\define[1]\ExampleHeadCommand
  {\offset[leftoffset=-2.25ex]{\ExampleHeadFrame{#1}}}

\defineenumeration
  [example]
  [...,
   headcommand=\ExampleHeadCommand,
   ...]

Wolfgang

___
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
___


[NTG-context] Defineenumeration head offset

2022-11-07 Thread Alexandre Christe via ntg-context
Dear list,

Is there a trick to not apply the leftoffset to the header of a
defineenumeration?

MWE:

\definetextbackground
  [textFrameEx]
  [
frame=off,
framecolor=darkgreen,
rulethickness=2ex,
background=,
location=paragraph,
leftoffset=2.25ex,
rightoffset=2.25ex,
after={\hrule}
  ]

\defineenumeration
  [example]
  [
text=Example,
headalign=middle,
headcolor=white,

headcommand={\inframed[background=color,backgroundcolor=darkgreen,width=\textwidth]},
number=no,
before={%
  \starttextbackground[textFrameEx]
},
after={%
  \stoptextbackground%
},
  ]

\starttext

\startexample
Blablabla
\stopexample

\stoptext
___
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
___


[NTG-context] problem with Segoe Ui Symbol as fallback font

2022-11-07 Thread Henning Hraban Ramm via ntg-context

I’d like to set Segoe UI Symbol as fallback for all missing glyphs.
But it doesn’t work, I get an error like

registered function call [1145]: 
...-14/tex/texmf-context/tex/context/base/mkxl/math-act.lmt:2339: 
attempt to perform arithmetic on a nil value (field 'depth')

stack

... even if there’s no fallback enabled for the math font.

\definefontfallback[segoeFB]
  [name:segoeuisymbol]
  [0x00300-0x003FF,0x02100-0x02800]
  [check=yes,force=no]

That used to work, at least until version 2022-09-18.

It’s completely irregular which ranges throw an error:
0x03000-0x2 runs
0x02000-0x03000 doesn’t
0x02200-0x027FF doesn’t

And the fallbacks also don’t work, even if there’s no error.

It seems to depend on the font – I get errors with Segoe UI Symbol, but 
not with EmojiOneColor or Symbola.


I checked with font versions 5.0 and 5.01, don’t have newer ones.

Does it work with current versions?

Also, a list of fallbacks doesn’t work (I’d like to replace single 
characters from different fonts); is it supposed to?


test file attached.

Hraban

fontfallbacktest.tex
Description: TeX document
___
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
___


Re: [NTG-context] node.setglue broken in LuaMetaTeX

2022-11-07 Thread Hans Hagen via ntg-context

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
___


[NTG-context] node.setglue broken in LuaMetaTeX

2022-11-07 Thread Max Chernoff via ntg-context
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
___