Re: [NTG-context] combinations

2021-05-13 Thread jbf
Wonderful Benny! Congrats on your first ever suggestion. I didn't need a 
caption so I had left it out, but I see that I now need at least an 
empty {} after each item for it to work.


Thanks

Julian

On 14/5/21 2:30 pm, Benny Schurig wrote:

{pic 1}

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


Re: [NTG-context] combinations

2021-05-13 Thread Benny Schurig

Hi Julian,

for me first reply ever with a suggestion:

You have to set a caption

https://wiki.contextgarden.net/Command/startcombination

That worked fine for me:

\startplacefigure[location=here]
  \setupcombination[distance=0mm,after=]
  {\startcombination[2*1]
{\externalfigure[res1.jpg][width=.4\textwidth]} {pic 1}
{\externalfigure[res2.jpg][width=.4\textwidth]} {pic 2}
  \stopcombination}
\stopplacefigure

Best, Benny

Am 14.05.21 um 05:27 schrieb jbf:

Hi list,

The following MWE is giving me two photos under each other, not beside 
each. What am I doing wrong?


Julian


\startplacefigure[location=here]
\setupcombination[distance=0mm,after=]
{\startcombination[2*1]
{\externalfigure[res1.jpg][width=.4\textwidth]}
{\externalfigure[res2.jpg][width=.4\textwidth]} \stopcombination}
\stopplacefigure

___ 

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
___


[NTG-context] combinations

2021-05-13 Thread jbf

Hi list,

The following MWE is giving me two photos under each other, not beside 
each. What am I doing wrong?


Julian


\startplacefigure[location=here]
\setupcombination[distance=0mm,after=]
{\startcombination[2*1]
{\externalfigure[res1.jpg][width=.4\textwidth]}
{\externalfigure[res2.jpg][width=.4\textwidth]} \stopcombination}
\stopplacefigure

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


Re: [NTG-context] NotoColorEmoji - loca table not found

2021-05-13 Thread Jairo A. del Rio
El jue, 13 de may. de 2021 a la(s) 19:52, Adam Reviczky (revic...@gmail.com)
escribió:

> Thanks Jairo,
>
> That indeed works, should've read that it is bitmap only.
>
> I do get a white background though (MKIV), is that how the bitmap is
> stored?
>
>
In LuaLaTeX with Harfbuzz shaper as well as ConTeXt LMTX, transparency is
properly handled, so I suppose ConTeXt MkIV is to blame in this case. In
case you understand how does ConTeXt handle with bitmap fonts, relevant
files are under
/home/coragyps/lmtx/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/fonts/


> \definefontfeature[Emoji][default][sbix=yes]
>
> \starttext
>
>
> \framed[background=color,background=black]{\definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D}
>
> \stoptext
>
>
> In Hans' example for applecoloremoji there is no white background (page 5,
> bachotex-2017-emoji.pdf).
>
> I also do not get a white background with LibreOfiice.
>
>
>
I'd wait for Hans to fix it, as I don't really understand font management
in ConTeXt...

Jairo


> Adam
>
> On Fri, May 14, 2021 at 12:51 AM Jairo A. del Rio 
> wrote:
>
>> In ConTeXt LMTX this works just fine (try mtxrun --generate and context
>> --make first):
>>
>> \definefontfeature[Emoji][default][sbix=yes]
>>
>> \starttext
>>
>> \definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D
>>
>> \stoptext
>>
>> However, when one tries to convert it with ImageMagick the following
>> happens:
>>
>> Error reading a content stream. The page may be incomplete.
>>Output may be incorrect.
>> Error: Ignoring spurious ET operator.
>>Output may be incorrect.
>> Error: File did not complete the page properly and may be damaged.
>>Output may be incorrect.
>>
>>
>> Only SVG fonts don't trigger this error in LMTX.
>>
>>
>> I confirm ConTeXt MkIV is having issues with emoji fonts. It seems that
>> GraphicsMagick is not properly generating images as it complains about an
>> improper header.
>>
>> Jairo
>>
>> El jue, 13 de may. de 2021 a la(s) 18:26, Adam Reviczky (
>> revic...@gmail.com) escribió:
>>
>>> Hi,
>>>
>>> I am trying to use the 'handshake' character (
>>> https://www.fileformat.info/info/unicode/char/1f91d/fontsupport.htm)
>>> from the Noto Color Emoji font (
>>> https://github.com/googlefonts/noto-emoji/blob/main/fonts/NotoColorEmoji.ttf
>>> ).
>>>
>>> The following MWE gives an error:
>>>
>>> \starttext
>>>
>>> \definedfont[file:NotoColorEmoji.ttf] \char"1F91D
>>>
>>> \stoptext
>>>
>>> fonts   > otf loading > loading 'NotoColorEmoji.ttf', hash
>>> 'notocoloremoji'
>>> system  > lua > compiling
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
>>> into
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
>>> system  > lua > dumping
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
>>> into
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
>>> stripped
>>> fonts   > otf loading > loading done
>>> fonts   > otf loading > saving 'NotoColorEmoji.ttf' in cache
>>> system  > lua > compiling
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
>>> into
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
>>> system  > lua > dumping
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
>>> into
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
>>> stripped
>>> fonts   > otf loading > loading, optimizing, packing and caching
>>> time 2.557
>>> pages   > flushing realpage 1, userpage 1, subpage 1
>>> close source> level 2, order 3, name '/tmp/MWE.tex'
>>> close source> level 1, order 3, name
>>> '/usr/share/texmf/tex/context/base/mkiv/cont-yes.mkiv'
>>> ! error:  (file NotoColorEmoji.ttf) (ttf): loca table not
>>> foundmtx-context | fatal error: return code: 256
>>>
>>> Any idea what is wrong?
>>>
>>> Adam
>>>
>>>
>>> ___
>>> 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
>>>
>>> ___
>>>
>>
>> 

Re: [NTG-context] NotoColorEmoji - loca table not found

2021-05-13 Thread Adam Reviczky
Thanks Jairo,

That indeed works, should've read that it is bitmap only.

I do get a white background though (MKIV), is that how the bitmap is stored?

\definefontfeature[Emoji][default][sbix=yes]

\starttext

\framed[background=color,background=black]{\definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D}

\stoptext


In Hans' example for applecoloremoji there is no white background (page 5,
bachotex-2017-emoji.pdf).

