[NTG-context] Re: text width shadow background

2023-07-07 Thread Henning Hraban Ramm
Please, can you explain why the result of lmt_outline is shifted to the 
right, if I use it in a macro?



"""
\setupbodyfont[ss,24pt]
\definecolor[tshade][t=.05,a=1,k=1]

\starttexdefinition MyCaption #1
\startMPcode
steps := 5 ; % number of shadow layers
rulesize := BodyFontSize/steps/3;
for step = 1 upto steps:
draw lmt_outline [
text = "\bf\strut #1",
kind = "fillup",
fillcolor = "tshade",
rulethickness = (step*rulesize),
];
endfor;
draw lmt_text [
text = "\bf\strut #1",
%style = "bold",
color = "white",
] yshifted (BodyFontSize*2/3); % TODO
\stopMPcode
\stoptexdefinition


\starttext

% this is OK
\startMPcode
draw lmt_outline [
text = "\bf\strut The quick brown fox jumps over the lazy dog.",
kind = "fillup",
fillcolor = "blue",
rulethickness = 2,
];
\stopMPcode

% here the shadow gets a different offset each time –
% the longer the text, the bigger the offset

\MyCaption{The quick brown fox jumps over the lazy dog.}

\MyCaption{Eine wunderschöne Bildunterschrift}

\MyCaption{Ein ganz anderer Text}

\stoptext
"""

BTW I recognized I need this not only for captions within images but 
also for the glow effect in the CCCamp23 style:

https://events.ccc.de/camp/2023/infos/styleguide.html

InDesign etc. create for stuff like this a pixel image including the 
background – we can do better and keep this vector-only. ;)


Hraban
___
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] Re: context-on-web broken

2023-07-07 Thread Mikael Sundqvist
On Fri, Jul 7, 2023 at 11:19 PM Aditya Mahajan  wrote:
>
> On Mon, 26 Jun 2023, Hans Hagen via ntg-context wrote:
>
> > On 6/26/2023 7:53 PM, Aditya Mahajan via ntg-context wrote:
> > > On Mon, 26 Jun 2023, Miguel Diaz via ntg-context wrote:
> > >
> > >> indeed it is a simple simulation of overleaf (for latex).
> > >
> > > FWIW, context works on overleaf as well!
> > >
> > > Simply create a `latexmkrc` file with the following content:
> > >
> > > ```
> > > $pdflatex="context --synctex=1 --result=output %S; cp output.log
> > > /compile/output.log;cp output.pdf /compile/output.pdf";
> > > $recorder=0;
> > > $pdf_mode=1;
> > I found back this link:
> >
> > https://davidcarlisle.github.io/latexcgi/testc
> >
> >
> > % !TEX mtxrun --script context
> >
> > \starttext
> >
> > \dorecurse{500}{\samplefile{tufte}\par}
> >
> > \stoptext
> >
> > Runs 113 pages in 1.13 sec so quite ok for a remote un I guess.
> >
> > I'm not sure how up to date it is.
>
> 2023.05.05 18:36, so very recent.
>
> https://texlive.net/run?%25!TEX%20mtxrun%20--script%20context%0A%0A%5Cstarttext%0A%5Ccontextversion%0A%5Cstoptext%0A
>
> Aditya

David kindly made available

https://texlive.net/run?context

to start with a minimal context file. This is very convenient for
small tests if one happens to be at a computer that does not have
context installed (why that would be).

/Mikael
___
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] Re: context-on-web broken

2023-07-07 Thread Aditya Mahajan
On Mon, 26 Jun 2023, Hans Hagen via ntg-context wrote:

> On 6/26/2023 7:53 PM, Aditya Mahajan via ntg-context wrote:
> > On Mon, 26 Jun 2023, Miguel Diaz via ntg-context wrote:
> > 
> >> indeed it is a simple simulation of overleaf (for latex).
> > 
> > FWIW, context works on overleaf as well!
> > 
> > Simply create a `latexmkrc` file with the following content:
> > 
> > ```
> > $pdflatex="context --synctex=1 --result=output %S; cp output.log
> > /compile/output.log;cp output.pdf /compile/output.pdf";
> > $recorder=0;
> > $pdf_mode=1;
> I found back this link:
> 
> https://davidcarlisle.github.io/latexcgi/testc
> 
> 
> % !TEX mtxrun --script context
> 
> \starttext
> 
> \dorecurse{500}{\samplefile{tufte}\par}
> 
> \stoptext
> 
> Runs 113 pages in 1.13 sec so quite ok for a remote un I guess.
> 
> I'm not sure how up to date it is.

2023.05.05 18:36, so very recent.

https://texlive.net/run?%25!TEX%20mtxrun%20--script%20context%0A%0A%5Cstarttext%0A%5Ccontextversion%0A%5Cstoptext%0A

Aditya
___
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] Re: Why is the fonts database not updated?