I also do not get a white background with LibreOfiice.


Adam

On Fri, May 14, 2021 at 12:51 AM Jairo A. del Rio 
wrote:

> In ConTeXt LMTX this works just fine (try mtxrun --generate and context
> --make first):
>
> \definefontfeature[Emoji][default][sbix=yes]
>
> \starttext
>
> \definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D
>
> \stoptext
>
> However, when one tries to convert it with ImageMagick the following
> happens:
>
> Error reading a content stream. The page may be incomplete.
>Output may be incorrect.
> Error: Ignoring spurious ET operator.
>Output may be incorrect.
> Error: File did not complete the page properly and may be damaged.
>Output may be incorrect.
>
>
> Only SVG fonts don't trigger this error in LMTX.
>
>
> I confirm ConTeXt MkIV is having issues with emoji fonts. It seems that
> GraphicsMagick is not properly generating images as it complains about an
> improper header.
>
> Jairo
>
> El jue, 13 de may. de 2021 a la(s) 18:26, Adam Reviczky (
> revic...@gmail.com) escribió:
>
>> Hi,
>>
>> I am trying to use the 'handshake' character (
>> https://www.fileformat.info/info/unicode/char/1f91d/fontsupport.htm)
>> from the Noto Color Emoji font (
>> https://github.com/googlefonts/noto-emoji/blob/main/fonts/NotoColorEmoji.ttf
>> ).
>>
>> The following MWE gives an error:
>>
>> \starttext
>>
>> \definedfont[file:NotoColorEmoji.ttf] \char"1F91D
>>
>> \stoptext
>>
>> fonts   > otf loading > loading 'NotoColorEmoji.ttf', hash
>> 'notocoloremoji'
>> system  > lua > compiling
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
>> into
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
>> system  > lua > dumping
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
>> into
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
>> stripped
>> fonts   > otf loading > loading done
>> fonts   > otf loading > saving 'NotoColorEmoji.ttf' in cache
>> system  > lua > compiling
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
>> into
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
>> system  > lua > dumping
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
>> into
>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
>> stripped
>> fonts   > otf loading > loading, optimizing, packing and caching
>> time 2.557
>> pages   > flushing realpage 1, userpage 1, subpage 1
>> close source> level 2, order 3, name '/tmp/MWE.tex'
>> close source> level 1, order 3, name
>> '/usr/share/texmf/tex/context/base/mkiv/cont-yes.mkiv'
>> ! error:  (file NotoColorEmoji.ttf) (ttf): loca table not
>> foundmtx-context | fatal error: return code: 256
>>
>> Any idea what is wrong?
>>
>> Adam
>>
>>
>> ___
>> 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
>
> ___
>


sbix.pdf
Description: Adobe PDF document
___
If your question is of interest to others 

Re: [NTG-context] NotoColorEmoji - loca table not found

2021-05-13 Thread Jairo A. del Rio
In ConTeXt LMTX this works just fine (try mtxrun --generate and context
--make first):

\definefontfeature[Emoji][default][sbix=yes]

\starttext

\definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D

\stoptext

However, when one tries to convert it with ImageMagick the following
happens:

    Error reading a content stream. The page may be incomplete.
   Output may be incorrect.
    Error: Ignoring spurious ET operator.
   Output may be incorrect.
    Error: File did not complete the page properly and may be damaged.
   Output may be incorrect.


Only SVG fonts don't trigger this error in LMTX.


I confirm ConTeXt MkIV is having issues with emoji fonts. It seems that
GraphicsMagick is not properly generating images as it complains about an
improper header.

Jairo

El jue, 13 de may. de 2021 a la(s) 18:26, Adam Reviczky (revic...@gmail.com)
escribió:

> Hi,
>
> I am trying to use the 'handshake' character (
> https://www.fileformat.info/info/unicode/char/1f91d/fontsupport.htm) from
> the Noto Color Emoji font (
> https://github.com/googlefonts/noto-emoji/blob/main/fonts/NotoColorEmoji.ttf
> ).
>
> The following MWE gives an error:
>
> \starttext
>
> \definedfont[file:NotoColorEmoji.ttf] \char"1F91D
>
> \stoptext
>
> fonts   > otf loading > loading 'NotoColorEmoji.ttf', hash
> 'notocoloremoji'
> system  > lua > compiling
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
> into
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
> system  > lua > dumping
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
> into
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
> stripped
> fonts   > otf loading > loading done
> fonts   > otf loading > saving 'NotoColorEmoji.ttf' in cache
> system  > lua > compiling
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
> into
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
> system  > lua > dumping
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
> into
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
> stripped
> fonts   > otf loading > loading, optimizing, packing and caching
> time 2.557
> pages   > flushing realpage 1, userpage 1, subpage 1
> close source> level 2, order 3, name '/tmp/MWE.tex'
> close source> level 1, order 3, name
> '/usr/share/texmf/tex/context/base/mkiv/cont-yes.mkiv'
> ! error:  (file NotoColorEmoji.ttf) (ttf): loca table not foundmtx-context
> | fatal error: return code: 256
>
> Any idea what is wrong?
>
> Adam
>
>
> ___
> 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
___


[NTG-context] NotoColorEmoji - loca table not found

2021-05-13 Thread Adam Reviczky
Hi,

I am trying to use the 'handshake' character (
https://www.fileformat.info/info/unicode/char/1f91d/fontsupport.htm) from
the Noto Color Emoji font (
https://github.com/googlefonts/noto-emoji/blob/main/fonts/NotoColorEmoji.ttf
).

The following MWE gives an error:

\starttext

\definedfont[file:NotoColorEmoji.ttf] \char"1F91D

\stoptext

fonts   > otf loading > loading 'NotoColorEmoji.ttf', hash
'notocoloremoji'
system  > lua > compiling
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
into
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
system  > lua > dumping
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
into
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
stripped
fonts   > otf loading > loading done
fonts   > otf loading > saving 'NotoColorEmoji.ttf' in cache
system  > lua > compiling
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
into
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
system  > lua > dumping
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
into
'/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
stripped
fonts   > otf loading > loading, optimizing, packing and caching
time 2.557
pages   > flushing realpage 1, userpage 1, subpage 1
close source> level 2, order 3, name '/tmp/MWE.tex'
close source> level 1, order 3, name
'/usr/share/texmf/tex/context/base/mkiv/cont-yes.mkiv'
! error:  (file NotoColorEmoji.ttf) (ttf): loca table not foundmtx-context
| fatal error: return code: 256

Any idea what is wrong?

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


Re: [NTG-context] Fuzzy lines

2021-05-13 Thread Aditya Mahajan
On Thu, 13 May 2021, Henning Hraban Ramm wrote:

> My test file also includes the noise overlay after Jairo’s suggestions. Maybe 
> you want to implement that, too?
> At the moment it still doesn’t respect the pen size, and the number of 
> patterns per path is fixed.

I am not sure if simply adding random noise to the line give an impression of 
hand-drawn lines. For a different approach, see:

https://m.habr.com/en/post/454376/

which uses the code here:

https://github.com/jemmybutton/fiziko

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


Re: [NTG-context] [installing lmtx on raspi400]

2021-05-13 Thread Floris van Manen



On 13/05/2021 22:39, Christian Prim wrote:

I solved it following this (or a similar) solution:

https://github.com/deltachat/deltachat-desktop/issues/1006#issue-498257133 



That worked very well, thank you !

$ hostnamectl
   Static hostname: rp400
 Icon name: computer
  Operating System: Debian GNU/Linux bullseye/sid
Kernel: Linux 5.10.17-v8+
  Architecture: arm64


$ context --version
mtx-context | ConTeXt Process Management 1.04
mtx-context |
mtx-context | main context file: 
/home/pi/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv

mtx-context | current version: 2021.05.09 17:14
mtx-context | main context file: 
/home/pi/context/tex/texmf-context/tex/context/base/mkxl/context.mkxl

mtx-context | current version: 2021.05.09 17:14


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


Re: [NTG-context] [installing lmtx on raspi400]

2021-05-13 Thread Christian Prim
In buster the libc6 is too old. You can switch to debian 11 or ubuntu as
Hans said or you can add a newer glibc version. I had the same problem on a
chromebook duet. I solved it following this (or a similar) solution:

https://github.com/deltachat/deltachat-desktop/issues/1006#issue-498257133

(you read context instead of deltachat)

I had no problems using the newer libc6. But you do this at your one risk!

Kind regards
Christian



Am Do., 13. Mai 2021 um 16:30 Uhr schrieb Hans Hagen :

> On 5/13/2021 2:08 PM, Floris van Manen wrote:
> > No desktop system is complete before having a proper lmtx installed ;-)
> >
> > So with this OS version
> >
> > $ uname -a
> > Linux rp400 5.10.17-v8+ #1414 SMP PREEMPT Fri Apr 30 13:23:25 BST 2021
> > aarch64 GNU/Linux
> >
> > $ hostnamectl
> > Static hostname: rp400
> >   Icon name: computer
> >Operating System: Debian GNU/Linux 10 (buster)
> >  Kernel: Linux 5.10.17-v8+
> >Architecture: arm64
> >
> >
> > I downloaded
> > context-linux-aarch64.zip
> >
> >
> > unzipped it in the ~/context folder and ran the install.sh script
> >
> > $ sudo sh ./install.sh
> >
> > this gives an error:
> >
> > /home/pi/context/bin/mtxrun: /lib/aarch64-linux-gnu/libm.so.6: version
> > `GLIBC_2.29' not found (required by /home/pi/context/bin/mtxrun)
> >
> >
> >
> > Anyone with a hint ?
>
> the 64 bit is generate on a rpi runing ubuntu so maybe more recent libs?
>
> Hans
>
> (makes me wonder if it runs on a rpi with windows)
>
> -
>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
___


Re: [NTG-context] Fuzzy lines

2021-05-13 Thread Henning Hraban Ramm


> Am 13.05.2021 um 20:26 schrieb Thomas A. Schmitz :
> 
> On 5/13/21 8:02 PM, Henning Hraban Ramm wrote:
>> Unfortunately, the deviation of edge points is too big – try my attached 
>> test file.
>> Strangely, if I include the MP code in a ConTeXt document,
> 
> I find the discussion interesting. Could you send complete documents, like 
> Aditya did? When I try to compile your files, I get all sorts of errors, so I 
> suspect they are not complete. Would be appreciated if you could send a 
> ConTeXt document. I'm still not quite sure what you're looking for...

Hi Thomas,

for my test files you only also need Aditya’s latest mp-sketch.mp, now attached.

Find also attached my (somewhat simplified) attempt on a cover for a new 
workbook series.
In the original I’m using the commercial "Supernett Cn" font family that also 
looks quite sketchy.

Hraban




mp-sketch.mp
Description: Binary data


sketchtest.mp
Description: Binary data


covertest.tex
Description: Binary data
___
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
___


Re: [NTG-context] Fuzzy lines

2021-05-13 Thread Thomas A. Schmitz

On 5/13/21 8:02 PM, Henning Hraban Ramm wrote:

Unfortunately, the deviation of edge points is too big – try my attached test 
file.

Strangely, if I include the MP code in a ConTeXt document,


I find the discussion interesting. Could you send complete documents, 
like Aditya did? When I try to compile your files, I get all sorts of 
errors, so I suspect they are not complete. Would be appreciated if you 
could send a ConTeXt document. I'm still not quite sure what you're 
looking for...


Thomas

\setupbodyfont[20pt]

\showframe

\startuseMPgraphic{fuzzy}

path p ; p := (0,0) -- (0,OverlayHeight) -- (OverlayWidth,OverlayHeight) --
(OverlayWidth,0) -- cycle ;

pickup pencircle scaled .5pt ;

for i=1 upto 20 :
 draw p enlarged -5pt randomized 15pt withcolor blue ;
endfor ;

\stopuseMPgraphic

\defineoverlay [Fuzzy] [\useMPgraphic{fuzzy}]

\startTEXpage


\framed [height=20cm,width=12cm,frame=on,background=Fuzzy,align={middle,lohi}]
{Test}

\stopTEXpage

test.pdf
Description: Adobe PDF document
___
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
___


Re: [NTG-context] Fuzzy lines

2021-05-13 Thread Henning Hraban Ramm


> Am 13.05.2021 um 19:17 schrieb Aditya Mahajan :
> 
> On Thu, 13 May 2021, Henning Hraban Ramm wrote:
> 
>> 
>>> Am 13.05.2021 um 18:36 schrieb Aditya Mahajan :
>>> 
 Now I want to draw that path several times.
 
 If I understand it right, I can’t put that into "sketchdraw" because that 
 leaves the end open for path additions like "withcolor".
>>> 
>>> A slightly different approach is needed. See attached. I also added a bit a 
>>> error protection in case someone sets sketch_passes to be negative by 
>>> mistake. 
>> 
>> Thank you so much!
> 
> Here is a different effect ... more of a trembling hand drawing than a 
> sketch. You can play around with sketch_amount to see some variation. 
> 
> In this, rather than using the default randomized path (which randomizes the 
> points of a path), I split the path into 20 segments, and randomize each 
> segment. 

Thank you, that is what I was asking for!

Unfortunately, the deviation of edge points is too big – try my attached test 
file.

Strangely, if I include the MP code in a ConTeXt document, the transparency 
doesn’t work (it multiplies, but at 100%); I must add "withtransparency 
("multiply", 0.2)" to my draw command. I’ll try to come up with a MWE. 
(Transparency of an image also doesn’t work in that document.)

My test file also includes the noise overlay after Jairo’s suggestions. Maybe 
you want to implement that, too?
At the moment it still doesn’t respect the pen size, and the number of patterns 
per path is fixed.

Hraban




sketchtest.mp
Description: Binary data
___
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
___


Re: [NTG-context] Fuzzy lines

2021-05-13 Thread Aditya Mahajan
On Thu, 13 May 2021, Henning Hraban Ramm wrote:

> 
> > Am 13.05.2021 um 18:36 schrieb Aditya Mahajan :
> > 
> >> Now I want to draw that path several times.
> >> 
> >> If I understand it right, I can’t put that into "sketchdraw" because that 
> >> leaves the end open for path additions like "withcolor".
> > 
> > A slightly different approach is needed. See attached. I also added a bit a 
> > error protection in case someone sets sketch_passes to be negative by 
> > mistake. 
> 
> Thank you so much!

Here is a different effect ... more of a trembling hand drawing than a sketch. 
You can play around with sketch_amount to see some variation. 

In this, rather than using the default randomized path (which randomizes the 
points of a path), I split the path into 20 segments, and randomize each 
segment. 

Aditya%D \module
%D   [   file=mp-sketch.mp
%Dversion=2021.05.13
%D  title=\CONTEXT\ \METAPOST\ graphics,
%D   subtitle=Sketch drawing,
%D author=Aditya Mahajan,
%D   date=\currentdate,
%D  copyright={Aditya Mahajan}]

%D This metapost module is inspired by a TeX.SE question:
%D http://tex.stackexchange.com/q/39296/323
%D
%D I thought that it would be fun to implement a similar feature in MetaPost.
%D
%D To use this package in MetaPost:
%D
%D \starttyping
%Dinput mp-sketch;
%D
%Dbeginfig(1)
%D  sketchypaths; % Make draw and fill sketchy
%D  ...
%D  naturalizepaths; % Restore the value of draw and fill
%D  ...
%Dendfig
%D \stoptyping
%D
%D The code is heavily inspired by Hans Hagen's Metafun macros.
%D
%D The macro \type{sketchypaths} is modeled after \type{visualizepaths} from
%D \filename{mp-tool}.

def sketchypaths =
let draw = sketchdraw ;
let fill = sketchfill ;
enddef ;

%D Check if \filename{mp-tool} is loaded
if not known context_tool :
  let normaldraw = draw;
  let normalfill = fill;

  def naturalizepaths =
  let fill = normalfill ;
  let draw = normaldraw ;
  enddef ;
fi

%D The variable \type{sketch_amount} determines the amount of randomness in the
%D drawing
numeric sketch_amount; sketch_amount := 0.75bp;

%D The variable \type{sketch_passes} determines the number of times the path
%D is drawn
numeric sketch_passes; sketch_passes := 1;

%D Based on \type{randomized}. Assumes p is path:
numeric sketch_segments; sketch_segments := 20;

primarydef p sketchrandomized s = (
if path p :
for t = 0 step 1/sketch_segments until 1-1/sketch_segments : 
((point   (t*arclength(p)) on p) 
randomshifted s) .. controls
((postcontrol (t*arclength(p)) on p) 
randomshifted s) and
((precontrol  ((t+1/sketch_segments)*arclength(p)) on p) 
randomshifted s) ..
endfor
if cycle p :
cycle
else :
((point arclength(p) on p) randomshifted s)
fi
else :
p
fi
) enddef ;


%D The macro \type{sketchdraw} draws the randomized path. The 
%D \type{expr} ... \type{text} trick is copied from the definition of 
%D \type{drawarrow}
def sketchdraw expr p =
   do_sketchdraw(p)
enddef;

def do_sketchdraw(expr p) text t =
  if (path p) :
  for i = 1 upto max(1,sketch_passes) :
normaldraw p 
   sketchrandomized sketch_amount 
   withtransparency ("multiply", 1/max(1,sketch_passes))
   t ;
  endfor;
  else :
  normaldraw p t;
  fi
enddef;

%D The macro \type{sketchfill} randomizes the path before filling it.
def sketchfill expr p =
  do_sketchfill(p)
enddef ;

def do_sketchfill(expr p) text t =
  if (path p) :
  for i = 1 upto max(1,sketch_passes) :
normalfill p 
   randomized sketch_amount 
   withtransparency ("multiply", 1/max(1,sketch_passes))
   t ;
  endfor;
  else :
  normalfill p t;
  fi
enddef;

endinput;

% Modified example from
% http://tex.loria.fr/prod-graph/zoonekynd/metapost/metapost.html

beginfig(1)
  pair A,B,C,O;
  A=(0,0); B=(3cm,0); C=(1cm,2cm);

  O - 1/2[B,C] = whatever * (B-C) rotated 90;
  O - 1/2[A,B] = whatever * (A-B) rotated 90;

  sketchypaths;
  sketch_amount := 5bp;
  draw A--B--C--cycle;

  draw O withpen pencircle scaled 4bp;

  sketch_amount := 2bp;
  draw fullcircle scaled 2abs(O-A) shifted O;
endfig


test.tex
Description: TeX document


test.pdf
Description: Adobe PDF document
___
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
___


Re: [NTG-context] Fuzzy lines

2021-05-13 Thread Henning Hraban Ramm

> Am 13.05.2021 um 18:36 schrieb Aditya Mahajan :
> 
>> Now I want to draw that path several times.
>> 
>> If I understand it right, I can’t put that into "sketchdraw" because that 
>> leaves the end open for path additions like "withcolor".
> 
> A slightly different approach is needed. See attached. I also added a bit a 
> error protection in case someone sets sketch_passes to be negative by 
> mistake. 

Thank you so much!


> It may be interesting to rewrite these macros using the new key-value 
> interface for metapost, so that something like this works:
> 
> \sketchdraw[amount=3bp, passes=5, transparency=yes] fullsquare scaled 1cm 
> withcolor red;

Yes, I just read the luametafun manual and will try a few things – but this is 
still over my head.


Hraban

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


Re: [NTG-context] Fuzzy lines

2021-05-13 Thread Aditya Mahajan
On Thu, 13 May 2021, Henning Hraban Ramm wrote:

> 
> > Am 11.05.2021 um 18:02 schrieb Aditya Mahajan :
> > 
> > Look at this old code on how hide such code behind a macro to have a clean 
> > interface:
> > 
> > https://github.com/adityam/mp-sketch/blob/master/mp-sketch.mp
> 
> Hi Aditya,
> I’m trying to include my additions into your code, but it doesn’t work.
> 
> 
> numeric sketch_amount; sketch_amount := 3bp;
> numeric sketch_passes; sketch_passes := 5;
> 
> def sketchdraw expr p =
>   do_sketchdraw(p if (path p): randomized sketch_amount fi)
> enddef;
> 
> def do_sketchdraw(expr p) text t =
> normaldraw p t ;
> enddef;
> 
> 
> Now I want to draw that path several times.
> 
> If I understand it right, I can’t put that into "sketchdraw" because that 
> leaves the end open for path additions like "withcolor".
> 
> But it also doesn’t work in "do_sketchdraw"; I thought it might like this:

A slightly different approach is needed. See attached. I also added a bit a 
error protection in case someone sets sketch_passes to be negative by mistake. 

It may be interesting to rewrite these macros using the new key-value interface 
for metapost, so that something like this works:

\sketchdraw[amount=3bp, passes=5, transparency=yes] fullsquare scaled 1cm 
withcolor red;

test.pdf
Description: Adobe PDF document


test.tex
Description: TeX document
%D \module
%D   [   file=mp-sketch.mp
%Dversion=2021.05.13
%D  title=\CONTEXT\ \METAPOST\ graphics,
%D   subtitle=Sketch drawing,
%D author=Aditya Mahajan,
%D   date=\currentdate,
%D  copyright={Aditya Mahajan}]

%D This metapost module is inspired by a TeX.SE question:
%D http://tex.stackexchange.com/q/39296/323
%D
%D I thought that it would be fun to implement a similar feature in MetaPost.
%D
%D To use this package in MetaPost:
%D
%D \starttyping
%Dinput mp-sketch;
%D
%Dbeginfig(1)
%D  sketchypaths; % Make draw and fill sketchy
%D  ...
%D  naturalizepaths; % Restore the value of draw and fill
%D  ...
%Dendfig
%D \stoptyping
%D
%D The code is heavily inspired by Hans Hagen's Metafun macros.
%D
%D The macro \type{sketchypaths} is modeled after \type{visualizepaths} from
%D \filename{mp-tool}.

def sketchypaths =
let draw = sketchdraw ;
let fill = sketchfill ;
enddef ;

%D Check if \filename{mp-tool} is loaded
if not known context_tool :
  let normaldraw = draw;
  let normalfill = fill;

  def naturalizepaths =
  let fill = normalfill ;
  let draw = normaldraw ;
  enddef ;
fi

%D The variable \type{sketch_amount} determines the amount of randomness in the
%D drawing
numeric sketch_amount; sketch_amount := 3bp;

%D The variable \type{sketch_passes} determines the number of times the path
%D is drawn
numeric sketch_passes; sketch_passes := 1;

%D The macro \type{sketchdraw} draws the randomized path. The 
%D \type{expr} ... \type{text} trick is copied from the definition of 
%D \type{drawarrow}
def sketchdraw expr p =
   do_sketchdraw(p)
enddef;

def do_sketchdraw(expr p) text t =
  if (path p) :
  for i = 1 upto max(1,sketch_passes) :
normaldraw p 
   randomized sketch_amount 
   withtransparency ("multiply", 1/max(1,sketch_passes))
   t ;
  endfor;
  else :
  normaldraw p t;
  fi
enddef;

%D The macro \type{sketchfill} randomizes the path before filling it.
def sketchfill expr p =
  do_sketchfill(p)
enddef ;

def do_sketchfill(expr p) text t =
  if (path p) :
  for i = 1 upto max(1,sketch_passes) :
normalfill p 
   randomized sketch_amount 
   withtransparency ("multiply", 1/max(1,sketch_passes))
   t ;
  endfor;
  else :
  normalfill p t;
  fi
enddef;

endinput;

% Modified example from
% http://tex.loria.fr/prod-graph/zoonekynd/metapost/metapost.html

beginfig(1)
  pair A,B,C,O;
  A=(0,0); B=(3cm,0); C=(1cm,2cm);

  O - 1/2[B,C] = whatever * (B-C) rotated 90;
  O - 1/2[A,B] = whatever * (A-B) rotated 90;

  sketchypaths;
  sketch_amount := 5bp;
  draw A--B--C--cycle;

  draw O withpen pencircle scaled 4bp;

  sketch_amount := 2bp;
  draw fullcircle scaled 2abs(O-A) shifted O;
endfig
___
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
___


Re: [NTG-context] [installing lmtx on raspi400]

2021-05-13 Thread Hans Hagen

On 5/13/2021 2:08 PM, Floris van Manen wrote:

No desktop system is complete before having a proper lmtx installed ;-)

So with this OS version

$ uname -a
Linux rp400 5.10.17-v8+ #1414 SMP PREEMPT Fri Apr 30 13:23:25 BST 2021 
aarch64 GNU/Linux


$ hostnamectl
    Static hostname: rp400
  Icon name: computer
   Operating System: Debian GNU/Linux 10 (buster)
     Kernel: Linux 5.10.17-v8+
   Architecture: arm64


I downloaded
context-linux-aarch64.zip


unzipped it in the ~/context folder and ran the install.sh script

$ sudo sh ./install.sh

this gives an error:

/home/pi/context/bin/mtxrun: /lib/aarch64-linux-gnu/libm.so.6: version 
`GLIBC_2.29' not found (required by /home/pi/context/bin/mtxrun)




Anyone with a hint ?


the 64 bit is generate on a rpi runing ubuntu so maybe more recent libs?

Hans

(makes me wonder if it runs on a rpi with windows)

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


Re: [NTG-context] Variable OTF font resulting in invalid font due to stack overflow

2021-05-13 Thread Hans Hagen

On 5/12/2021 11:46 PM, Marcel Fabian Krüger wrote:

Hi,

recently we got an interesting bug report in luaotfload (the original report
is at https://github.com/latex3/luaotfload/issues/184) which relates to the
ConTeXt fontloader. Take the following ConTeXt example:

 \starttext
 \definefontfeature [default:bold] [default] [axis={weight=500}]
 \definedfont[file:NotoSansCJKsc-VF.otf*default:bold @ 10pt]
 
 U+5E2E 帮
 
 \stoptext


The font is available at
https://github.com/googlefonts/noto-cjk/raw/main/Sans/Variable/OTF/NotoSansCJKsc-VF.otf.

This compiles correctly, but the CJK glyph do not appear since
it's Type2 CharString is invalid. The CFF2 CharStrings of this
glyph invokes the rrcurveto operator with 63 arguments, which is


66 etc .. multiples of 6


allowed in CFF2 where the argument limit is 513, but not allowed in
Type2 where the limit is at 48.


a rather low limit right from the start (we can assume only rrcurveto is 
affected)



It would be great if ConTeXt could check for this and insert additional
rrcuveto operators when necessary to avoid this issue.

after some experiments ... attached

(no upload yet as i'm renaming some low level helpers which needs testing)

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
-


largestack.pdf
Description: Adobe PDF document
\definefontfeature
  [default:bold]
  [default]
  [axis={weight=500}]

\definefontfeature
  [default:heavy]
  [default]
  [axis={weight=800}]

\definefontfeature
  [default:light]
  [default]
  [axis={weight=250}]

\definefont
  [DemoFontBold]
  [file:NotoSansCJKsc-VF.otf*default:bold @ 10pt]

\definefont
  [DemoFontHeavy]
  [file:NotoSansCJKsc-VF.otf*default:heavy @ 10pt]

\definefont
  [DemoFontLight]
  [file:NotoSansCJKsc-VF.otf*default:light @ 10pt]

\startTEXpage
\DemoFontBold  \char"5E2D\kern10pt\char"5E2E\kern10pt\char"5E2F\par
\DemoFontHeavy \char"5E2D\kern10pt\char"5E2E\kern10pt\char"5E2F\par
\DemoFontLight \char"5E2D\kern10pt\char"5E2E\kern10pt\char"5E2F
\stopTEXpage
___
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
___


[NTG-context] mathscript in math mode

2021-05-13 Thread Fabrice Couvreur
Hi,
Is it possible to run the macro in math mode ?
Thank you
Fabrice

 \usebodyfont  [stix]
 \setupbodyfont[modern]

 \setupmathematics[stylealternative=calligraphic]

 \unexpanded\def\CScript#1#2{\start\switchtobodyfont[stixtwo]
\m{{\mathscript{#1}}_{#2}}\stop}

 
\unexpanded\def\cscript#1{\start\switchtobodyfont[stixtwo]\m{{\mathscript{#1}}}\stop}

\starttext
\cscript{P}
\startformula
  \cscript{P}
\stopformula
\stoptext
___
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
___


Re: [NTG-context] Fuzzy lines

2021-05-13 Thread Henning Hraban Ramm

> Am 12.05.2021 um 23:21 schrieb Jairo A. del Rio :
>> Unfortunately, that’s the same pattern over and over.
>> The randomization is only applied once.
>> Good for footprints, bad for fuzzy patterns.
>> 
> You only need to move "randomized" at the drawing stage:
> 
> \starttext
> \startMPpage
> numeric u; u := 1mm;
> picture Pluma;
> Pluma := image(
>   for i = 1 upto 5:
>   for j = 1 upto 5:
>   draw (i,j);
>   endfor
>   endfor
> );

I made it into:

  picture NoisePattern;
  NoisePattern := image(
pickup pencircle xyscaled 0.5bp;
numeric pmax ; pmax := 7 ;
for i = 1 upto pmax:
for j = 1 upto pmax:
draw (i - (pmax/2), j - (pmax/2)) 
withcolor LineColor 
withtransparency ("normal", (uniformdeviate 0.33));
endfor
endfor
  );

Now the noise is randomly transparent and also on (and not over) the path.


> path Camino;
> Camino := origin for i = 1 upto 30: .. (u*i, u*sind (12i mod 360)) endfor;
> for i = 0 step 1/2 until length Camino:
>   draw Pluma randomized 1 rotated (90 + angle direction i of Camino)
>   shifted point i of Camino;
> endfor

And that became:

  def noisify(expr p) =
for i = 0 step 0.01 until length p:
draw NoisePattern randomized 1 shifted point i of p ;
endfor
  enddef;

I still need to account for the length of the path in the loop step.


> But "randomized" will deform paths. Maybe you want something like this?
> 
> \starttext
> \startMPpage[align=]
> begingroup;
> save Rnd; let Rnd = uniformdeviate;
> 
> numeric u; u := 3mm;
> picture Pluma;
> Pluma := image(
>   for i = 1 upto 5:
>   for j = 1 upto 5:
>   fill fullcircle shifted (i,j); %try fulltriangle or 
> another shape
>   endfor
>   endfor
> );
> path Camino;
> Camino := origin for i = 1 upto 30: .. u*i*left endfor;
> for i = 0 step 1/2 until length Camino:
>   draw image(
>   for x within Pluma:
>   fill pathpart x %Assuming our image only contains cyclic paths
>   scaled (1+Rnd 1)
>   shifted (1/2dir Rnd 360)
>   withcolor hsvtorgb(6round(Rnd 60),9/10,1); %Colors just because 
> they look cute
>   endfor
>   ) rotated (90 + angle direction i of Camino)
>   shifted point i of Camino;
> endfor
> endgroup;
> \stopMPpage
> \stoptext

>> Since I have more or less straight lines but of different length, the "one 
>> pattern per 1/n path segment" doesn’t work for me. I could try to construct 
>> my paths differently.
> You only need to use fractions, i.e., "for 0 step 1/n until 1: ... endfor" if 
> you work with straight lines defined using only two points.

Yes, I got that. But a fixed number (e.g. step 0.01 like above) doesn’t account 
for paths of different length.
I guess I’d need an algorithm like for dashed lines to get uniform noise on 
paths of different length.
(I also looked at dashpattern in the MP manual, but they’re not usable for 
patterns like this.)

Hraban

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


Re: [NTG-context] Fuzzy lines

2021-05-13 Thread Henning Hraban Ramm

> Am 11.05.2021 um 18:02 schrieb Aditya Mahajan :
> 
> Look at this old code on how hide such code behind a macro to have a clean 
> interface:
> 
> https://github.com/adityam/mp-sketch/blob/master/mp-sketch.mp

Hi Aditya,
I’m trying to include my additions into your code, but it doesn’t work.


numeric sketch_amount; sketch_amount := 3bp;
numeric sketch_passes; sketch_passes := 5;

def sketchdraw expr p =
  do_sketchdraw(p if (path p): randomized sketch_amount fi)
enddef;

def do_sketchdraw(expr p) text t =
normaldraw p t ;
enddef;


Now I want to draw that path several times.

If I understand it right, I can’t put that into "sketchdraw" because that 
leaves the end open for path additions like "withcolor".

But it also doesn’t work in "do_sketchdraw"; I thought it might like this:

def do_sketchdraw(expr p) text t =
for i=0 upto sketch_passes :
  normaldraw p t ; 
% withtransparency ("multiply", 1/sketch_passes) ; % and how can I add 
that without breaking other additions?
endfor
enddef;

But that just blocks, I guess there’s an infinite loop.

I’d be happy about some advise.

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


[NTG-context] [installing lmtx on raspi400]

2021-05-13 Thread Floris van Manen

No desktop system is complete before having a proper lmtx installed ;-)

So with this OS version

$ uname -a
Linux rp400 5.10.17-v8+ #1414 SMP PREEMPT Fri Apr 30 13:23:25 BST 2021 
aarch64 GNU/Linux


$ hostnamectl
   Static hostname: rp400
 Icon name: computer
  Operating System: Debian GNU/Linux 10 (buster)
Kernel: Linux 5.10.17-v8+
  Architecture: arm64


I downloaded
context-linux-aarch64.zip


unzipped it in the ~/context folder and ran the install.sh script

$ sudo sh ./install.sh

this gives an error:

/home/pi/context/bin/mtxrun: /lib/aarch64-linux-gnu/libm.so.6: version 
`GLIBC_2.29' not found (required by /home/pi/context/bin/mtxrun)




Anyone with a hint ?

Thx
.Floris


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


Re: [NTG-context] Variable OTF font resulting in invalid font due to stack overflow

2021-05-13 Thread Hans Hagen

On 5/12/2021 11:46 PM, Marcel Fabian Krüger wrote:

Hi,

recently we got an interesting bug report in luaotfload (the original report
is at https://github.com/latex3/luaotfload/issues/184) which relates to the
ConTeXt fontloader. Take the following ConTeXt example:

 \starttext
 \definefontfeature [default:bold] [default] [axis={weight=500}]
 \definedfont[file:NotoSansCJKsc-VF.otf*default:bold @ 10pt]
 
 U+5E2E 帮
 
 \stoptext


The font is available at
https://github.com/googlefonts/noto-cjk/raw/main/Sans/Variable/OTF/NotoSansCJKsc-VF.otf.

This compiles correctly, but the CJK glyph do not appear since
it's Type2 CharString is invalid. The CFF2 CharStrings of this
glyph invokes the rrcurveto operator with 63 arguments, which is
allowed in CFF2 where the argument limit is 513, but not allowed in
Type2 where the limit is at 48.

It would be great if ConTeXt could check for this and insert additional
rrcuveto operators when necessary to avoid this issue.


hm, i can try but not today -)


Additionally we got a report that inkscape 1.0 seems to be incompatible
with the way commmands are passed to it for SVG files. Hendrik Seliger
suggested to set f_convert (defined in font-ocl.lua, otfsvg.topdf, line 435)
to `formatters["file-open:%s; export-%s:%s; export-do\n"]` when a new
inkscape version is detected. (See 
https://github.com/latex3/luaotfload/issues/183)
I wasn't able to reproduce the issue in ConTeXt yet.
context tries to identify the version and adapt (as it will take a while 
before 1.0 ends up in linux distributions) but last week i noticed some 
strange xml related messages so i need to look at that


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
___


Re: [NTG-context] \char not working with private unicodes

2021-05-13 Thread Hans Hagen

On 5/13/2021 8:46 AM, Sergio Callegari wrote:

On 5/11/2021 2:08 PM, Jairo A. del Rio wrote:

Hi, list! Following this thread:
https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint 

, 


I tried to replicate it in ConTeXt. Both LMTX and LMTX fail to display
the right symbol and, as it's discussed in the linked page, there's an
offset by 14. Is this intentional (in ConTeXt)? A bug?


Hi! As the original poster of the stackexchange question, I have found 
this thread and I am quite grateful for your attention on the topic!


In fact, I am a LaTeX user and this is just one more reason why I am 
quite grateful to the ConTeXt community, since some progress that is 
recently being enjoyed in LaTeX including the nice support for unicode 
fonts derives from ConTeXt, I understand.


I would like to add a pointer to the thread at 
https://github.com/latex3/luaotfload/issues/185#issuecomment-839640563.


For luaotfload the issue is currently being marked as wontfix, since the 
relevant code and the node shaper come from ConTeXt. If some improvement 
is made in ConTeXt, I am pretty sure that luaotfload will benefit from 
it though and I would like to thank in advance! I already see progress 
on retaining the glyph names is being made.


It is my understanding (please correct me if I am wrong) that the 
visible issues get triggered by multiple circumstances playing together 
at once:


- the fact that the current codebase does a name-based remapping of 
glyphs also for glyphs that are explicitly PUA-encoded;


- the fact that some errors with some glyphnames in the ttf font cause 
the current code-base to drop the names so that the chars cannot be 
accessed by name;


- the fact that some naming mistake seems to be present in the ttf font 
(at least with respect to the tabled 
codepoint-glyphname-glyphappearance) actually introducing some duplicates.


If this is correct, I wonder if it can make sense to open an issue on 
the font development site (and maybe keep today's version of the ttf as 
a test case should there be some change in ConTeXt wrt the glyph name 
handling and remapping).
A next upload will scan the names (read: i commented the possible catch 
for issues, let's see when the font that needed that pops up again).


The renaming of bad glyphs can technically be fixed but a runtime hack 
but i try to avoid that .. the more heuristics, the harder to fight.


You can try to patch luaotfload. Locate the 'report' line and comment 
those two as below.



 local length = readbyte(f)
   if length > 0 then
   glyphs[mapping].name = readstring(f,length)
   else
-- report("quit post name fetching at %a of %a: 
%s",i,maxnames,"overflow")

-- break
   end

Did you try to use the regular variant:

\starttext
\definefontfeature[materialicons][default][rlig=yes]
\definedfont[file:materialiconsregular.ttf*materialicons]
baby_changing_station % selects symbol as ligature
\stoptext

(in latex equivalent) .. keep in mind that 'web' fonts are often more 
minimalistic, so i never use them (when there's a real one).


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
___


[NTG-context] \char not working with private unicodes

2021-05-13 Thread Sergio Callegari

On 5/11/2021 2:08 PM, Jairo A. del Rio wrote:

Hi, list! Following this thread:
https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint 

, 


I tried to replicate it in ConTeXt. Both LMTX and LMTX fail to display
the right symbol and, as it's discussed in the linked page, there's an
offset by 14. Is this intentional (in ConTeXt)? A bug?


Hi! As the original poster of the stackexchange question, I have found 
this thread and I am quite grateful for your attention on the topic!


In fact, I am a LaTeX user and this is just one more reason why I am 
quite grateful to the ConTeXt community, since some progress that is 
recently being enjoyed in LaTeX including the nice support for unicode 
fonts derives from ConTeXt, I understand.


I would like to add a pointer to the thread at 
https://github.com/latex3/luaotfload/issues/185#issuecomment-839640563.


For luaotfload the issue is currently being marked as wontfix, since the 
relevant code and the node shaper come from ConTeXt. If some improvement 
is made in ConTeXt, I am pretty sure that luaotfload will benefit from 
it though and I would like to thank in advance! I already see progress 
on retaining the glyph names is being made.


It is my understanding (please correct me if I am wrong) that the 
visible issues get triggered by multiple circumstances playing together 
at once:


- the fact that the current codebase does a name-based remapping of 
glyphs also for glyphs that are explicitly PUA-encoded;


- the fact that some errors with some glyphnames in the ttf font cause 
the current code-base to drop the names so that the chars cannot be 
accessed by name;


- the fact that some naming mistake seems to be present in the ttf font 
(at least with respect to the tabled 
codepoint-glyphname-glyphappearance) actually introducing some duplicates.


If this is correct, I wonder if it can make sense to open an issue on 
the font development site (and maybe keep today's version of the ttf as 
a test case should there be some change in ConTeXt wrt the glyph name 
handling and remapping).


Best

Sergio



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