2023-07-07 Thread Thangalin
I've used the following without any troubles for a few years now:

$ cat ~/bin/fontcache
#!/usr/bin/env bash

fc-cache -fv
mtxrun --generate
mtxrun --script fonts --reload
___
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] regular online meet-up

2023-07-07 Thread Henning Hraban Ramm

You’re invited to join on Wednesday, July 12th, 15:00 CEST (UTC+2)

at https://lecture.senfcall.de/hen-rbr-rku-oke
(same, but shorter: https://v34h.de/ctxmtg)

ConTeXt users of all levels are welcome!

This is directly before the TUG/DANTE conference; you can get a preview 
of my talk for Bonn ;)


Next meeting will be on August 9th.

And this is just before the Chaos Communication Camp, where I’ll give 
ConTeXt talks/workshops, too.



(Same blurb as every time:)

[Howto]
* No special software installation required; most modern browsers should 
work (WebRTC required).

* Open the above URL, accept the privacy statement,
* enter your name,
* click "join" (or "start" if you’re the first),
* click "with microphone", allow your browser to access it, check the audio.
* Your microphone is muted if you join. Activate microphone and/or 
camera with the buttons at the bottom.

* Minimize the default presentation with the "screen" button, bottom right.

* If you’d like to share your screen or upload a file, you can make 
yourself the presenter: Click on your user name, change the setting, 
then you’ll see the "screen sharing" button beside the camera button; 
also there’s now "manage presentations" behind the "plus" button.
Beware there is only one presenter at a time, so don’t kill someone 
else’s presentation.


[Technical hints]
* Sound is usually better if you use a headset (less noise for everyone).
* Connection problems are mostly due to low bandwidth or high latency on 
your side, e.g. with mobile connections.

* If audio/video doesn’t work for you, you can still use the text chat.
* Screen sharing needs a lot of bandwidth.
* BigBlueButton documentation applies: 
https://bigbluebutton.org/teachers/tutorials/


[Netiquette]
* Please use a name that we recognize from here. Some feel uncomfortable 
with anonymous lurkers.

* Mute your microphone while you’re not talking.
* It’s nice to show your face at least when you join.
* If there are connection problems, stop camera sharing.
* The room is set to “everyone’s a moderator“, I trust you...

See you, Hraban
___
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] Re: lpdf.registerfontmethod

2023-07-07 Thread Hans Hagen via ntg-context

On 7/7/2023 4:51 AM, Max Chernoff wrote:

Hi Hans,

In lpdf-emb.lmt, there's a commented-out definition of
lpdf.registerfontmethod that I'd like to use. I've uncommented this in
my installation and it's worked pretty well for me, so can you please
uncomment/enable this by default in the distribution?


I'll check it but no time today.

btw ... as you like low level hacking ...

pdftex has a mechanism called pgc (pdf glyph containers) and these are 
used when no pk font is found (which also means: no map entry)


\pdffont ... =
\pdfscale 1000
\pdfglyph 1 100 0 0 100 100
... pdf code ...
\pdfendglyph
\pdfendfont

of course one needs a matching tfm file. I searched my disk but it looks 
like i removed all the test files of those times.  It was some 
playground for Thanh and me in the good old pdftex dev days but the 
outlines from mp at that time were not good enough to use in these 
containers. (It was when the mp to pdf conmverter showed up in context 
mkii.) One or these now obsolete sub projects; it was kind of fun 
anyway. Other experiments, like with saving positions (which originally 
was a context feature that involved betweeen run dvi parsing with 
dvipos) did make it into a stable feature eventually (read: documented).


The code is still there (in write3.c) but I bet that there is no 
documentation.


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] Re: \showmakeup adds unwanted space despite accurate readings; \qquad mandatory before \TeX\

2023-07-07 Thread Hans Hagen via ntg-context

On 7/7/2023 1:09 PM, Carlos wrote:


\showmakeup displays it astonishingly correctly indeed
probably a side effect of the fact that injected stuff resynchronizes 
the character progression in the pdf file (every char start with 
explicit coordinates) while without showing it depends on the width 
array so when that one is wrong (could be a side effect of some bad 
metric in the font file like units, possibly reported in the log) you 
can get wrong positioning


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] Re: \showmakeup adds unwanted space despite accurate readings; \qquad mandatory before \TeX\

2023-07-07 Thread Carlos
On Thu, Jul 06, 2023 at 12:57:57PM -0400, Carlos wrote:
> On Thu, Jul 06, 2023 at 09:16:58AM -0400, Carlos wrote:
> > On Wed, Jul 05, 2023 at 06:52:30PM +0200, Hans Hagen wrote:
> > > On 7/5/2023 6:38 PM, Carlos wrote:
> > > > On Wed, Jul 05, 2023 at 06:12:32PM +0200, Hans Hagen wrote:
> > > > > On 7/5/2023 5:53 PM, Carlos wrote:
> > > > > > On Wed, Jul 05, 2023 at 04:43:56PM +0200, Hans Hagen wrote:
> > > > > > > On 7/5/2023 3:18 PM, Carlos wrote:
> > > > > > > > \showmakeup on \TeX\ shows a
> > > > > > > > 
> > > > > > > > tSP:3.282
> > > > > > > > THK:-1.721
> > > > > > > > H__E
> > > > > > > > X
> > > > > > > > HK:-1.291
> > > > > > > > SP:3.282
> > > > > > > 
> > > > > > > no MWE includes so clueless
> > > > > > 
> > > > > > \starttypescript[mylucidaserif]
> > > > > > \definefontsynonym[LucidaBrightRegular]
> > > > > > [file:LucidaBrightRegular]
> > > > > > \definefontsynonym[LucidaBrightItalic] 
> > > > > > [file:LucidaBrightItalic]
> > > > > > \definefontsynonym[LucidaBrightDemiBold]   
> > > > > > [file:LucidaBrightDemiBold]
> > > > > > \definefontsynonym[LucidaBrightDemiItalic] 
> > > > > > [file:LucidaBrightDemiItalic]
> > > > > > \stoptypescript
> > > > > Hm, isn't that this lucida rip off again? Maybe bad metricks then but 
> > > > > I'm
> > > > > not going to look into that as the official TUG lucida opentype fonts
> > > > > perform okay.
> > > > > 
> > > > > Hans
> > > > 
> > > > The first sentence is irrelevant. And a guess. Bad metrics is not the
> > > > culprit
> > > > 
> > > > if it were true, the same problem would be under lualatex, correct?
> > > 
> > > well, who knows what (me)tricks those fonts have embedded .. are these the
> > > official TUG lucida open type fonts? if so,
> > > 
> > > \setupbodyfont[lucida]
> > > 
> > > should just work (btw, you also don't set up math)
> > > 
> > > > But it's not there.
> > > I can't (and won't) check that as I don't have (lua)latex installed nor 
> > > have
> > > those fonts. I also don't see where this \qquad is in your example.
> > 
> > 
> > Using the same fonts under lualatex yields \TeX\ without an issue. 
> > 
> > \documentclass{article}
> > 
> > \usepackage{unicode-math}
> > 
> > \defaultfontfeatures{Ligatures=TeX}
> > 
> > \setmainfont[
> >   ItalicFont=LucidaBrightItalic,
> > BoldFont=LucidaBrightDemiBold,
> >   BoldItalicFont=LucidaBrightDemiItalic,
> >   ]{LucidaBrightRegular}
> > %
> > \setsansfont[
> >   ItalicFont=LucidaSansOblique,
> > BoldFont=LucidaSansDemiBold,
> >   BoldItalicFont=LucidaSansDemiOblique,
> >   ]{LucidaSansRegular}
> > %
> > \setmonofont[
> > %  ItalicFont=LucidaTypewriterOblique,
> > BoldFont=LucidaTypewriterBold,
> > %  BoldItalicFont=LucidaTypewriterBoldOblique,
> >   ]{LucidaTypewriterRegular}
> > 
> > \begin{document}
> > 
> > {\rm\input{knuth}}
> > 
> > \textsf{\input{knuth}}
> > 
> > \end{document}
> > 
> > > 
> > > As for the \showmakup ... it is used extensively and afaiks there are no
> > > issues with it.
> > 
> > After running lualatex the problem dissappears. Or it seems like it. 
> > 
> 
> I take it back. It doesn't disappear. It's still there.  \showmakeup
> yields the right readings but yet the kerning is off on \TeX\.
> 
> With \showmakeup everything ‹seems› correct. I guess the readings
> output are correct, and also, amazingly, the horizontal kerning,
> as you aptly named it, for \TeX\
> 
> Not under lualatex. Everytihng seems fine there.
> 
> But I perfectly understand that there would not be any support for these
> fonts. Thanks though! 
> 
> (trying to send this message with an attachment as before but it wouldn't
> go through) 


In other words, and please, just ignore my message. 

But it seems as if \showmakeup masks the problem. Dont' get me wrong, I
find \showmakeup output as one of the best indicators out there. 

But if one were to say 

{\rm \qquad{\!\!\!\!\!\!\!\!\!\!\!hurt \TeX\ significantly}}

the readings are quite probably as accurate as readings can ever be, but
at the same time, \TeX\ is displayed perfectly, which shouldn't have. 

It really doesn't matter how many quad quad quad quad happened to be, or
how many negative spaces happened to be included, because it never gets
it quite right unless \showmakeup is used 

This is quite interesting actually. 

If, for example, with \showmakeup, one were to say within the same document 

\hbox to 1cm{\ss \input{knuth}}

or rather, \vbox to 1cm{\ss \input{knuth}} or whatever

\showmakeup displays it astonishingly correctly indeed

anyhow


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