Re: [NTG-context] Using Gill Sans on macOS

2021-02-22 Thread Gerben Wierda

> On 22 Feb 2021, at 17:59, Henning Hraban Ramm  wrote:
> 
> 
> 
>> Am 22.02.2021 um 16:14 schrieb Gerben Wierda :
>> 
>> I’m normall using Optima Nova on my system, e.g. by defining a font like 
>> this:
>> 
>> 
>> \definefontfamily
>>[archimate]
>>[ss]
>>[Optima nova LT Pro]
>>[tf=style:Medium,
>> bf=style:Bold,
>> it=style:Medium Italic,
>> bi=style:Bold Italic]
>> \setupbodyfont[archimate]
>> 
>> I would like to experiment with Gill Sans, but that fails with
>> 
>> fonts   > defining > unable to define 'GillSans.ttc' as 
>> 'archimate-14pt-ss-tf-0--0'
>> 
>> It is here:
>> 
>> /System/Library/Fonts/Supplemental/GillSans.ttc
>> 
>> What should I do to be able to use that font?
> 
> Hi Gerben!
> 
> Sometimes ConTeXt can’t find the subfonts in TTCs, e.g.:
> 
> $ mtxrun --script fonts --list --all --pattern=Gill
> identifierfamilyname   fontname  filename 
>  subfont   instances
> 
> gillsans  gillsans gillsanslightitalic   
> /Library/Fonts/GillSans.ttc   9
> gillsanslight gillsans gillsanslightitalic   
> /Library/Fonts/GillSans.ttc   9
> gillsanslightitalic   gillsans gillsanslightitalic   
> /Library/Fonts/GillSans.ttc   9
> 
> 
> Only after
> $ mtxrun --script fonts --reload --force

Hi Henning!

Thanks, that was what I needed. Apparently, the update from macOS Mojave to 
macOS Catalina had moved the Gill Sans font so I had to do teh reload.

Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>)
R Enterprise Architecture <https://ea.rna.nl/> (main site)
Book: Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>



> I got:
> 
> $ mtxrun --script fonts --list --all --pattern=Gill
> identifier   familyname   fontname filename   
>subfont   instances
> 
> gillsans gillsans gillsans 
> /Library/Fonts/GillSans.ttc   1
> gillsansblackgillsans gillsansultrabold
> /Library/Fonts/GillSans.ttc   7
> gillsansbold gillsans gillsansbold 
> /Library/Fonts/GillSans.ttc   2
> gillsansbolditalic   gillsans gillsansbolditalic   
> /Library/Fonts/GillSans.ttc   4
> gillsansitalic   gillsans gillsansitalic   
> /Library/Fonts/GillSans.ttc   3
> gillsanslightgillsans gillsanslight
> /Library/Fonts/GillSans.ttc   8
> gillsanslightitalic  gillsans gillsanslightitalic  
> /Library/Fonts/GillSans.ttc   9
> gillsansnormal   gillsans gillsans 
> /Library/Fonts/GillSans.ttc   1
> gillsansregular  gillsans gillsans 
> /Library/Fonts/GillSans.ttc   1
> gillsanssemibold gillsans gillsanssemibold 
> /Library/Fonts/GillSans.ttc   5
> gillsanssemibolditalic   gillsans gillsanssemibolditalic   
> /Library/Fonts/GillSans.ttc   6
> gillsansultraboldgillsans gillsansultrabold
> /Library/Fonts/GillSans.ttc   7
> 
> Please check this on your system, and then try the names of the first column.
> 
> 
> 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
> ___

___
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] Using Gill Sans on macOS

2021-02-22 Thread Gerben Wierda
I’m normall using Optima Nova on my system, e.g. by defining a font like this:


\definefontfamily
[archimate]
[ss]
[Optima nova LT Pro]
[tf=style:Medium,
 bf=style:Bold,
 it=style:Medium Italic,
 bi=style:Bold Italic]
\setupbodyfont[archimate]

I would like to experiment with Gill Sans, but that fails with

fonts   > defining > unable to define 'GillSans.ttc' as 
'archimate-14pt-ss-tf-0--0'

It is here:

/System/Library/Fonts/Supplemental/GillSans.ttc

What should I do to be able to use that font?

Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>)
R Enterprise Architecture <https://ea.rna.nl/> (main site)
Book: Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>

___
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] Question about parsing XML and attributes (normally var.at.attrib) with a name with ':' in it

2021-02-14 Thread Gerben Wierda
foo.at[“attribute:B”]

I looked at the code and guessed this. Still haven’t found really good 
documentation for lua, lua in ConTeXt, and especially theXML stuff (it’s all 
written as \xmlsomething TeX commands. No idea if this is ConTeXt, lua or 
whatever but it works.

Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>)
R Enterprise Architecture <https://ea.rna.nl/> (main site)
Book: Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>

> On 14 Feb 2021, at 22:40, Gerben Wierda  wrote:
> 
> If I have an XML element like this:
> 
> 
> 
> and it has been read in a lua variable foo, I can get at attribute x with 
> foo.at <http://foo.at/>.x 
> 
> But how do I get at attribute:B?
> 
> Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>)
> R Enterprise Architecture <https://ea.rna.nl/> (main site)
> Book: Chess and the Art of Enterprise Architecture 
> <https://ea.rna.nl/the-book/>
> Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>
> 
> ___
> 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] Question about parsing XML and attributes (normally var.at.attrib) with a name with ':' in it

2021-02-14 Thread Gerben Wierda
If I have an XML element like this:



and it has been read in a lua variable foo, I can get at attribute x with 
foo.at.x 

But how do I get at attribute:B?

Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>)
R Enterprise Architecture <https://ea.rna.nl/> (main site)
Book: Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>

___
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] Minimum METAPOST code produces problematic PDF

2020-07-11 Thread Gerben Wierda


> On 9 Jul 2020, at 08:37, Aditya Mahajan  wrote:
> 
> On Wed, 8 Jul 2020, Gerben Wierda wrote:
> 
>> I found out this in the PDF spec:
>> 
>> The minimum page size should be 3 by 3 units in default user space; the 
>> maximum should be 14,400 by 14,400 units.
> 
> So, does the following work:
> 
> \startMPpage[instance=doublefun, offset=2pt]
>  draw (0,0)--(100,0) dashed withdots;
> \stopMPpage

Yes.

G
___
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] Minimum METAPOST code produces problematic PDF

2020-07-09 Thread Gerben Wierda
The minimum is a relative one:

It is page 650 in the (normative) Annex C Implementation Limits for PDF readers 
and writers:

Additionally, conforming writers should adhere to the following constraints, 
and conforming readers should accommodate PDF files that obey the constraints. 
The minimum page size should be 3 by 3 units in default user space; the maximum 
should be 14,400 by 14,400 units. In versions of PDF earlier than 1.6, the size 
of the default user space unit was fixed at 1⁄72 inch, yielding a minimum of 
approximately 0.04 by 0.04 inch and a maximum of 200 by 200 inches. Beginning 
with PDF 1.6, the size of the unit may be set on a page-by-page basis; the 
default remains at 1/ 72 inch. 

In other words: you need to change the unit per page so the page is at least 
3x3 and maximally 14400x14400.


> On 9 Jul 2020, at 12:10, Hans Hagen  wrote:
> 
> On 7/9/2020 9:08 AM, Taco Hoekwater wrote:
>>> On 9 Jul 2020, at 08:32, Hans Hagen  wrote:
>>> 
>>> On 7/8/2020 8:14 PM, Gerben Wierda wrote:
>>>> I found out this in the PDF spec:
>>>> The minimum page size should be 3 by 3 units in default user space; the
>>> 
>>> I never noticed that ... what section/paragraph in the spec?
>> It’s in the implementation limits for Acrobat, not in the normative section.
> 
> Great. That used to be 1 bp so now it's more. As it happens, we do have a 
> check for this in context so we can adapt it ... but, as this 3 bp is kind of 
> arbitrary and because 3 bp becomes a float and thereby ends up slightly less 
> than the integer 3 we can best play safe and revert to the usual tex joke, so 
> i now set the minumum to
> 
>  \luaexpr{math.pi}\onebasepoint
> 
> which then gives:
> 
>  /MediaBox [ 0 0 3.141539539 3.141539539 ] because after all, any rediculous 
> minimum will do and that way a user can still figure out that it's a value 
> set by context.
> 
> 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
___


Re: [NTG-context] Minimum METAPOST code produces problematic PDF

2020-07-08 Thread Gerben Wierda
I found out this in the PDF spec:

The minimum page size should be 3 by 3 units in default user space; the maximum 
should be 14,400 by 14,400 units.

Apparently, Adobe InDesign demands that in a hard way.

G

> On 8 Jul 2020, at 01:08, Jairo A. del Rio  wrote:
> 
> Evince and Okular (Linux) open the PDF output without warnings nor issues.
> 
> Jairo :)
> 
> El mar., 7 de jul. de 2020 a la(s) 17:50, Gerben Wierda (gerben.wie...@rna.nl 
> <mailto:gerben.wie...@rna.nl>) escribió:
> The following code:
> 
> \startMPpage[instance=doublefun]
>   draw (0,0)--(100,0) dashed withdots;
> \stopMPpage
> 
> When run through LuaMetaTeX produces a PDF about which Acrobat complains:
> 
>   The dimensions of this page are out-of-range. Page content might be 
> truncated.
> 
> and Adobe InDesign cannot handle it at all (displays empty). 
> 
> The error message stays with
> 
> \startMPpage[instance=doublefun]
>   draw (0,0)--(100,0)—(100,2) dashed withdots;
> \stopMPpage
> 
> but disappears with
> 
> \startMPpage[instance=doublefun]
>   draw (0,0)--(100,0)—(100,3) dashed withdots;
> \stopMPpage
> 
> 
> Additionally, on the Adobe forums I have been told:
> 
>   Also, the color space is device gray (not RGB or CMYK)
> 
> which might be a more generic problem with LMTX output, I don’t know. It 
> might also be an Adobe problem. Previw.app on macOS handles the result 
> without problems.
> 
> ConTeXt standalone:
> 
> This is LuaMetaTeX, Version 2.06.02 
> open source > level 1, order 1, name 'cont-yes.mkiv'
> system  > 
> system  > ConTeXt  ver: 2020.05.12 16:21 MKIV beta  fmt: 2020.5.16  
> int: english/english
> 
> 
> G
> 
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
> http://www.ntg.nl/mailman/listinfo/ntg-context 
> <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
> http://context.aanhet.net <http://context.aanhet.net/>
> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
> <https://bitbucket.org/phg/context-mirror/commits/>
> wiki : http://contextgarden.net <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
> ___

___
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] Minimum METAPOST code produces problematic PDF

2020-07-07 Thread Gerben Wierda
The following code:

\startMPpage[instance=doublefun]
  draw (0,0)--(100,0) dashed withdots;
\stopMPpage

When run through LuaMetaTeX produces a PDF about which Acrobat complains:

The dimensions of this page are out-of-range. Page content might be 
truncated.

and Adobe InDesign cannot handle it at all (displays empty). 

The error message stays with

\startMPpage[instance=doublefun]
  draw (0,0)--(100,0)—(100,2) dashed withdots;
\stopMPpage

but disappears with

\startMPpage[instance=doublefun]
  draw (0,0)--(100,0)—(100,3) dashed withdots;
\stopMPpage


Additionally, on the Adobe forums I have been told:

Also, the color space is device gray (not RGB or CMYK)

which might be a more generic problem with LMTX output, I don’t know. It might 
also be an Adobe problem. Previw.app on macOS handles the result without 
problems.

ConTeXt standalone:

This is LuaMetaTeX, Version 2.06.02 
open source > level 1, order 1, name 'cont-yes.mkiv'
system  > 
system  > ConTeXt  ver: 2020.05.12 16:21 MKIV beta  fmt: 2020.5.16  
int: english/english


G


___
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] Which lua XML library is embedded in LMTX?

2020-06-25 Thread Gerben Wierda
According to the XML manual:

<< 2.1 >> TEX versus LUA

It will not come as a surprise that we can access xml files from TEX as well as 
from Lua. In fact there are two methods to deal with xml in Lua. First there 
are the low level xml functions in the xml namespace. On top of those functions 
there is a set of functions in the lxml namespace that deals with xml in a more 
TEXie way.

<< 3.7 >> manipulation

You can use Lua code to manipulate the tree and it makes no sense to duplicate 
this in TEX. In the future we might provide an interface to some of this 
functionality. Keep in mind that manipuating the tree might have side effects 
as we maintain several indices into the tree that also needs to be updated 
then. 


Having read that, I was loooking for the documentation of the commands that are 
available in the xml namespace. I want to manipulate a XML tree in LMTX lua. 
But looking online gives me all kinds of different XML-solutions that are 
proposed for lua. Which one is embedded in LMTX and available in the xml 
namespace? But then I get confused because other elements like xml.first, 
xml.collected are in the xml namespavce and mentioned.

So, maybe I misunderstand things and is the documentation in 

<< 5.5 >> selectors and injectors

This section describes a bit special feature, one that we needed for a project 
where we could not touch the original content but could add specific sections 
for our own purpose. Hopefully the example demonstrates its useability. 

But that part I do not understand.

What I need (in LMTX lua) to add (sub)nodes to the XML node (that I read with 
xml.first()) because the data I get is broken and I need to fix it before I can 
use it (and I cannot get good data) The easiest way is to add the correct data 
to the XML and then use it in my code. If I cannot do that I need to write 
parallel code that largely does the same as what I already have (ugh)..

G___
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] METAPOST's uniformdeviate is not truly random (seed)

2020-06-23 Thread Gerben Wierda
I’m trying to get a real random number in METAPOST

MWE:

\startMPpage[instance=doublefun]
show uniformdeviate 60;
\stopMPpage

Every time I run this, it shows the same result. I tried playing around with 
the randomseed, but for instance when I do two runs shortly after each other 
they still are very predictable. E.g. this in METAPOST:

  whatever = lua( "math.randomseed( 
tonumber(tostring(os.time()):reverse():sub(1,6)) )");
  randomseed := lua.math.random();
  minutespast := uniformdeviate 60;

Called shortly after each other (two LMTX runs) gets me the same result.

What is a good way to get better random numbers in METAPOST (LMTX)?

Thanks,

G
___
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] How could I find the 'depth' of an element found with xml.first()?

2020-06-18 Thread Gerben Wierda
Given the following XML snippet






OmaFoo











How would I go about to find the depth of an item found with an LPATH? E.g.

//[id="Foo_3"] would find a node at depth 2 (assuming  is at level 0) 
while //[id=“Fuzz_2"] would find a node at depth 3 and in either cases I would 
like to get that number (2 or 3) as well as the actual node. I can assume the 
values for ‘id’  are unique.

I was wondering how I could go about finding the ‘depth’ of an item in the XML 
when using the LMTX built-in functions to work with XML. I don’t think there is 
a default function for that, is there?

G
___
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] accessing xml element attributes in lua, how, if you do not want to use the .at scheme?

2020-06-09 Thread Gerben Wierda
I’ve been trying to find out how I can access XML node properties/attributes in 
lua other than via the .at syntactic scheme but using the property/attribute 
name as a string.

E.g., currently I do:

someVar = someNode.at.someProperty

but I would like to do something like

someVar = someNode[“someProperty”] or someNode.attribute(“someProperty”) or 
something where I can use the string version of the properties/attribute name.

It’s probably possible (after all these are all dynamic structures that come 
from data), but how exactly?

Thanks,

G

___
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] LMTX lua xml interface: xml.tag()?

2020-06-02 Thread Gerben Wierda
According to the mkiv manual, there is a \xmltag which I think should translate 
to xml.tag() in lua.

But while xml.name() works, xml.tag() fails:

attempt to call a nil value (field 'tag')

Should xml.tag() work?

G___
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] Dangerous bend metafont/post code?

2020-05-28 Thread Gerben Wierda
I’ve used:\startMPpage[instance=doublefun]% Inspired by and largely copied from Donald Knuth's METAFONT dangerous bend glyphh=11;u=h/15;w=h*8.5/4.6;heavyline=2;y1=25/27h;x4=0;x1+x1=x1a+x1b=x4b+x2a=x4+x2=x4a+x2b=x3b+x3a=x3+x3=w;x4a=x4b=x4+u; x3b=x1a=x1-2u;y4+y4=y4a+y4b=y3b+y1a=y3+y1=y3a+y1b=y2b+y2a=y2+y2=0;y1a=y1b=y1-2/27h; y4b=y2a=y4+4/27h;path signboard; signboard := z1a..z1..z1b---z2a..z2..z2b---  z3a..z3..z3b---z4a..z4..z4b---cycle;  % signboardfill signboard withcolor yellow;x10=x11=x12=x13=(.5w-u); x14=x15=x16=x17=w-x10;y10=y14=28/27h+epsilon; y13=-h*(6.6/4.1);z11=(z10..z13) intersectionpoint (z1a{z1a-z4b}..z1{right});y15=y11; y16=y12=-y11; y17=y20=y21=y13;path toppost; toppost := z1 -- z11 -- z10 -- z14 -- z15 -- cycle;path bottompost; bottompost := z3 -- z16 -- z17 -- z13 -- z12 -- cycle;fill toppost withcolor .5white;fill bottompost withcolor .5white;draw signboard;draw z11--z10--z14--z15; draw z12--z13; draw z16--z17;  % signpostx20=w-x21; x21-x20=16u; draw z20--z21;  % ground levelx38=w-x31; x38-x31=8u; x32=x34=x38; x31=x35=x37;y31=-y38=12/27h; y32=-y37=9/27h; y34=-y35=3/27h;pickup pencircle scaled heavyline;draw z32{z32-z31}..z34---z35..z37{z38-z37};  % the dangerous bendpickup penrazor xscaled heavyline rotated (angle(z32-z31)+90);draw z31--z32; draw z37--z38;    % upper and lower bars\stopMPpagewhich results in:

dbend.pdf
Description: Adobe PDF document
On 27 May 2020, at 21:50, Herbert Voss  wrote:Am 27.05.20 um 21:19 schrieb Gerben Wierda:To honour Donald Knuth, I’ve use his ‘dangerous bend’ (with attribution of course) in one of my publications. But I only had a low res image. Is the code of this symbol available somewhere so I can do it proper justice in a next edition?Knuth used\input manmac\dbend\byeHerbert___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-contextwebpage  : http://www.pragma-ade.nl / http://context.aanhet.netarchive  : 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] 'debug' version of METAPOST draw?

2020-05-28 Thread Gerben Wierda
I would like to be able (during development) to draw paths where the points of 
the path (and maybe thing slike directions) are visualised. E.g. a path where 
each pair in teh path is also drawn as a dot and maybe teh directions drawn as 
small arrows.

Does someone have such a beast lying around?

G
___
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] Dangerous bend metafont/post code?

2020-05-27 Thread Gerben Wierda
To honour Donald Knuth, I’ve use his ‘dangerous bend’ (with attribution of 
course) in one of my publications. But I only had a low res image. Is the code 
of this symbol available somewhere so I can do it proper justice in a next 
edition?

G
___
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] Change of Optima to Optima Nova: how to get Optima Nova working?

2020-05-24 Thread Gerben Wierda
The answer was: running

mtxrun --script fonts —reload —force

Then to get the proper usage (for e.g. demibold as text font):

\definefallbackfamily
  [archimate]
  [ss]
  [Helvetica]
  [preset=range:cyrillic,
   tf=style:light,
   it=style:lightoblique,
   bf=style:regular,
   bi=style:oblique,
   force=yes]
\definefontfamily
[archimate]
[ss]
[Optima nova LT Pro]
[tf=style:Demi,
 bf=style:Heavy,
 it=style:Medium Italic,
 bi=style:Heavy Italic]
\setupbodyfont[archimate]


G

> On 24 May 2020, at 13:50, Gerben Wierda  wrote:
> 
> 
> 
>> On 24 May 2020, at 12:40, Gerben Wierda > <mailto:gerben.wie...@rna.nl>> wrote:
>> 
>> 
>> 
>>> On 24 May 2020, at 12:26, Gerben Wierda >> <mailto:gerben.wie...@rna.nl>> wrote:
>>> 
>>> 
>>> 
>>>> On 24 May 2020, at 12:16, Gerben Wierda >>> <mailto:gerben.wie...@rna.nl>> wrote:
>>>> 
>>>> I’ve decided to buy the Optima Nova font. But now that I use it, I run 
>>>> into the problem that suddenly my fallback for Cyrillic has stopped 
>>>> working.
>>>> 
>>>> \definefallbackfamily
>>>>   [archimate]
>>>>   [ss]
>>>>   [Helvetica]
>>>>   [preset=range:cyrillic,
>>>>tf=style:light,
>>>>it=style:lightoblique,
>>>>bf=style:regular,
>>>>bi=style:oblique,
>>>>force=yes,
>>>>rscale=1.0]
>>>> \definefontfamily
>>>> [archimate]
>>>> [ss]
>>>>   [OptimaLT-Medium]
>>>> \setupbodyfont[archimate]
>>>> 
>>>> \starttext
>>>> 
>>>> The quick brown fox jumped over the lazy dog. Ядро метамодели.
>>>> 
>>>> \stoptext
>>>> 
>>>> With
>>>> 
>>>> \definefontfamily
>>>> [archimate]
>>>> [ss]
>>>>   [Optima]
>>>> 
>>>> Cyrillic fallback works (as does the old Optima). What do I need to do to 
>>>> remedy that?
>>> 
>>> I did not look good. Optima Nova also doesn’t work and has been replaced 
>>> with Latin Modern Sans
>>> 
>>> selectfont  > the requested font 'OptimaLT-Medium' has no files for the 
>>> 'tf' alternative, Latin Modern is used instead.
>>> 
>>> Apparently as a result, the fallback for cyrillic also doesn’t work. So, I 
>>> need to find out how to set up Optima Nova.
>> 
>> And not even
>> 
>>> \definefontfamily
>>> [archimate]
>>> [ss]
>>>   [Optima Nova]
>>> [  tf=file:/Library/Fonts/OptimaNovaLTPro-Medium.otf,
>>>it=file:OptimaNovaLTPro-MediumIta.otf,
>>>bf=file:OptimaNovaLTPro-Bold.otf,
>>>bi=file:OptimaNovaLTPro-BoldIta.otf,
>>> ]
>> 
>> will work.
>> 
>> selectfont  > the requested font 'Optima Nova' has no files for the 'tf' 
>> alternative, Latin Modern is used instead.
>> 
>> There is no documentation of \definefontfamily in the docs that come with 
>> the standalone ConTeXt distribution and what is on ConTeXtgarden hasn’t 
>> brought light to the matter either.
> 
> The firsdt problem was solved, I had to rebuild the font database:
> 
> mtxrun --script fonts --reload
> 
> Now
> 
> $ mtxrun --script fonts --list --all --pattern=Optima
> identifier   familynamefontname   
>   filename subfont   instances
> 
> optima   optimaoptimaextrablack   
>   /System/Library/Fonts/Optima.ttc 5
> optimaextrablack optimaoptimaextrablack   
>   /System/Library/Fonts/Optima.ttc 5
> optimanovaltproblack optimanovaltpro   optimanovaltproblack   
>   /Library/Fonts/OptimaNovaLTPro-Black.otf
> optimanovaltproblackitalic   optimanovaltpro   optimanovaltproblackitalic 
>   /Library/Fonts/OptimaNovaLTPro-BlackItalic.otf
> optimanovaltprobold  optimanovaltpro   optimanovaltprobold
>   /Library/Fonts/OptimaNovaLTPro-Bold.otf
> optimanovaltproboldcond  optimanovaltpro   optimanovaltproboldcond
>   /Library/Fonts/OptimaNovaLTPro-BoldCond.otf
> optimanovaltproboldcondensed optimanovaltpro   optimanovaltproboldcond
>   /Library/Fonts/OptimaNovaLTPro-BoldCond.otf
> optimanovaltprobolditalicoptimanovaltpro   optimanovaltprobolditalic  
>   /Library/Fonts/OptimaNovaLTPro-BoldIt

[NTG-context] Change of Optima to Optima Nova: fallback for cyrillc stops working

2020-05-24 Thread Gerben Wierda
I’ve decided to buy the Optima Nova font. But now that I use it, I run into the 
problem that suddenly my fallback for Cyrillic has stopped working.

\definefallbackfamily
  [archimate]
  [ss]
  [Helvetica]
  [preset=range:cyrillic,
   tf=style:light,
   it=style:lightoblique,
   bf=style:regular,
   bi=style:oblique,
   force=yes,
   rscale=1.0]
\definefontfamily
[archimate]
[ss]
  [OptimaLT-Medium]
\setupbodyfont[archimate]

\starttext

The quick brown fox jumped over the lazy dog. Ядро метамодели.

\stoptext

With

\definefontfamily
[archimate]
[ss]
  [Optima]

Cyrillic fallback works (as does the old Optima). What do I need to do to 
remedy that?

Thanks,

G___
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] Change of Optima to Optima Nova: how to get Optima Nova working?

2020-05-24 Thread Gerben Wierda


> On 24 May 2020, at 12:40, Gerben Wierda  wrote:
> 
> 
> 
>> On 24 May 2020, at 12:26, Gerben Wierda > <mailto:gerben.wie...@rna.nl>> wrote:
>> 
>> 
>> 
>>> On 24 May 2020, at 12:16, Gerben Wierda >> <mailto:gerben.wie...@rna.nl>> wrote:
>>> 
>>> I’ve decided to buy the Optima Nova font. But now that I use it, I run into 
>>> the problem that suddenly my fallback for Cyrillic has stopped working.
>>> 
>>> \definefallbackfamily
>>>   [archimate]
>>>   [ss]
>>>   [Helvetica]
>>>   [preset=range:cyrillic,
>>>tf=style:light,
>>>it=style:lightoblique,
>>>bf=style:regular,
>>>bi=style:oblique,
>>>force=yes,
>>>rscale=1.0]
>>> \definefontfamily
>>> [archimate]
>>> [ss]
>>>   [OptimaLT-Medium]
>>> \setupbodyfont[archimate]
>>> 
>>> \starttext
>>> 
>>> The quick brown fox jumped over the lazy dog. Ядро метамодели.
>>> 
>>> \stoptext
>>> 
>>> With
>>> 
>>> \definefontfamily
>>> [archimate]
>>> [ss]
>>>   [Optima]
>>> 
>>> Cyrillic fallback works (as does the old Optima). What do I need to do to 
>>> remedy that?
>> 
>> I did not look good. Optima Nova also doesn’t work and has been replaced 
>> with Latin Modern Sans
>> 
>> selectfont  > the requested font 'OptimaLT-Medium' has no files for the 
>> 'tf' alternative, Latin Modern is used instead.
>> 
>> Apparently as a result, the fallback for cyrillic also doesn’t work. So, I 
>> need to find out how to set up Optima Nova.
> 
> And not even
> 
>> \definefontfamily
>> [archimate]
>> [ss]
>>   [Optima Nova]
>> [  tf=file:/Library/Fonts/OptimaNovaLTPro-Medium.otf,
>>it=file:OptimaNovaLTPro-MediumIta.otf,
>>bf=file:OptimaNovaLTPro-Bold.otf,
>>bi=file:OptimaNovaLTPro-BoldIta.otf,
>> ]
> 
> will work.
> 
> selectfont  > the requested font 'Optima Nova' has no files for the 'tf' 
> alternative, Latin Modern is used instead.
> 
> There is no documentation of \definefontfamily in the docs that come with the 
> standalone ConTeXt distribution and what is on ConTeXtgarden hasn’t brought 
> light to the matter either.

The firsdt problem was solved, I had to rebuild the font database:

mtxrun --script fonts --reload

Now

$ mtxrun --script fonts --list --all --pattern=Optima
identifier   familynamefontname 
filename subfont   instances

optima   optimaoptimaextrablack 
/System/Library/Fonts/Optima.ttc 5
optimaextrablack optimaoptimaextrablack 
/System/Library/Fonts/Optima.ttc 5
optimanovaltproblack optimanovaltpro   optimanovaltproblack 
/Library/Fonts/OptimaNovaLTPro-Black.otf
optimanovaltproblackitalic   optimanovaltpro   optimanovaltproblackitalic   
/Library/Fonts/OptimaNovaLTPro-BlackItalic.otf
optimanovaltprobold  optimanovaltpro   optimanovaltprobold  
/Library/Fonts/OptimaNovaLTPro-Bold.otf
optimanovaltproboldcond  optimanovaltpro   optimanovaltproboldcond  
/Library/Fonts/OptimaNovaLTPro-BoldCond.otf
optimanovaltproboldcondensed optimanovaltpro   optimanovaltproboldcond  
/Library/Fonts/OptimaNovaLTPro-BoldCond.otf
optimanovaltprobolditalicoptimanovaltpro   optimanovaltprobolditalic
/Library/Fonts/OptimaNovaLTPro-BoldItalic.otf
optimanovaltprocondensed optimanovaltpro   optimanovaltprocondensed 
/Library/Fonts/OptimaNovaLTPro-Condensed.otf
optimanovaltprodemi  optimanovaltpro   optimanovaltprodemi  
/Library/Fonts/OptimaNovaLTPro-Demi.otf
optimanovaltprodemicond  optimanovaltpro   optimanovaltprodemicond  
/Library/Fonts/OptimaNovaLTPro-DemiCond.otf
optimanovaltprodemicondensed optimanovaltpro   optimanovaltprodemicond  
/Library/Fonts/OptimaNovaLTPro-DemiCond.otf
optimanovaltprodemiitalicoptimanovaltpro   optimanovaltprodemiitalic
/Library/Fonts/OptimaNovaLTPro-DemiItalic.otf
optimanovaltproheavy optimanovaltpro   optimanovaltproheavy 
/Library/Fonts/OptimaNovaLTPro-Heavy.otf
optimanovaltproheavyitalic   optimanovaltpro   optimanovaltproheavyitalic   
/Library/Fonts/OptimaNovaLTPro-HeavyItalic.otf
optimanovaltproitalicoptimanovaltpro   optimanovaltproitalic
/Library/Fonts/OptimaNovaLTPro-Italic.otf
optimanovaltprolight optimanovaltpro   optimanovaltprolight   

Re: [NTG-context] Change of Optima to Optima Nova: how to get Optima Nova working?

2020-05-24 Thread Gerben Wierda


> On 24 May 2020, at 12:26, Gerben Wierda  wrote:
> 
> 
> 
>> On 24 May 2020, at 12:16, Gerben Wierda > <mailto:gerben.wie...@rna.nl>> wrote:
>> 
>> I’ve decided to buy the Optima Nova font. But now that I use it, I run into 
>> the problem that suddenly my fallback for Cyrillic has stopped working.
>> 
>> \definefallbackfamily
>>   [archimate]
>>   [ss]
>>   [Helvetica]
>>   [preset=range:cyrillic,
>>tf=style:light,
>>it=style:lightoblique,
>>bf=style:regular,
>>bi=style:oblique,
>>force=yes,
>>rscale=1.0]
>> \definefontfamily
>> [archimate]
>> [ss]
>>   [OptimaLT-Medium]
>> \setupbodyfont[archimate]
>> 
>> \starttext
>> 
>> The quick brown fox jumped over the lazy dog. Ядро метамодели.
>> 
>> \stoptext
>> 
>> With
>> 
>> \definefontfamily
>> [archimate]
>> [ss]
>>   [Optima]
>> 
>> Cyrillic fallback works (as does the old Optima). What do I need to do to 
>> remedy that?
> 
> I did not look good. Optima Nova also doesn’t work and has been replaced with 
> Latin Modern Sans
> 
> selectfont  > the requested font 'OptimaLT-Medium' has no files for the 
> 'tf' alternative, Latin Modern is used instead.
> 
> Apparently as a result, the fallback for cyrillic also doesn’t work. So, I 
> need to find out how to set up Optima Nova.

And not even

> \definefontfamily
> [archimate]
> [ss]
>   [Optima Nova]
> [  tf=file:/Library/Fonts/OptimaNovaLTPro-Medium.otf,
>it=file:OptimaNovaLTPro-MediumIta.otf,
>bf=file:OptimaNovaLTPro-Bold.otf,
>bi=file:OptimaNovaLTPro-BoldIta.otf,
> ]

will work.

selectfont  > the requested font 'Optima Nova' has no files for the 'tf' 
alternative, Latin Modern is used instead.

There is no documentation of \definefontfamily in the docs that come with the 
standalone ConTeXt distribution and what is on ConTeXtgarden hasn’t brought 
light to the matter either.

G
> 
> G
> 
>> 
>> Thanks,
>> 
>> G
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
>> http://www.ntg.nl/mailman/listinfo/ntg-context 
>> <http://www.ntg.nl/mailman/listinfo/ntg-context>
>> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
>> http://context.aanhet.net <http://context.aanhet.net/>
>> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
>> <https://bitbucket.org/phg/context-mirror/commits/>
>> wiki : http://contextgarden.net <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 <mailto:ntg-context@ntg.nl> / 
> http://www.ntg.nl/mailman/listinfo/ntg-context 
> <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
> http://context.aanhet.net <http://context.aanhet.net/>
> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
> <https://bitbucket.org/phg/context-mirror/commits/>
> wiki : http://contextgarden.net <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] Change of Optima to Optima Nova: how to get Optima Nova working?

2020-05-24 Thread Gerben Wierda


> On 24 May 2020, at 12:16, Gerben Wierda  wrote:
> 
> I’ve decided to buy the Optima Nova font. But now that I use it, I run into 
> the problem that suddenly my fallback for Cyrillic has stopped working.
> 
> \definefallbackfamily
>   [archimate]
>   [ss]
>   [Helvetica]
>   [preset=range:cyrillic,
>tf=style:light,
>it=style:lightoblique,
>bf=style:regular,
>bi=style:oblique,
>force=yes,
>rscale=1.0]
> \definefontfamily
> [archimate]
> [ss]
>   [OptimaLT-Medium]
> \setupbodyfont[archimate]
> 
> \starttext
> 
> The quick brown fox jumped over the lazy dog. Ядро метамодели.
> 
> \stoptext
> 
> With
> 
> \definefontfamily
> [archimate]
> [ss]
>   [Optima]
> 
> Cyrillic fallback works (as does the old Optima). What do I need to do to 
> remedy that?

I did not look good. Optima Nova also doesn’t work and has been replaced with 
Latin Modern Sans

selectfont  > the requested font 'OptimaLT-Medium' has no files for the 
'tf' alternative, Latin Modern is used instead.

Apparently as a result, the fallback for cyrillic also doesn’t work. So, I need 
to find out how to set up Optima Nova.

G

> 
> Thanks,
> 
> G
> ___
> 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] How to define a font with an effect as a font with \definefont

2020-05-23 Thread Gerben Wierda


> On 23 May 2020, at 20:06, Wolfgang Schuster 
>  wrote:
> 
> Pablo Rodriguez schrieb am 23.05.2020 um 20:02:
>> On 5/23/20 11:52 AM, Gerben Wierda wrote:
>>> []
>>> Actually, my setup is Optima with Helvetica used for Cyrillic:
>>> 
>>> \definefallbackfamily
>>>   [archimate]
>>>   [ss]
>>>   [Helvetica]
>>>   [preset=range:cyrillic,
>>>tf=style:light,
>>>it=style:lightoblique,
>>>bf=style:regular,
>>>bi=style:oblique,
>>>force=yes,
>>>rscale=1.0]
>>> \definefontfamily [archimate] [ss] [Optima]
>>> \setupbodyfont[archimate]
>>> 
>>> And I would like the effect to work on just the Optima font (which is a
>>> bit light for this use)
>> Hi Gerben,
>> this code may work for you:
> 
> Don't forget to apply the "default" features to get ligatures and kerning.
> 
>> \definefontfeature
>>   [effect-widen]
>>   [effect={width=.2,delta=0.3}]
>> \definefallbackfamily
>>   [archimate]
>>   [ss]
>>   [Helvetica]
>>   [preset=range:cyrillic,
>>tf=style:light,
>>it=style:lightoblique,
>>bf=style:regular,
>>bi=style:oblique,
>>force=yes,
>>features={effect-widen}]
> 
> features={default,effect-widen}]
> 
>> \definefontfamily
>> [archimate]
>> [ss]
>> [Optima]
>> [features={effect-widen}]
> 
> features={default,effect-widen}]

Does this apply the effect only to Latin characters in Optima and not to 
Cyrcillic characters in Helvetica? I am trying to understand the syntax and if 
I read this it seems to get applied to cyrillic in this case.

G


> 
> Wolfgang
> ___
> 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] How to define a font with an effect as a font with \definefont

2020-05-23 Thread Gerben Wierda
Wityh this working example:

\starttext
The quick brown fox jumped over the lazy dog

\definefontfeature
[effect-widen]
  [effect={width=.2,delta=0.3}]
\definedfont[Sans*widen,effect-widen]
The quick brown fox jumped over the lazy dog

\stoptext

I am puzzling to turn my working \definedfont into a \definefont so I can use 
that instead.

Actually, my setup is Optima with Helvetica used for Cyrillic:

\definefallbackfamily
  [archimate]
  [ss]
  [Helvetica]
  [preset=range:cyrillic,
   tf=style:light,
   it=style:lightoblique,
   bf=style:regular,
   bi=style:oblique,
   force=yes,
   rscale=1.0]
\definefontfamily [archimate] [ss] [Optima]
\setupbodyfont[archimate]

And I would like the effect to work on just the Optima font (which is a bit 
light for this use)

I’ve been trying to work out using \definefont with the effect but have so far 
failed.

Thanks,

G___
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] output file name query

2020-05-23 Thread Gerben Wierda


> On 23 May 2020, at 14:46, Wolfgang Schuster 
>  wrote:
> 
> Henning Hraban Ramm schrieb am 22.05.2020 um 17:39:
 Am 22.05.2020 um 15:09 schrieb Wolfgang Schuster 
 :
>>> 
>>> Alan Bowen schrieb am 22.05.2020 um 14:33:
 In my project, I process a single product file by enabling various modes. 
 What I would like to do is to vary the name of the output PDF file in each 
 instance.
 So, in processing a file, how does one go directly from prd_filename.tex 
 to myfilename.pdf rather than to prd_filename.pdf—assuming that it is 
 possible?
 Any tips or pointers to what I should be reading will be greatly 
 appreciated.
>>> 1. Drop the weird (sorry Hraban) naming system and use myfilename for your 
>>> product.
>> I force nobody to use that.
> No and everybody has to find a system which fits best for him, prefixes can 
> be useful (e.g. to avoid component and style files with the same name) but 
> aren't necessary.
>>> 2. Use the result option on the command line, e.g. "context 
>>> --result=myfilename prd_filename.tex".
>> But that still produces a "prd_filename.*" first and then renames it, making 
>> it impossible to keep a "prd_filename.pdf". Or did that change recently?
>> 
>> My workflows are adapted to that behaviour: "prd_*.pdf" is just the 
>> temporary version, none of those leaves my computer, but only nicely named 
>> PDFs (usually MyProductName_-mm-dd.pdf).
> Having a simple name doesn't mean it's the final name of the document.
>>> 3. Ask Hans to add the result option to the first line of the document 
>>> which is read by the context script before it creates the PDF.
>>> 
>>> % result="myfilename"
>>> \starttext
>>> ...
>>> \stoptext
>> That contradicts the mode approach. It would be nice if we could set (or can 
>> we?) the result from within the product, depending on a mode – since the 
>> product is renamed only later anyway, that could be viable.
> This addition is easy because already reads the first line of the document 
> for special setting (e.g. the engine) but anything which is set in the 
> document requires more work because you don't know the new name *before* 
> LuaTeX or LuaMetaTeX create the PDF.
> 

Just curious: wouldn’t it theoretically be possible to delay opening the output 
file until the first \stattext? Or is there already stuff going out before 
that, such as preliminaries that go into the PDF?

I think being able to name the output file in the preliminaries in the TeX file 
would come in handy and prevent more complex workarounds with scripts. But it 
is not essential as workarounds are possible.

Gerben

> Wolfgang
> 
> ___
> 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] Getting width of text to be typeset

2020-05-23 Thread Gerben Wierda


> On 23 May 2020, at 01:49, Rik Kabel  wrote:
> 
> If the OP simply wants the width of a string, one can use \setwidthof#1\to#2.
> 
> \define\String{pqrs}
> \setwidthof{\String}\to\Wdth
> \String\ is \Wdth\ wide.
> 
> \setwidthof{{\tfb\em\String}}\to\Wdth
> {\tfb\em\String} is \Wdth\ wide.
> 
> I do not know if that is different from the width of the same string unboxed 
> from the paragraph. There may be some adjustments made in justification, 
> expansion, and such that are not treated.

Additionally: suppose I am in lua. Would it be possible to get the width (and 
height) of a string back in lua as a value?

So, in lua something like this:

width = tex.widthofstring(“I have a string with some $\frac{1}2{}$ (math) in 
it")

G___
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] Proposal to update the "Manuals" wiki page

2020-05-20 Thread Gerben Wierda


> On 19 May 2020, at 15:22, Garulfo  wrote:
> 
> Hi,
> 
> I hope you're all doing well.
> 
> Please, you will find a proposal to update the Manuals page on the wiki:
> https://wiki.contextgarden.net/ManualsGallery
> 
> 2 objectives:
> 1/ to make something more visual, to help the user identify the different 
> documents, their organization, their date of release.
> 2/ to gather all the updated documents in one place
> 
> Sources were :
> - http://www.pragma-ade.com/overview.htm
> - https://wiki.contextgarden.net/Manuals, and wiki snippets here and there.
> - https://github.com/hmenke/context-examples/blob/master/GUIDE.md
> 
> Depending on your comments, and if there is an interest, I would be happy to 
> improve it (correct errors, change document segmentation, better colors 
> choice, additional data such as authors, number of pages).
> 
> It's mainly built from cvs table + script.
> 
> Finally, if you approve this update, I can arrange to clean up some pages of 
> the wiki about the manuals.
> 
> 
> Best,
> 

Very helpful addition.

G

> 
> 
> 
> 
> 
> 
> ___
> 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] \pagewidth undefined?

2020-05-19 Thread Gerben Wierda

> On 19 May 2020, at 20:11, Hans Hagen  wrote:
> 
> On 5/19/2020 5:37 PM, Wolfgang Schuster wrote:
>> Gerben Wierda schrieb am 19.05.2020 um 13:42:
>>> OK. I just noticed in lmtx documentation that \paperheight and \paperwidth 
>>> primitives have been removed, but there is no information what rteplaces 
>>> them. So, all the documentation that contains them has been invalidated 
>>> (e.g. examples in details.pdf)
>> I can't find \pagewidth in the current versison of details.pdf.
>> As Pablo wrote you can use \paperwidth (or \printpaperwidth) or one of the 
>> following methods.
>>  begin example
>> \setupexternalfigures[location=default]
>> \setuplayout[tight]
>> \showframe
>> \starttext
>> \centerbox{\externalfigure[mill.png][width=\textwidth]}
>> \page
>> \centerbox{\externalfigure[mill.png][width=\paperwidth]}
>> \page
>> \centerbox{\externalfigure[mill.png][factor=max]}
>> \page
>> \centerbox{\externalfigure[mill.png][factor=min]}
>> \stoptext
>>  end example
> 
> \pagewidth etc were low level engine primitives that were never meant to be 
> used directly (backend related, and even then very sensitive for confusion); 
> as Wolfgang indicated, these were never supposed to be used directly

Thanks all. I moved to this:

\setuppapersize[A4]
\setuplayout
  [page]
  [backspace=5mm,
   topspace=5mm]
\setuplayout [page]

and using \textwidth and \textheight.

G

> 
> Hans
> 
> -
>  Hans Hagen | PRAGMA ADE
>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: 038 477 53 69 | www.pragma-ade.nl <http://www.pragma-ade.nl/> | 
> www.pragma-pod.nl <http://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] \pagewidth undefined?

2020-05-19 Thread Gerben Wierda
Why doesn't

\starttext
\externalfigure[foo.pdf][width=\pagewidth]
\stoptext

work? Without [width=\pagewidth] it works.
___
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] \pagewidth undefined?

2020-05-19 Thread Gerben Wierda
OK. I just noticed in lmtx documentation that \paperheight and \paperwidth 
primitives have been removed, but there is no information what rteplaces them. 
So, all the documentation that contains them has been invalidated (e.g. 
examples in details.pdf)

I have been unable to find out how to get the page width and page height dimens 
for use in my macros.

G

> On 19 May 2020, at 11:58, Gerben Wierda  wrote:
> 
> Why doesn't
> 
> \starttext
> \externalfigure[foo.pdf][width=\pagewidth]
> \stoptext
> 
> work? Without [width=\pagewidth] it works.
> ___
> 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] Can someone explain the \startuseMPgraphic interface to me?

2020-05-19 Thread Gerben Wierda
In details.pdf, I encounter

\startuseMPgraphic{mpos:par:columnset:shade}
numeric h ;
for i=1 upto nofmultipars :
h := bbheight(p) ;
if multikind[i] = "single" :
fill multipars[i] topenlarged -.5h

When I encounter that, I wonder:
- where do nofmultipars, p, multikind, and multpars come from?
- what does mpos:par:columnset:shade signify? Just a name? Do the ’:’ have 
meaning?

G.
___
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] Looking for a way to use lua to output console/debug messages from MetaPost instead of 'show'

2020-05-18 Thread Gerben Wierda
I often need some debugging info to find out what is going on in my METAPOST 
code (as I often do not have exact knowledge of what some things do). 
MetaPost’s ‘show’ command has limited formatting functionality (e.g. I would 
like to add a number as a string to a show message instead of putting it out as 
number and let ‘show' make a lot of lines out of it). 

I would like to instead use a lua function and I think I recall having seen 
somewhere the use of a call like lua( ….) or lua.foo.bar() in a 
MetaPost/MetaFun/LMTX example but I cannot find it anymore. 

Is it possible to do a lua() call from within MetaPost within LMTX and if so, 
what is the way to do it? This below is the state of my misguided attempts:

\startluacode
function warnWithLabelIfVerbose( str, ... )
  texio.write_nl( str .. string.format(...))
end
\stopluacode

\startMPdefinitions{doublefun}
%def somefunction ( expr str, number) =
%  lua.warnWithLabel( "LABEL: ", "%s %d", str, number);
%enddef;
\stopMPdefinitions

\startMPpage[instance=doublefun]
lua.texio.write_nl( "HELLO!"); % This works
%lua.texio.write( "HELLO!\%n"); % This doesn't
%string outs; outs := lua.string.format( "HELLO! \%s \%0.3f", "aap", 12.6);
%somefunction( "aap", 12.6);
\stopMPpage

Thx,

G___
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] What is required to make \setuplayout work?

2020-05-17 Thread Gerben Wierda
I’ve been trying to define a layout that just has a 5mm no-printing edge around 
the paper and has all the rest for \textwidth and \textheight. No header, 
footer, pagenumber, etc. Just as much space as I can get out of a standard A4.

But the following (following the manual and ConTeXtgarden):

\setuplayout[leftedge=5mm,top=5mm,rightedge=5mm,bottom=5mm,
leftmargin=0mm,rightmargin=0mm,
margindistance=0mm,edgedistance=0mm,
topdistance=0mm,headerdistance=0mm,footerdistance=0mm,bottomdistance=0mm]
\showlayoutcomponents % doesn’t seem to do anything
\showframe % this works
\starttext
\input knuth
\stoptext

Doesn’t seem to change the layout. What am I missing?

G___
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] Building a page based on exact location of graphical elements (PDF)

2020-05-17 Thread Gerben Wierda
What is the simplest way to build a page based on positioning of external 
images? Some of these images are page-sized (so take up an entire page, though 
I might want to overlay some other text boxes and MP graphics). I’ve been 
trying to find a good explanation/introduction into layers (which I think 
ConTeXtgarden says I should use) but haven’t found one.

G
___
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] \goto not working from within \textext()

2020-05-16 Thread Gerben Wierda
This does give me ythe look of a link, but not a working link. Outside of 
textext() it works. Is there a way to get a working link in a MetaFun picture?

Thx,

G

  \setupinteraction
[state=start,
 color=blue,
 style=bold]

\starttext
\goto{works}[url(https://ea.rna.nl/2011/06/05/on-the-use-of-colours-in-archimate/)]
\setupMPpage
  [background=color,
   backgroundcolor=gray]
\startMPpage[instance=doublefun]
draw textext("\goto{doesn’t 
work}[url(https://ea.rna.nl/2011/06/05/on-the-use-of-colours-in-archimate/)]");
\stopMPpage

\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] Using transparency in METAPOST within textext()

2020-05-14 Thread Gerben Wierda
Thank you. That works.

> On 14 May 2020, at 17:13, Wolfgang Schuster 
>  wrote:
> 
> Gerben Wierda schrieb am 14.05.2020 um 11:47:
>> Is it possible to get a transparent background in a textext()? The following 
>> minimal example doesn’t work.
>> \starttext
>> \setupMPpage
>>   [background=color,
>>backgroundcolor=gray]
>> \startMPpage
>> draw textext("\definecolor[labelbackground][a=0.2,r=1,g=1,b=1]
> 
> \definecolor[labelbackground][a=1,t=0.2,r=1,g=1,b=1]
> 
> Wolfgang


G
___
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] Using transparency in METAPOST within textext()

2020-05-14 Thread Gerben Wierda
Is it possible to get a transparent background in a textext()? The following 
minimal example doesn’t work.

\starttext
\setupMPpage
  [background=color,
   backgroundcolor=gray]
\startMPpage
draw 
textext("\definecolor[labelbackground][a=0.2,r=1,g=1,b=1]\framed[height=1.2em,background=color,backgroundcolor=labelbackground,foregroundcolor=black]{Text
 in Label}");
\stopMPpage

\stoptext


Thx.

G


___
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] Is it possible to make xml.load a bit more 'verbose' when it encounters errors?

2020-05-13 Thread Gerben Wierda
I am loading an xml.file. I sometimes make mistakes editing that file and then 
xml.load creates a string that contains

invalid xml file - parsed text

At that point I check my file and sometimes (like now) I cannot find the error.

Is there a way to make xml.load somewhat more verbose about where it encounters 
the error? 

G___
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] \goto works but links don't when passed via textext() in METAPOST

2020-05-10 Thread Gerben Wierda
I am trying to get an URL link in a textext() via METAPOST. I’ve got this 
before \starttext (or after, tried both):

\setupinteraction
   [state=start,
color=blue,
style=bold]

The intended link shows up in blue and bold, but it is not clickable.

I’ve turned ConTeXt tracing on and see this when the text is passed to METAPOST:

cld > tex > f : 8 : picture pic; x:=1233.000; y:=913.000; 
w:=180.000; h:=407.000;pic := Label( w, h, (1.000,1.000,0.784), 1.0, 1.000, 
(0.000,0.000,0.000), 1.000, "dashed evenly", 1.000, (0.000,0.000,0.000), 1.000, 
"", "\definebodyfont[11pt][rm][default=Regular at 
11pt]\switchtobodyfont[11pt]\setupinterlinespace[12.1pt]\framed[align=flushleft,frame=off,offset=none,width=170.000bp]{\colored[r=0.000,
 g=0.000, b=0.000]{\tf The elements are shown in colors where blue represents 
active structure, yellow behaviour, and green passive structure. See 
\goto{here}[url(https://ea.rna.nl/2011/06/05/on-the-use-of-colours-in-archimate/)].\crlf{}\crlf{}
  {\bf Color codes:}\crlf{}\crlf{}  - \colored[mared]{\bf Red}{} and 
\colored[maviolet]{\bf Violet}{} stand for a 'higher' layer element used as an 
abstract representation of a lower layer element. When the target is the 
Business Layer, it implies automated business behavior (marked 
violet).\crlf{}\crlf{}  - \colored[maorange]{\bf Orange}{} and 
\colored[mablue]{\bf Blue}{} are used to model 'downward' serving, e.g. 
Business Layer serving the Technology Layer.\crlf{}\crlf{}  - 
\colored[magreen]{\bf Green}{} stands for class relations inside the metamodel. 
Important conseqence: relations of a parent (in the meta-model) Specialization 
are valid for {\it all} children (in the meta-model). This does not happen when 
Specialization is used in an actual model. There are in fact two fully 
different specializations in ArchiMate (see the book, including the free 
excerpt, for a full explanation)\\}}", "up", "center", "center") shifted (x, 
-y);draw pic;path AllPathIds_idCDCEH;  AllPathIds_idCDCEH := pathpart pic; pair 
AllNodeCenters_idCDCEH; AllNodeCenters_idCDCEH := center pic;

The red is what is being typeset, the \goto is part of that.

And later this when METAPOST passes it on to TeX via textext(): 

cld > tex > f : 8 : \definebodyfont [11pt][rm][default=Regular at 
11pt]\switchtobodyfont [11pt]\setupinterlinespace [12.1pt]\framed 
[align=flushleft,frame=off,offset=none,width=170.000bp]{\colored [r=0.000, 
g=0.000, b=0.000]{\tf The elements are shown in colors where blue represents 
active structure, yellow behaviour, and green passive structure. See \goto 
{here}[url(https://ea.rna.nl/2011/06/05/on-the-use-of-colours-in-archimate/)].\crlf
 {}\crlf {} {\bf Color codes:}\crlf {}\crlf {} - \colored [mared]{\bf Red}{} 
and \colored [maviolet]{\bf Violet}{} stand for a 'higher' layer element used 
as an abstract representation of a lower layer element. When the target is the 
Business Layer, it implies automated business behavior (marked violet).\crlf 
{}\crlf {} - \colored [maorange]{\bf Orange}{} and \colored [mablue]{\bf 
Blue}{} are used to model 'downward' serving, e.g. Business Layer serving the 
Technology Layer.\crlf {}\crlf {} - \colored [magreen]{\bf Green}{} stands for 
class relations inside the metamodel. Important conseqence: relations of a 
parent (in the meta-model) Specialization are valid for {\it all} children (in 
the meta-model). This does not happen when Specialization is used in an actual 
model. There are in fact two fully different specializations in ArchiMate (see 
the book, including the free excerpt, for a full explanation)\\}}

Still correct. But the end result doesn’t have a working hyperlink. Outside the 
route to METAPOST, the \goto statement does produce a working link.

Should this work when passed via textext()?

G___
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] Would it be possible in LMTX to do something like variable font/lineheight to fit a fixed frame?

2020-05-10 Thread Gerben Wierda
Suppose I have a fixed sized frame, say 3 y 4 cm. And I have a variable-length 
text.

Would it be possible to write a macro that scaled the font and line height such 
that the text will fit in the frame?

What I have now is very basic:
Fixed width
Typeset (METAPOST textext())
If too high
METAPOST: scale down so it fits in frame

But the scaling wil scale both height and width so it doesn’t only go to the 
correct height, it also gets too narrow. Just scaling in the vertical direction 
squashes the text/font.

What would be great is some way to have the font size and lineheight result 
from TeX trying to fit it inside a predetermined size.

Doesn’t need to be perfect, a good approximation will do. I’ve been thinking 
about using the surface size difference between desired box size and the result 
of textext() as an approach to guess a right fontsize and line height.

What could make it possible for me too is a way to do a typeset command from 
lua that gives me the box sizes of typesetting without actually typesetting it 
to the true output of the job. Something like
typeset a piece of text without actually outputting it to the PDF output in a 
width (say 4)
get the width and height of the result (say 4 x 6)
Adapt front size and lineheight (from 4x6 to 4x3 means a 50% reduction, which 
may be too much as the result may have just a syllable on the last line)
typeset for real in 50% size
Is that doable? Or is there a better way?
 

G___
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] METAPOST subpath rounding issue

2020-05-10 Thread Gerben Wierda

> On 10 May 2020, at 00:01, Bruce Horrocks  wrote:
> 
>> You can save extracting the xparts and yparts by using direct subtraction of 
>> pairs and comparing with (0,0) like this:
> 
> Aaaargh, no, ignore that, it's nonsense. It's amazing how you can stare at 
> something for minutes but only see the flaw the moment you press send. Sorry 
> for the noise.

Instead, I would like to thank you for thinking about it and trying to help. 
Wrestling with it (and making mistakes) is part of all that (I’ve probably made 
more than most).

G

___
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] METAPOST subpath rounding issue

2020-05-08 Thread Gerben Wierda


> On 8 May 2020, at 00:46, n...@scorecrow.com wrote:
> 
> 
> 
>> On 7 May 2020, at 20:28, Gerben Wierda  wrote:
>> 
>> I have a METAPOST algorithm that splits a path at a certain time in two, 
>> does something with both ends (not the ends where they were split) and then 
>> rejoins them.
>> 
>> In very rare cases this crashes, because the subpath doesn’t work as 
>> expected.
>> 
>>  firstPart := subpath (0,halfWayTime) of workingConn;
>>  secondPart := subpath (halfWayTime,pathTimeLen) of workingConn;
>> 
>> may sometimes result in something like this:
>> 
>> metapost log> >> Path at line 0:
>> metapost log> (273,-427)..controls (259.50,-427) and 
>> (246.013335,-427)
>> metapost log>  ..(232.520001,-427)
>> metapost log> 
>> metapost log> >> Path at line 0:
>> metapost log> (232.519998,-427)..controls 
>> (161.680001,-427) and (90.84000
>> metapost log> 03,-427)
>> metapost log>  ..(20,-427)
>> 
>> As can be seen in these (rare) cases the two calls to subpath result in a 
>> different point resulting from both. so, when I later try to rejoin them 
>> with & it fails:
>> 
>> metapost log> ! Paths don't touch; '&' will be changed to '..'.
>> metapost log>  
>> 
>> Which means subpath doesn’t always exactly do what I expect it to do (and 
>> many explanations, but not the official manual) state. Again, this is rare.
>> 
>> I’ve done this to work around it but I wondered if there was a better 
>> (reliable) solution
>> 
>>  save cutFirstPart; path cutFirstPart; cutFirstPart := firstPart 
>> maxcutbefore fromPicOutline;
>>  save cutSecondPart; path cutSecondPart; cutSecondPart := secondPart 
>> maxcutafter toPicOutline;
>>  if ((xpart point 0 of cutSecondPart) <> (xpart point infinity of 
>> cutFirstPart))
>>or ((ypart point 0 of cutSecondPart) <> (ypart point infinity of 
>> cutFirstPart)):
>>resultConn := cutFirstPart--cutSecondPart;
>>  else:
>>resultConn := cutFirstPart & cutSecondPart;
>>  fi
> 
> A crude test of 
> 
>  path pb;
>  pb:=(5.5cm,0cm)--(5.5cm,0cm)--(10.5cm,0cm);
>  draw pb;
> 
> gives no errors so why not just join using -- all the time and save the test?

Because the double exact points are also creating (different) problems in my 
algorithm as they make the path have 'no direction' at that point (direction is 
(0,0).

G

> 
> --
> Bruce Horrocks
> Hampshire, UK
> 
> ___
> 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] METAPOST subpath rounding issue

2020-05-07 Thread Gerben Wierda
I have a METAPOST algorithm that splits a path at a certain time in two, does 
something with both ends (not the ends where they were split) and then rejoins 
them.

In very rare cases this crashes, because the subpath doesn’t work as expected.

  firstPart := subpath (0,halfWayTime) of workingConn;
  secondPart := subpath (halfWayTime,pathTimeLen) of workingConn;

may sometimes result in something like this:

metapost log> >> Path at line 0:
metapost log> (273,-427)..controls (259.50,-427) and 
(246.013335,-427)
metapost log>  ..(232.520001,-427)
metapost log> 
metapost log> >> Path at line 0:
metapost log> (232.519998,-427)..controls (161.680001,-427) 
and (90.84000
metapost log> 03,-427)
metapost log>  ..(20,-427)

As can be seen in these (rare) cases the two calls to subpath result in a 
different point resulting from both. so, when I later try to rejoin them with & 
it fails:

metapost log> ! Paths don't touch; '&' will be changed to '..'.
metapost log>  

Which means subpath doesn’t always exactly do what I expect it to do (and many 
explanations, but not the official manual) state. Again, this is rare.

I’ve done this to work around it but I wondered if there was a better 
(reliable) solution

  save cutFirstPart; path cutFirstPart; cutFirstPart := firstPart 
maxcutbefore fromPicOutline;
  save cutSecondPart; path cutSecondPart; cutSecondPart := secondPart 
maxcutafter toPicOutline;
  if ((xpart point 0 of cutSecondPart) <> (xpart point infinity of 
cutFirstPart))
or ((ypart point 0 of cutSecondPart) <> (ypart point infinity of 
cutFirstPart)):
resultConn := cutFirstPart--cutSecondPart;
  else:
resultConn := cutFirstPart & cutSecondPart;
  fi

G___
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] How do I add cyrillic to my typescript/document?

2020-05-04 Thread Gerben Wierda
On 4 May 2020, at 12:13, Pablo Rodriguez  wrote:
> 
> On 5/4/20 12:36 AM, Gerben Wierda wrote:
>> [...]
>> It could help if I would understand ConTeXt better. The link gives me a
>> grammar for a command, but doesn’t tell me what to put in.
>> 
>> I tried many, many different permutations, I tried everything I could
>> find on ConTeXtgarden (but then, that also finds me stuff from 15 years
>> ago that isn’t valid anymore), but no luck so far.
> 
> Sorry for not explaining it better, Gerben.
> 
> Let me know if the following sample works for you:
> 
>  \setuplanguage[en][patterns={en, ru}]
> 
>  \definefallbackfamily
>[abc]
>[ss]
>[Helvetica]
>[preset=range:cyrillic,
> %~ tf=style:light,
> %~ it=style:lightoblique,
> %~ bf=style:regular,
> %~ bi=style:oblique,
> force=yes,
> rscale=0.9]
> 
>  \definefontfamily [abc] [ss] [Optima]
> 
>  \setupbodyfont[abc]
> 
>  \starttext
>  \startTEXpage[offset=1em]
>  \doloopoverlist{\tf, \it, \bf, \bi}{
>  \recursestring\hyphenatedword{Николаевич typography}\par}
>  \stopTEXpage
>  \stoptext
> 
> It should hyphenate both English and Russian in all four fonts (regular,
> italic, bold and bold italic).

The above works (including using macOS Helvetica as the font for cyrillic). 
Thank you.

I have no idea why (earlier I got the typescript suggestion for my fonts 
management, but this uses another approach). Is it the case that the ‘family’ 
and ’typescript’ approaches don’t really mix? The above is a lot simpler than 
that what I had and it works fine.

Any reason to leave these commented? And does uncommenting is plan 
TeX-uncommenting, so only the % goes away? Makes me wonder what ‘~’ means.

> %~ tf=style:light,
> %~ it=style:lightoblique,
> %~ bf=style:regular,
> %~ bi=style:oblique,

What I try to do is to have english as the default (and fallback) language and 
Optima as the default font, but there may be snippets in other languages which 
should be typeset in a font that can handle cyrillic. Helvetica is an option. 
So is dejavu.

I still am totally in the dark how this works and what made the earlier setup 
find Optima but not find Helvetica. 

And I’m curious why this adaptation doesn’t work:

 \definefallbackfamily
   [abc]
   [ss]
   [dejavu]
   [preset=range:cyrillic,
%~ tf=style:light,
%~ it=style:lightoblique,
%~ bf=style:regular,
%~ bi=style:oblique,
force=yes,
rscale=0.9]


Anyway, I can go on, not wiser but helped further. Thanks again.

G


> 
>> Which is weird because Optima.ttc is in the same directory and it is found.
> 
> Aren’t Optima.ttc and Helvetica.ttc installed as typefaces on your macOS?
> 
> This is relevant, since ConTeXt may have problems finding them when not
> installed on the system (especially with the system I use).
> 
> If the sample above doesn’t work, please provide the output of "locate
> Helvetica.ttc".
> 
>> But anyway, even if I could understand it, I can’t find anything useful
>> (that is: something that works or makes me try something that works)
>> about font fallbacks. Spending hours of looking (losing a lot of sleep)
>> and then having to bother the list again is very frustrating. Why isn’t
>> this straightforward? I am sorry, everybody is very helpful, but the
>> frustration mounts again.
> 
> If the sample above works, I think font management for your documents
> may be easier to handle (or at least, the font code will be simpler).
> 
> Don’t loose sleep when code is not working, ask here instead. I must
> admit that not having access to a macOS computer (I needed the help of a
> friend to test) makes everything a bit harder. But it isn’t impossible.
> 
> BTW, I use "preset=range:cyrillic" instead of "range=cyrillic", since it
> includes cyrillic, cyrillicextendeda, cyrillicextendedb and
> cyrillicsupplement.
> 
> I hope the sample above helps now,
> 
> Pablo
> --
> http://www.ousia.tk
> ___
> 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] lmt_followtext crashes while standard followtext itself works

2020-05-04 Thread Gerben Wierda
> we can patch this
> 
>if ad <> origin : rotated(angle(ad)) fi
> 
> in mp-blob.mpiv but I expect you to test if all still works then

Applied and tested, it works fine.

And it also provided me with an insight about if:else:fi that was slow in 
coming but now that I see it, I think “Duh, you should have realised that much 
sooner”.

Thanks,

G

___
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] How do I add cyrillic to my typescript/document?

2020-05-03 Thread Gerben Wierda
On 3 May 2020, at 15:55, Pablo Rodriguez  wrote:
> 
> On 5/3/20 2:56 PM, Gerben Wierda wrote:
>> ConTeXtgarden had theanswer when I searched again:
>> 
>> \setupbodyfont[dejavu]
>> \mainlanguage[russian]
> 
> Hi Gerben,
> 
> I’m afraid they may be different issues: setting a language and getting
> the glyphs required for that language.
> 
> See the following sample:
> 
>\setupbodyfont[dejavu]
>\mainlanguage[russian]
>\starttext
>\hyphenatedword{%
>Николаевич
>typography
>\en typography}
>\stoptext
> 
> Since you set the main language to Russian in the document, you would
> have to mark all English texts properly. I doubt this may be what you
> intend.
> 
> The way to get a fallback font would be (depending on which approach you
> use) \definefontfallback or \definefallbackfamily.
> 
> A sample of the second option would read:
> 
>  \definefallbackfamily
>[mainface]
>[ss]
>[FreeSans]
>[preset=range:cyrillic,
> force=yes]
> 
> In any case,
> http://www.pragma-ade.com/general/qrcs/setup-en.pdf#search=%22definefontfallback%22
> explains the syntax of the first option (sorry, but I only use the
> \definefontfamily approach).
> 
> Just in case it helps,

Thank you.

It could help if I would understand ConTeXt better. The link gives me a grammar 
for a command, but doesn’t tell me what to put in.

I tried many, many different permutations, I tried everything I could find on 
ConTeXtgarden (but then, that also finds me stuff from 15 years ago that isn’t 
valid anymore), but no luck so far.

The last I tried was

\starttypescript [sans] [optima]
   \setups[font:fallback:sans]
   \definefontsynonym [Sans]   [file:Optima.ttc(Optima Regular)] 
[features=default]
   \definefontsynonym [SansBold]   [file:Optima.ttc(Optima Bold)]
[features=default]
   \definefontsynonym [SansItalic] [file:Optima.ttc(Optima Italic)]  
[features=default]
   \definefontsynonym [SansBoldItalic] [file:Optima.ttc(Optima Bold Italic)] 
[features=default]
\stoptypescript

\definetypeface [optima] [ss] [sans] [optima] [default]
\definetypeface [optima] [rm] [serif] [optima] [default]
\definetypeface [optima] [tt] [mono] [modern] [default]
\definetypeface [optima] [mm] [math] [pagella] [default]

  \definefallbackfamily
[optima]
[ss]
[file:Helvetica.ttc]
[preset=range:cyrillic,
force=yes]

\setupbodyfont [optima]

The error is:

fonts   > typescripts > unknown library 'optima'
open source > level 3, order 6, name 
'/usr/local/context-osx-64/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source> level 3, order 6, name 
'/usr/local/context-osx-64/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
selectfont  > the requested fallback font 'file:Helvetica.ttc' for typeface 
'optima' style 'ss' was ignored because no files where found.


Which is weird because Optima.ttc is in the same directory and it is found.

I have a lot o difficulty understanding any of the documentation (as far as it 
is available for the subjects and commands I am lookng for).

For instance: what is the difference between the “Syntax (autogenerated)” and 
“Syntax entries on ConTeXtgarden? If they differ which one should I take? If 
you tell me “preset=range:cyrillic and what I find says "range=cyrillic", which 
one do I use ( in this case, changing did not help). There are just too many 
things that can be different for tial and error to be effective.

But anyway, even if I could understand it, I can’t find anything useful (that 
is: something that works or makes me try something that works) about font 
fallbacks. Spending hours of looking (losing a lot of sleep) and then having to 
bother the list again is very frustrating. Why isn’t this straightforward? I am 
sorry, everybody is very helpful, but the frustration mounts again.

G___
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] lmt_followtext crashes while standard followtext itself works

2020-05-03 Thread Gerben Wierda
The following example has been extracted from my automatically generated MP 
code.

\starttext

\startMPpage

string texstring;
texstring := "{\colored [r=0.00, g=0.00, b=0.00]{\definebodyfont 
[9.0pt][rm][default=Regular at 9.0pt]\switchtobodyfont 
[9.0pt]\setupinterlinespace [9.9pt]\tf E.g. publish/ subscribe}}";
path parpath;
parpath :=
(238,-167.00010681152344)..controls (238,-167.00010681152344) and 
(238,-167.00010681152344)
 ..(238,-167.00010681152344)..controls (238,-166.60010673470143) and 
(238,-166.20010665787942)
 ..(238,-165.80010658105741)..controls (238,-165.40010643392299) and 
(238,-165.00010628678857)
 ..(238,-164.60010613965414)..controls (238,-164.2001060472048) and 
(238,-163.80010595475545)
 ..(238,-163.40010586230611)..controls (238,-155.56353466513065) and 
(231.9683162849897,-149)
 ..(224.2552179837387,-149)..controls (223.85521783436539,-149) and 
(223.45521768499208,-149)
 ..(223.05521753561877,-149)..controls (222.65521740514737,-149) and 
(222.255217274676,-149)
 ..(221.8552171442046,-149)..controls (221.45521705001735,-149) and 
(221.0552169558301,-149)
 ..(220.65521686164286,-149)..controls (220.25521665589685,-149) and 
(219.85521645015083,-149)
 ..(219.45521624440482,-149)..controls (219.05521631807508,-149) and 
(218.65521639174534,-149)
 ..(218.2552164654156,-149)..controls (217.85521724037432,-149) and 
(217.45521801533303,-149)
 ..(217.05521879029175,-149)..controls (216.6552203077878,-149) and 
(216.25522182528385,-149)
 ..(215.85522334277991,-149)..controls (215.45522405083273,-149) and 
(215.05522475888554,-149)
 ..(214.65522546693836,-149)..controls (214.25522550518758,-149) and 
(213.8552255434368,-149)
 ..(213.45522558168602,-149)..controls (213.0552253720042,-149) and 
(212.65522516232238,-149)
 ..(212.25522495264056,-149)..controls (211.8552248680295,-149) and 
(211.45522478341843,-149)
 ..(211.05522469880736,-149)..controls (210.65522456100436,-149) and 
(210.25522442320135,-149)
 ..(209.85522428539835,-149)..controls (209.45522414149036,-149) and 
(209.05522399758237,-149)
 ..(208.65522385367439,-149)..controls (200.95716230583835,-149) and 
(195,-155.63452868682958)
 ..(195,-163.48966401016395)..controls (195,-163.88966411101083) and 
(195,-164.28966421185771)
 ..(195,-164.68966431270459)..controls (195,-165.08966445890775) and 
(195,-165.4896646051109)
 ..(195,-165.88966475131406)..controls (195,-166.25981210471718) and 
(195,-166.62995945812031)
 ..(195,-167.00010681152344);
picture pic;
pic := lmt_followtext [
  text = texstring,
  path = parpath,
  spread = false,
];


\stopMPpage
\stoptext

lmt_followtext crashes  on this code with:

metapost log> ! angle(0,0) is taken as zero.
metapost log>  ...0)]shifted(-wid/2,0)rotated(angle(ad))
metapost log>   
shifted.ap;draw.pic[(EXPR0...
metapost log>  ...caled0.5pt.withcolor.green;fi;endfor
metapost log>   
;if((autoscaleupfollowtext...
metapost log> 
metapost log> image->...ture;currentpicture:=nullpicture;(TEXT3)
metapost log>   
;currentpicture.if.str(SUF...
metapost log> 
metapost log> followtext->...b_n;setbounds.currentpicture.to.b;)
metapost log>   endgroup
metapost log>  ...parameter"path"),getparameter"text")
metapost log>   
;popparameters;
metapost log> image->...ture;currentpicture:=nullpicture;(TEXT3)
metapost log>   
;currentpicture.if.str(SUF...
metapost log> 
metapost log> lmt_do_followtext->...meter"text");popparameters;)
metapost log>   endgroup
metapost log>  lmt_do_followtext
metapost log>   
metapost log> <*> ...exstring, path = parpath, spread = false, ]
metapost log>   ; ;


When I adapt the parameters that create parpath in my code, other uses of 
lmt_followtext crash. The same combinations of text and path so far haven’t 
crashed basic followtext().

I’ve run into comparable situations in my own code where I had to add code to 
handle the existence of a (0,0) direction (e.g. when I had two identical points 
on a path, but that is not the case here). The above minimal example triggers 
the failure.

G___
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] followtext, lmt_followtext and an offset of the glyphs typeset along the path (suggestion works)

2020-05-03 Thread Gerben Wierda

> On 3 May 2020, at 15:01, Gerben Wierda  wrote:
> 
>>>>> Am 01.05.2020 um 10:26 schrieb Gerben Wierda >>>> <mailto:gerben.wie...@rna.nl>>:
>>>>> 
>>>>> I have been looking at lmt_followtext and followtext to get typesetting 
>>>>> done along a path. That works fine, except that in my case, I need the 
>>>>> text to not be exactly on that path, I need it to hover slightly above 
>>>>> tor below he path. Given that the path may have an unpredictable form, 
>>>>> that means that all the glyphs need to be shifted a bit, there is no 
>>>>> generic transfrom of the entire text string that will work,
>>>> 
>>>> Can’t you duplicate and shift the path, i.e. keep the original visible and 
>>>> make the copy that carries the text invisible? That’s what I would do in a 
>>>> graphical application, but I would be surprised if MP wouldn’t know a 
>>>> transformation for this purpose.
>>> 
>>> No, that is what I did in the example, fiddling, but there is no 
>>> transformation that will work in all cases. E.g. on the left side of the 
>>> bump, I need to go to the upper left, on the right side to the upper right. 
>>> There is no single shift that helps me. Nor a scale rotation or shift 
>>> combination. That could be managed by only going up (though the distance to 
>>> the path would vary, on the sides the text would be very close or on the 
>>> top it would be too far.)
>>> 
>> 
>> There is an example, at the link below, of creating a parallel path that 
>> claims to cope with sharp bends in the original path. You might be able to 
>> adapt it?
>> <https://therion.speleo.sk/wiki/metapost#shuttering_two_parallel_lines 
>> <https://therion.speleo.sk/wiki/metapost#shuttering_two_parallel_lines>>
> 
> That looks great. I’m going to investigate.

That approach works fine. Example trial code:

\starttext

\startMPpage
vardef parallelpath (expr P, gap)=
  % adapted from 
https://therion.speleo.sk/wiki/metapost#shuttering_two_parallel_lines
  save pathlength, linegap, testdiameter, testpath, innerpath, newpoint, 
curlength, intersections, samplepoint, sampledir, accuracy;
  % work out a parallel path
  % the easy way is to sample direction every few units, and add a parallel 
point into a new path
  % however, this causes weird loops at sharp corners, so check if a sharp 
corner is coming up within
  % the length of the gap between lines, and ignore that point if so
  pathlength:=arclength P;
  linegap:=gap;
  accuracy:=2;
  testdiameter:=linegap;
  path testpath;
  testpath:=(halfcircle rotated 180) scaled testdiameter;
  pair newpoint;
  pair sampledir;
  path innerpath;
  pair intersections;
  curlength:=0;
  forever:
samplepoint:=arctime curlength of P;
sampledir:=direction samplepoint of P;
newpoint:=((point samplepoint of P) shifted (linegap * unitvector(sampledir 
rotated -90)));
if curlength = 0:
  innerpath:=newpoint{sampledir};
fi
% every now and then along the line, place a semicircle, rotated to face 
away from the line, offset by the thickness of the line,
% with a radius the same as the gap between the lines - if its ends touch 
the main line's centre, the corner is too sharp to use
% this point
save truetestpath; path truetestpath; truetestpath := (testpath rotated 
(angle sampledir) shifted (point samplepoint of P));
intersections:=P intersectiontimes truetestpath;
% if there are no intersections, intersectiontimes returns (-1,-1), 
otherwise it returns the distance along each path (P,testpath)
% where the intersection happened >=0
if (xpart intersections) = -1:
  show "ADDED", newpoint{sampledir};
  innerpath:=innerpath .. newpoint{sampledir};
else:
  show "REJECTED", newpoint{sampledir};
  draw truetestpath withcolor green withtransparency (1,0.1);
fi;
exitif curlength = pathlength;
% move in small steps, to take account of tight backwards curves, and to 
get points near a corner
curlength:=curlength + testdiameter/accuracy;
if curlength > pathlength:
  curlength:=pathlength;
fi;
  endfor;
  if known innerpath:
if cycle P:
  innerpath:=innerpath .. cycle;
fi;
  fi;
  innerpath
enddef;

path testIn, testOut;

testIn := (0,0)..(100,50)..(50,100)..(130,0);
testOut := parallelpath( testIn, 2);

draw testIn withpen pencircle scaled 1;
%draw testOut withpen pencircle scaled 1 withcolor red;
draw lmt_followtext [
  text = "How well does it work? {\it It works very well!} {\bf It looks good 
enough.}",
  path = reverse testOut,
  spread = false,
];

Going to work with it. Thanks again.

G

___
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] followtext, lmt_followtext and an offset of the glyphs typeset along the path

2020-05-03 Thread Gerben Wierda
>>>> Am 01.05.2020 um 10:26 schrieb Gerben Wierda :
>>>> 
>>>> I have been looking at lmt_followtext and followtext to get typesetting 
>>>> done along a path. That works fine, except that in my case, I need the 
>>>> text to not be exactly on that path, I need it to hover slightly above tor 
>>>> below he path. Given that the path may have an unpredictable form, that 
>>>> means that all the glyphs need to be shifted a bit, there is no generic 
>>>> transfrom of the entire text string that will work,
>>> 
>>> Can’t you duplicate and shift the path, i.e. keep the original visible and 
>>> make the copy that carries the text invisible? That’s what I would do in a 
>>> graphical application, but I would be surprised if MP wouldn’t know a 
>>> transformation for this purpose.
>> 
>> No, that is what I did in the example, fiddling, but there is no 
>> transformation that will work in all cases. E.g. on the left side of the 
>> bump, I need to go to the upper left, on the right side to the upper right. 
>> There is no single shift that helps me. Nor a scale rotation or shift 
>> combination. That could be managed by only going up (though the distance to 
>> the path would vary, on the sides the text would be very close or on the top 
>> it would be too far.)
>> 
> 
> There is an example, at the link below, of creating a parallel path that 
> claims to cope with sharp bends in the original path. You might be able to 
> adapt it?
> <https://therion.speleo.sk/wiki/metapost#shuttering_two_parallel_lines 
> <https://therion.speleo.sk/wiki/metapost#shuttering_two_parallel_lines>>

That looks great. I’m going to investigate.

G

___
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] How do I add cyrillic to my typescript/document?

2020-05-03 Thread Gerben Wierda
I am looking for a way to amend a typescript for the additional use of cyrillic 
characters.

I currently use:

 \starttypescript [sans] [optima]
   \setups[font:fallback:sans]
   \definefontsynonym [Sans]   [file:Optima.ttc(Optima Regular)] 
[features=default]
   \definefontsynonym [SansBold]   [file:Optima.ttc(Optima Bold)]
[features=default]
   \definefontsynonym [SansItalic] [file:Optima.ttc(Optima Italic)]  
[features=default]
   \definefontsynonym [SansBoldItalic] [file:Optima.ttc(Optima Bold Italic)] 
[features=default]
\stoptypescript

\definetypeface [optima] [ss] [sans] [optima] [default]
\definetypeface [optima] [rm] [serif] [optima] [default]
\definetypeface [optima] [tt] [mono] [modern] [default]
\definetypeface [optima] [mm] [math] [pagella] [default]

\setupbodyfont [optima]

But Optima doesn’t have cyrillic characters. So, either I have te  use another 
typescript. I tried creating a Helvetica (as Helvetica.ttc on macOS seems to 
have cyrillic characters) but did not succeed.


I also tried

\language[ru]

without any \setupbodyfont hoping it would also fix the font issue but keep 
getting

fonts   > checking > char –® (U+00428) in font 'LMRoman10-Regular' with 
id 8: missing

I read the languages-mkiv document but it did not say what I had to do about 
fonts.

What do I have to do to get both English and Russian in my document in terms of 
fonts?

G___
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] How do I add cyrillic to my typescript/document?

2020-05-03 Thread Gerben Wierda
ConTeXtgarden had theanswer when I searched again:

\setupbodyfont[dejavu]
\mainlanguage[russian]

G


> On 3 May 2020, at 13:34, Gerben Wierda  wrote:
> 
> I am looking for a way to amend a typescript for the additional use of 
> cyrillic characters.
> 
> I currently use:
> 
>  \starttypescript [sans] [optima]
>\setups[font:fallback:sans]
>\definefontsynonym [Sans]   [file:Optima.ttc(Optima Regular)] 
> [features=default]
>\definefontsynonym [SansBold]   [file:Optima.ttc(Optima Bold)]
> [features=default]
>\definefontsynonym [SansItalic] [file:Optima.ttc(Optima Italic)]  
> [features=default]
>\definefontsynonym [SansBoldItalic] [file:Optima.ttc(Optima Bold Italic)] 
> [features=default]
> \stoptypescript
> 
> \definetypeface [optima] [ss] [sans] [optima] [default]
> \definetypeface [optima] [rm] [serif] [optima] [default]
> \definetypeface [optima] [tt] [mono] [modern] [default]
> \definetypeface [optima] [mm] [math] [pagella] [default]
> 
> \setupbodyfont [optima]
> 
> But Optima doesn’t have cyrillic characters. So, either I have te  use 
> another typescript. I tried creating a Helvetica (as Helvetica.ttc on macOS 
> seems to have cyrillic characters) but did not succeed.
> 
> 
> I also tried
> 
> \language[ru]
> 
> without any \setupbodyfont hoping it would also fix the font issue but keep 
> getting
> 
> fonts   > checking > char –® (U+00428) in font 'LMRoman10-Regular' 
> with id 8: missing
> 
> I read the languages-mkiv document but it did not say what I had to do about 
> fonts.
> 
> What do I have to do to get both English and Russian in my document in terms 
> of fonts?
> 
> G
> ___
> 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] module article-basic interferes with \definebodyfont?

2020-05-01 Thread Gerben Wierda
> use pagella math with optima, not modern
> 
Zo?

\definetypeface [optima] [mm] [math] [pagella] [default]

Ik gok, want documentatie die dat helder maakt heb ik niet. Er is geen uitleg 
in de manuals die bij de standalone context komen en op ContextGarden vond ik 
vooral mkii zaken die niet meer geldig/juist zijn.

G___
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] module article-basic interferes with \definebodyfont?

2020-05-01 Thread Gerben Wierda
On 1 May 2020, at 16:02, Wolfgang Schuster  
wrote:
> 
> Gerben Wierda schrieb am 01.05.2020 um 13:58:
>> \definetypeface [optima] [ss] [sans] [optima] [default]
>> \definetypeface [optima] [rm] [serif] [optima] [default]
>> \definetypeface [optima] [tt] [mono] [modern] [default]
>> \definetypeface [optima] [mm] [math] [optima] [default]
>> \setupbodyfont [optima]
>> As I now understand it, I have now defined the typescript for sans, but 
>> created a setup that sans is the fallback. I have also defined rm, tt and mm 
>> explicitly.
> 
> This does not work because you have no serif or math typescripts
> for optima (\starttypescript [serif] [optima]) defined.

Yes, I was in doubt about that, but I guessed that the fallback maybe took care 
of that. 

   \setups[font:fallback:sans]

mm should be modern anyway, I think (not that I need it, I only want the ss 
form anyway).

G

> 
> Wolfgang

___
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] followtext, lmt_followtext and an offset of the glyphs typeset along the path

2020-05-01 Thread Gerben Wierda


> On 1 May 2020, at 17:10, Henning Hraban Ramm  wrote:
> 
> 
> 
>> Am 01.05.2020 um 10:26 schrieb Gerben Wierda :
>> 
>> I have been looking at lmt_followtext and followtext to get typesetting done 
>> along a path. That works fine, except that in my case, I need the text to 
>> not be exactly on that path, I need it to hover slightly above tor below he 
>> path. Given that the path may have an unpredictable form, that means that 
>> all the glyphs need to be shifted a bit, there is no generic transfrom of 
>> the entire text string that will work,
> 
> Can’t you duplicate and shift the path, i.e. keep the original visible and 
> make the copy that carries the text invisible? That’s what I would do in a 
> graphical application, but I would be surprised if MP wouldn’t know a 
> transformation for this purpose.

No, that is what I did in the example, fiddling, but there is no transformation 
that will work in all cases. E.g. on the left side of the bump, I need to go to 
the upper left, on the right side to the upper right. There is no single shift 
that helps me. Nor a scale rotation or shift combination. That could be managed 
by only going up (though the distance to the path would vary, on the sides the 
text would be very close or on the top it would be too far.)

Yours,

G

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

___
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] Reverse traversing of xml.collected()?

2020-05-01 Thread Gerben Wierda


> On 1 May 2020, at 13:30, Hans Hagen  wrote:
> 
> On 5/1/2020 11:31 AM, Gerben Wierda wrote:
>> I’d like to travese the contents of an xml.collected() in a reverse order. I 
>> have
>> for connectionFromXML in xml.collected(viewFromXML,"/connection") do
>>   parseXMLConnection( rootFromXML, connectionFromXML, viewFromXML, 
>> rootFromOverrideXML)
>> end
>> I tried:
>> local relationTable = xml.collected(viewFromXML,"/connection")
>> for i=#relationTable, 1, -1 do
>>   connectionFromXML = relationTable[i]
>>   parseXMLConnection( rootFromXML, connectionFromXML, viewFromXML, 
>> rootFromOverrideXML)
>> end
>> But apparently my lua knowledge is lacking (severely, I might say) as this 
>> ends with “attempt to get length of a function value“
> 
> it's an iterator
> 
>> What is the correct way to do it?
> xml.all

Tried to find documentation, but failed.

Tried this:

local relationTable = xml.all(viewFromXML,"/connection")
for i=#relationTable, 1, -1 do
  connectionFromXML = relationTable[i]
  parseXMLConnection( rootFromXML, connectionFromXML, viewFromXML, 
rootFromOverrideXML)
end

but it fails as well.

G

> 
> -
>  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] module article-basic interferes with \definebodyfont?

2020-05-01 Thread Gerben Wierda


> On 1 May 2020, at 13:22, Wolfgang Schuster 
>  wrote:
> 
> Gerben Wierda schrieb am 01.05.2020 um 13:15:
>> The following code:
>> \enabletrackers[context.trace]
>> %\usemodule[article-basic]
>> \starttypescript [sans] [optima]
>>\setups[font:fallback:sans]
>>\definefontsynonym [Sans]   [file:Optima.ttc(Optima Regular)] 
>> [features=default]
>>\definefontsynonym [SansBold]   [file:Optima.ttc(Optima Bold)]
>>  [features=default]
>>\definefontsynonym [SansItalic] [file:Optima.ttc(Optima Italic)]  
>>  [features=default]
>>\definefontsynonym [SansBoldItalic] [file:Optima.ttc(Optima Bold Italic)] 
>> [features=default]
>> \stoptypescript
>> \definetypeface [optima] [ss] [sans] [optima] [default]
> 
> Set a math font to avoid problems.
> 
>> \setupbodyfont [optima]
>> \starttext
>> \startMPpage[instance=doublefun]
>>   picture pic;
>> pic := textext("\definebodyfont[14.9pt][rm][default=Regular at 
>> 14.9pt]\switchtobodyfont[14.9pt]\setupinterlinespace[16.9pt]\framed[align=center,frame=off,offset=none,width=335.350bp]{\colored[r=0.000,
>>  g=0.000, b=0.000]{\rm (Artifact)\\}}");
> 
> You use \rm here which is used to switch to the serif typeface. When your 
> goal is to enforce the upright alternative you use the wrong command because 
> you need \tf for this.

Thank you, that got me the right info on ConTeXtgarden. I now use \tf and:

\starttypescript [sans] [optima]
   \setups[font:fallback:sans]
   \definefontsynonym [Sans]   [file:Optima.ttc(Optima Regular)] 
[features=default]
   \definefontsynonym [SansBold]   [file:Optima.ttc(Optima Bold)]
[features=default]
   \definefontsynonym [SansItalic] [file:Optima.ttc(Optima Italic)]  
[features=default]
   \definefontsynonym [SansBoldItalic] [file:Optima.ttc(Optima Bold Italic)] 
[features=default]
\stoptypescript

\definetypeface [optima] [ss] [sans] [optima] [default]
\definetypeface [optima] [rm] [serif] [optima] [default]
\definetypeface [optima] [tt] [mono] [modern] [default]
\definetypeface [optima] [mm] [math] [optima] [default]

\setupbodyfont [optima]

As I now understand it, I have now defined the typescript for sans, but created 
a setup that sans is the fallback. I have also defined rm, tt and mm explicitly.

But my guess is that if I had used ss instead of rm everywhere in my code it 
would have worked as well.

G

___
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] How do I get an empty line in a \framed[align=flushleft]{} item?

2020-05-01 Thread Gerben Wierda


> On 1 May 2020, at 13:28, Hans Hagen  wrote:
> 
> On 5/1/2020 10:21 AM, Gerben Wierda wrote:
>> code it back to a \ ? E.g. something like
>>{ ‘\U{XXX}', '\' },
> \utfchar{100}
> \Uchar 100

Yes, but the question was: how do I code this in the XML and get it through my 
XML-lua-METAPOST-textext() path so that e.g.  or  in the XML end up 
as \ in my textext() string?

E.g. a  in XML becomes a \n when lmtx XML handling has read the XML (so 
gets transformed on read). I’ve been thinking about the route  -> \r -> \ 
(so, misusing \r to code a TeX-\ in the XML, but that would probably not robust.

The question is more: what is a good UTF8 character to use (the first 32 would 
be good candidates if they would work and end in the strings that xml.foo() of 
lmtx produces).

G

> 
> -
>  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] module article-basic interferes with \definebodyfont?

2020-05-01 Thread Gerben Wierda
The following code:

\enabletrackers[context.trace]

%\usemodule[article-basic]

\starttypescript [sans] [optima]
   \setups[font:fallback:sans]
   \definefontsynonym [Sans]   [file:Optima.ttc(Optima Regular)] 
[features=default]
   \definefontsynonym [SansBold]   [file:Optima.ttc(Optima Bold)]
[features=default]
   \definefontsynonym [SansItalic] [file:Optima.ttc(Optima Italic)]  
[features=default]
   \definefontsynonym [SansBoldItalic] [file:Optima.ttc(Optima Bold Italic)] 
[features=default]
\stoptypescript

\definetypeface [optima] [ss] [sans] [optima] [default]

\setupbodyfont [optima]

\starttext

\startMPpage[instance=doublefun]
  picture pic;
pic := textext("\definebodyfont[14.9pt][rm][default=Regular at 
14.9pt]\switchtobodyfont[14.9pt]\setupinterlinespace[16.9pt]\framed[align=center,frame=off,offset=none,width=335.350bp]{\colored[r=0.000,
 g=0.000, b=0.000]{\rm (Artifact)\\}}");
draw pic scaled 1.13;
\stopMPpage

\stoptext

Produces nice Optima at 14.9pt without \usemodule[article-basic] (as above), 
but with \usemodule[article-basic] included, the output becomes some serif 
(modern?) font, but only if I use nonstandard font sizes.

Took me some time to hunt this one down.

I actually don’t know what article-basic does for me (I started out with an 
example given to me by Hans) and I don’t need it now, but I might need it later 
in combination with my own stuff

G___
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] How do I get an empty line in a \framed[align=flushleft]{} item?

2020-05-01 Thread Gerben Wierda


> On 1 May 2020, at 09:38, Hans Hagen  wrote:
> 
> On 5/1/2020 1:44 AM, Gerben Wierda wrote:
>>{ ‘\n', ‘\\strut' },
> often a \zwj or \zwno also works ok (has zero dimensions, contraty to strut; 
> you could also try \crlf

I tried \crlf{} and that worked too (the “{}” because I do not know what comes 
after even if I think any whitespace is eaten and to influence any catcode 
trickery, just feels it is more robust than a space).

Hans, an additional question about lmtx’s XML interface. As I want the TeX 
special characters to be able to be part of a label, I replace all of them. 
That works. But what if I would like a way to introduce TeX commands again by 
using some other UTF8 character, would there be a character that curvies the 
pass through lmtx, can be used in a lua table so that I can  (in a preferred 
order) get unescaped characters passed that flow?

E.g. code a \ as some weird UTF8 character in the XML file, and in that table I 
use

  local rep = lpeg.replacer {
   { '\n', '\\crlf{}' },
   { '{', '{\\textbraceleft}' },
   { '}', '{\\textbraceright}' },
   { '#', '{\\texthash}' },
   { '$', '{\\textdollar}' },
   { '&', '{\\textampersand}' },
   { '%', '{\\textpercent}' },
   { '\\','{\\textbackslash}' },
   { '|', '{\\textbar}' },
   { '_', '{\\textunderscore}' },
   { '~', '{\\textasciitilde}' },
   { '^', '{\\textasciicircum}' },
   { '"', "\"&\"" },
  }

code it back to a \ ? E.g. something like

   { ‘\U{XXX}', '\' },


> 
> 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] Reverse traversing of xml.collected()?

2020-05-01 Thread Gerben Wierda
I’d like to travese the contents of an xml.collected() in a reverse order. I 
have

for connectionFromXML in xml.collected(viewFromXML,"/connection") do
  parseXMLConnection( rootFromXML, connectionFromXML, viewFromXML, 
rootFromOverrideXML)
end

I tried:

local relationTable = xml.collected(viewFromXML,"/connection")
for i=#relationTable, 1, -1 do
  connectionFromXML = relationTable[i]
  parseXMLConnection( rootFromXML, connectionFromXML, viewFromXML, 
rootFromOverrideXML)
end

But apparently my lua knowledge is lacking (severely, I might say) as this ends 
with “attempt to get length of a function value “

What is the correct way to do it?

G___
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] followtext, lmt_followtext and an offset of the glyphs typeset along the path

2020-05-01 Thread Gerben Wierda
I have been looking at lmt_followtext and followtext to get typesetting done along a path. That works fine, except that in my case, I need the text to not be exactly on that path, I need it to hover slightly above tor below he path. Given that the path may have an unpredictable form, that means that all the glyphs need to be shifted a bit, there is no generic transfrom of the entire text string that will work,It should look a bit like this:

PastedGraphic-5.pdf
Description: Adobe PDF document
Could I for instance change a TeX snippet to shift all the glyphs (individually) up a bit before handing it to followtext(), that would be a non-intelligent way of going about it (as it would of course also stretch/shrink the space between the glyphs when a bend is rounded, but I can live with that for now)G___
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] How do I get an empty line in a \framed[align=flushleft]{} item?

2020-04-30 Thread Gerben Wierda

> On 30 Apr 2020, at 22:54, Wolfgang Schuster 
>  wrote:
> 
> Gerben Wierda schrieb am 30.04.2020 um 22:47:
>> In normal TeX, when I type
>> AapAap
>> I get something like
>> Aap
>> Aap
>> But inside a \framed[align=]{} the empty line disappears. How do I get it 
>> back?
>> Minimal example:
>> \starttext
>> TestingTesting
>> \page
>> \framed[align=flushleft]{TestingTesting}
>> \stoptext
> 
> Use \blank

Too happy too soon. And I recall I ran into this earlier a while ago in another 
setting ago. But I thought of a solution.

Background:

I am automatically converting input from an XML file to METAPOST/ConTeXt. The 
input may contain one or more newlines.The text must end up in 
\framed[align=??, width=??] to be typeset.

I use lua to convert and make it safe to pass to METAPOST as a string argument 
that METAPOST can pass on to textext(), using the following function:

function doubleQuotableEscapedConTeXtString( str)
  local rep = lpeg.replacer {
   { '\n', '\\blank ' },
   { '{', '{\\textbraceleft}' },
   { '}', '{\\textbraceright}' },
   { '#', '{\\texthash}' },
   { '$', '{\\textdollar}' },
   { '&', '{\\textampersand}' },
   { '%', '{\\textpercent}' },
   { '\\','{\\textbackslash}' },
   { '|', '{\\textbar}' },
   { '_', '{\\textunderscore}' },
   { '~', '{\\textasciitilde}' },
   { '^', '{\\textasciicircum}' },
   { '"', "\"&\"" },
  }
  return rep:match(str)
end

Where it now says \\blank, it used to say .

Problem

 gets me what I want if there is one \n (it turns into one new line), but 
with two \n in succession it still gets me only a single ’newline'
\\blank gets me what I want if there are multiple newlines, but gets me an 
extra empty line when I only want ’next line’ and multiple \blanks do not work 

But I found the solution by using \strut\\ instead of \blank. In the above 
table:

   { ‘\n', ‘\\strut' },

This fools ConTeXt in thinking there actually is something on that line and so 
multiple \\ will work.

G___
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] How do I get an empty line in a \framed[align=flushleft]{} item?

2020-04-30 Thread Gerben Wierda


> On 30 Apr 2020, at 22:51, Henning Hraban Ramm  wrote:
> 
> 
> 
>> Am 30.04.2020 um 22:47 schrieb Gerben Wierda :
>> 
>> In normal TeX, when I type 
>> 
>> AapAap
>> 
>> I get something like 
>> 
>> Aap
>> 
>> Aap
>> 
>> But inside a \framed[align=]{} the empty line disappears. How do I get it 
>> back?
> 
> Try \framedtext instead; multi line text needs a \vbox, and \framedtext does 
> that. (If I understood correctly.)
> 
> Maybe you need to set the align option.

I did set the align option to get a vbox.

G

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

___
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] How do I get an empty line in a \framed[align=flushleft]{} item?

2020-04-30 Thread Gerben Wierda
Brilliant! Thank you!

> On 30 Apr 2020, at 22:54, Wolfgang Schuster 
>  wrote:
> 
> Gerben Wierda schrieb am 30.04.2020 um 22:47:
>> In normal TeX, when I type
>> AapAap
>> I get something like
>> Aap
>> Aap
>> But inside a \framed[align=]{} the empty line disappears. How do I get it 
>> back?
>> Minimal example:
>> \starttext
>> TestingTesting
>> \page
>> \framed[align=flushleft]{TestingTesting}
>> \stoptext
> 
> Use \blank
> 
> Wolfgang

___
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] How do I get an empty line in a \framed[align=flushleft]{} item?

2020-04-30 Thread Gerben Wierda
In normal TeX, when I type 

AapAap

I get something like 

Aap

Aap

But inside a \framed[align=]{} the empty line disappears. How do I get it back?

Minimal example:

\starttext

TestingTesting
\page

\framed[align=flushleft]{TestingTesting}
\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
___


[NTG-context] Is this a MetaFun bug or intended behaviour?

2020-04-30 Thread Gerben Wierda
I wanted to use the macro simplified to remove duplicate points from a path, 
but it removes more than that:

metapost log> (127,-107)..controls (117,-107) and (107,-107)
metapost log>  ..(97,-107)..controls (97,-130.34) and 
(97,-153.66)
metapost log>  ..(97,-177)..controls (117,-177) and (137,-177)
metapost log>  ..(157,-177)..controls (157,-170.34) and 
(157,-163.66)
metapost log>  ..(157,-157)
metapost log> 
metapost log> >> Path at line 0:
metapost log> (97,-177)..controls (117,-177) and (137,-177)
metapost log>  ..(157,-177)..controls (157,-170.34) and 
(157,-163.66)
metapost log>  ..(157,-157)

First is path, second is simplified path.

Is simplified maybe only supposed to work with cycles?

G___
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] Using \startuseMPgraphic inside a textext() in METAPOST?

2020-04-27 Thread Gerben Wierda
I am in METAPOST which is inside TeX and I’d like (in METAPOST, not in TeX) to 
let a string follow a path. Adapting from the MetaFun manual around page 250, I 
tried this:

\starttext

\startMPpage[instance=doublefun]
pic p;
p := textext("\startuseMPgraphic[instance=doublefun]{followtokens}path RotPath 
; RotPath := fullcircle ;\stopuseMPgraphic\followtokens{I am creating a line of 
text here}");
draw pic;
\stopMPpage

\stoptext

But that does not work. Is there a way I can from within my METAPOST code get  
string (TeX code) to follow a path I have? In my case, I cannot escape outside 
the \startMPpage- -\stopMPpage environment, as the actual path is constructed 
there and the text following the path should be on that page.

G___
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] \framed[align=] with a 'maxwidth' instead of a width? Or get the size of a \frame returned to lua without typesetting it in a document?

2020-04-26 Thread Gerben Wierda
Setup:

TeX file
Contains ctxlua{} call
lua function reads XML file and calls context() statements, it 
puts out a
\startMPpage
METAPOST statements
Of which some are textext(\framed[align, so 
vbox, width defined by lua]{}, the whole TeX string for textext is created in 
lua and passed whole on to METAPOST as METAPOST is pretty limited on string 
manipulation compared to lua)
\stopMPpage

I am running into the following conundrum:

If I do give it a width (say a maximum) it will also be that wide when it is 
mostly empty if there is little text, this interferes with optimal placing
If I don’t give a width to the \framed command it may grow far too wide if 
there is a lot of text instead of wrapping around.

The typeset text is rather unpredictable. It may be three very short 
single-word lines with \\ at the end but it may also be a large paragraph.

So, I would like to find a way to let the \framed become a box as narrow as 
possible, but not growing wider than a pre-set width.

This is way too difficult for my meagre skills. What I could do (but I think is 
clumsy) is pass two \framed commands to METAPOST, have both by typeset with 
textext() and if the one without a width becomes too wide, take the one with 
the width set.

But I would like a neater option. E.g. call TeX (no need for METAPOST in 
between) from lua to typeset the \framed without actually typesetting it to the 
document and getting the dimensions back to lua so I can decide there what to 
do. Or a \specialframed command where I don’t give it a ‘width', but a 
‘maxwidth’

Is one of these doable? If not, I’ll have to implement the ‘clumsy’ route.

Preferably (the what is now thought of as ideal solution) I would be able in 
lua to give a piece of TeX code to TeX and ask it to produce a box and give me 
the dimensions of that box. That alone would give me an option, e.g.

- trial typeset
- if box surface (w*h) is more than what is available, shrink font size and 
lineheight so the total will be within set limits, then typeset it again with 
the smaller font and max width available
- else, if trial box width is more than the width available, typeset again with 
fixed width
- else use the way the trial box was typeset 

But I’m still puzzling.

G

PS. Why is the bbox of a textext(\framed[]{}) slightly larger than the frame?
___
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] Solution: METAPOST textext() eats my \pars. Was: Setting vertical spacing of lines inside a \framed[align=]

2020-04-25 Thread Gerben Wierda
On a hunch, I found a solution. I added \\ instead of \par at the end and goit 
exactly what I wanted.

\enabletrackers[context.trace]
\starttext

%\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000,
%b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
[My]\\Application\\(Component)\par}}

\startMPpage[instance=doublefun]
draw 
textext("\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000, b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
[My]\\Application\\(Component)\par}\par}");
draw 
(textext("\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000, b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
[My]\\Application\\(Component)\\}}") shifted (200,0));
\stopMPpage


\stoptext


G

> On 25 Apr 2020, at 00:51, Gerben Wierda  wrote:
> 
>> On 24 Apr 2020, at 18:40, Thomas A. Schmitz > <mailto:thomas.schm...@uni-bonn.de>> wrote:
>> 
>> 
>> 
>>> On 24. Apr 2020, at 18:19, Gerben Wierda >> <mailto:gerben.wie...@rna.nl>> wrote:
>>> 
>>> \starttext
>>> 
>>> \framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
>>>  g=0.000,
>>> b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[20pt] \rm 
>>> [My]\\Application\\(Component)}}
>>> 
>>> \stoptext
>>> 
>>> and if I change the value to 0.6, only the first line break gets packed 
>>> somewhat. But I can’t get the entire paragraph inside the frame packed. I 
>>> played around with the placing of setupinterlinespace in that snippet 
>>> above, but nothing really works so far.
>>> 
>> 
>> At the end of your frame, you need an explicit \par to make the change of 
>> linespacing work:
>> 
>> \framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
>>  g=0.000,
>> b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[14pt] \rm 
>> [My]\\Application\\(Component)\par }}
> 
> Thank you, that works. (Can’t put in the images to show, as this gets my 
> message over 100k)
> 
> But it turns out, I have an additional problem because I am doing this inside 
> a textext() from METAPOST and that seems to strip the \pars again. Tracking 
> ConTeXt:
> 
> cld > tex > f : 8 : picture pic; x:=33.000; y:=53.000; 
> w:=133.000; h:=53.000;pic := ApplicationComponentLogo( w, h, 
> (0.686,1.000,1.000), 0.200, 1.000, (0.000,0.000,0.000), 1.000, 0.700, 
> (0.000,0.000,0.000), 1.000, 
> "\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
>  g=0.000, b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
> [My]\\Application\\(Component)\par}}\par") shifted (x, -y); draw pic;path 
> AllNodeIds_idIC;  AllNodeIds_idIC := pathpart pic; pair AllNodeCenters_idIC; 
> AllNodeCenters_idIC := center pic;
> 
> which looks OK (this is lmtx passing the string to ConTeXt using the lua 
> context() call). The \pars are still there.
> 
> Then later, when METAPOST is at it and that same string is used to put into 
> textext(), it results in:
> 
> cld > tex > w : - : \MPLIBsetNtextX{3}{\framed 
> [align=flushright,frame=on,offset=none,width=106.400bp]{\colored [r=0.000, 
> g=0.000, b=0.000]{\switchtobodyfont [11.0pt]\setupinterlinespace [11.5pt] \rm 
> [My]\\Application\\(Component)}}}
> 
> 
> Minimal example:
> 
> \enabletrackers[context.trace]
> \starttext
> 
> % Works OK:
> \framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
>  g=0.000,
> b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
> [My]\\Application\\(Component)\par}}
> 
> % Doesn’t work:
> \startMPpage[instance=doublefun]
> draw 
> textext("\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
>  g=0.000, b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
> [My]\\Application\\(Component)\par}}\par");
> \stopMPpage
> 
> 
> \stoptext
> 
> So, now I’m looking for a way to prevent textext() to eat my \pars
> 
> G
> 
> ___
> 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] METAPOST textext() eats my \pars. Was: Setting vertical spacing of lines inside a \framed[align=]

2020-04-24 Thread Gerben Wierda
> On 24 Apr 2020, at 18:40, Thomas A. Schmitz  <mailto:thomas.schm...@uni-bonn.de>> wrote:
> 
> 
> 
>> On 24. Apr 2020, at 18:19, Gerben Wierda > <mailto:gerben.wie...@rna.nl>> wrote:
>> 
>> \starttext
>> 
>> \framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
>>  g=0.000,
>> b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[20pt] \rm 
>> [My]\\Application\\(Component)}}
>> 
>> \stoptext
>> 
>> and if I change the value to 0.6, only the first line break gets packed 
>> somewhat. But I can’t get the entire paragraph inside the frame packed. I 
>> played around with the placing of setupinterlinespace in that snippet above, 
>> but nothing really works so far.
>> 
> 
> At the end of your frame, you need an explicit \par to make the change of 
> linespacing work:
> 
> \framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
>  g=0.000,
> b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[14pt] \rm 
> [My]\\Application\\(Component)\par }}

Thank you, that works. (Can’t put in the images to show, as this gets my 
message over 100k)

But it turns out, I have an additional problem because I am doing this inside a 
textext() from METAPOST and that seems to strip the \pars again. Tracking 
ConTeXt:

cld > tex > f : 8 : picture pic; x:=33.000; y:=53.000; w:=133.000; 
h:=53.000;pic := ApplicationComponentLogo( w, h, (0.686,1.000,1.000), 0.200, 
1.000, (0.000,0.000,0.000), 1.000, 0.700, (0.000,0.000,0.000), 1.000, 
"\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000, b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
[My]\\Application\\(Component)\par}}\par") shifted (x, -y); draw pic;path 
AllNodeIds_idIC;  AllNodeIds_idIC := pathpart pic; pair AllNodeCenters_idIC; 
AllNodeCenters_idIC := center pic;

which looks OK (this is lmtx passing the string to ConTeXt using the lua 
context() call). The \pars are still there.

Then later, when METAPOST is at it and that same string is used to put into 
textext(), it results in:

cld > tex > w : - : \MPLIBsetNtextX{3}{\framed 
[align=flushright,frame=on,offset=none,width=106.400bp]{\colored [r=0.000, 
g=0.000, b=0.000]{\switchtobodyfont [11.0pt]\setupinterlinespace [11.5pt] \rm 
[My]\\Application\\(Component)}}}


Minimal example:

\enabletrackers[context.trace]
\starttext

% Works OK:
\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000,
b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
[My]\\Application\\(Component)\par}}

% Doesn’t work:
\startMPpage[instance=doublefun]
draw 
textext("\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000, b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
[My]\\Application\\(Component)\par}}\par");
\stopMPpage


\stoptext

So, now I’m looking for a way to prevent textext() to eat my \pars

G

___
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] METAPOST textext() eats my \pars. Was: Setting vertical spacing of lines inside a \framed[align=]

2020-04-24 Thread Gerben Wierda


> On 24 Apr 2020, at 18:40, Thomas A. Schmitz  <mailto:thomas.schm...@uni-bonn.de>> wrote:
> 
> 
> 
>> On 24. Apr 2020, at 18:19, Gerben Wierda > <mailto:gerben.wie...@rna.nl>> wrote:
>> 
>> \starttext
>> 
>> \framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
>>  g=0.000,
>> b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[20pt] \rm 
>> [My]\\Application\\(Component)}}
>> 
>> \stoptext
>> 
>> and if I change the value to 0.6, only the first line break gets packed 
>> somewhat. But I can’t get the entire paragraph inside the frame packed. I 
>> played around with the placing of setupinterlinespace in that snippet above, 
>> but nothing really works so far.
>> 
> 
> At the end of your frame, you need an explicit \par to make the change of 
> linespacing work:
> 
> \framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
>  g=0.000,
> b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[14pt] \rm 
> [My]\\Application\\(Component)\par }}

Thank you, that works: 



But it turns out, I have an additional problem because I am doing this inside a 
textext() from METAPOST and that seems to strip the \pars again. Tracking 
ConTeXt:

cld > tex > f : 8 : picture pic; x:=33.000; y:=53.000; w:=133.000; 
h:=53.000;pic := ApplicationComponentLogo( w, h, (0.686,1.000,1.000), 0.200, 
1.000, (0.000,0.000,0.000), 1.000, 0.700, (0.000,0.000,0.000), 1.000, 
"\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000, b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
[My]\\Application\\(Component)\par}}\par") shifted (x, -y); draw pic;path 
AllNodeIds_idIC;  AllNodeIds_idIC := pathpart pic; pair AllNodeCenters_idIC; 
AllNodeCenters_idIC := center pic;

which looks OK (this is lmtx passing the string to ConTeXt using the lua 
context() call). The \pars are still there.

Then later, when METAPOST is at it and that same string is used to put into 
textext(), it results in:

cld > tex > w : - : \MPLIBsetNtextX{3}{\framed 
[align=flushright,frame=on,offset=none,width=106.400bp]{\colored [r=0.000, 
g=0.000, b=0.000]{\switchtobodyfont [11.0pt]\setupinterlinespace [11.5pt] \rm 
[My]\\Application\\(Component)}}}

The result of which is



Minimal example:

\enabletrackers[context.trace]
\starttext

% Works OK:
\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000,
b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
[My]\\Application\\(Component)\par}}

% Doesn’t work:
\startMPpage[instance=doublefun]
draw 
textext("\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000, b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm 
[My]\\Application\\(Component)\par}}\par");
\stopMPpage


\stoptext

So, now I’m looking for a way to prevent textext() to eat my \pars

G___
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] Setting vertical spacing of lines inside a \framed[align=]

2020-04-24 Thread Gerben Wierda
Not possible in my case, unless I redefine them for each use (my code is 
generated from data with unpredictable colors), hut thanks anyway


Gerben Wierda
Chess and the Art of Enterprise Architecture
Mastering ArchiMate
Architecture for Real Enterprises at InfoWorld
On Slippery Ice at EAPJ

> On 24 Apr 2020, at 19:32, Wolfgang Schuster 
>  wrote:
> 
> Thomas A. Schmitz schrieb am 24.04.2020 um 18:40:
>>>> On 24. Apr 2020, at 18:19, Gerben Wierda  wrote:
>>> 
>>> \starttext
>>> 
>>> \framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
>>>  g=0.000,
>>> b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[20pt] \rm 
>>> [My]\\Application\\(Component)}}
>>> 
>>> \stoptext
>>> 
>>> and if I change the value to 0.6, only the first line break gets packed 
>>> somewhat. But I can’t get the entire paragraph inside the frame packed. I 
>>> played around with the placing of setupinterlinespace in that snippet 
>>> above, but nothing really works so far.
>> At the end of your frame, you need an explicit \par to make the change of 
>> linespacing work:
>> \framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
>>  g=0.000,
>> b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[14pt] \rm 
>> [My]\\Application\\(Component)\par }}
>> https://www.mail-archive.com/ntg-context@ntg.nl/msg45676.html
> 
> Use style/color keys when possible.
> 
> \starttext
> 
> \framed
>  [align=flushright,
>   offset=none,
>   width=106.400bp,
>   foregroundcolor=black,
> foregroundstyle={\switchtobodyfont[11.0pt]\setupinterlinespace[line=2.4ex]}]
>  {[My]\par Application\par (Component)\par}
> 
> \stoptext
> 
> Wolfgang
> ___
> 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] Setting vertical spacing of lines inside a \framed[align=]

2020-04-24 Thread Gerben Wierda
I want the lines in this frame packed more closely together:

\starttext

\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\setupinterlinespace[0.9]\colored[r=0.000,
 g=0.000,
b=0.000]{\switchtobodyfont[11.0pt] \rm [My]\\Application\\(Component)}}

\stoptext

I tried a bit of fiddling, and the following changes the height of the first 
line only:

\starttext

\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000,
 g=0.000,
b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[20pt] \rm 
[My]\\Application\\(Component)}}

\stoptext

and if I change the value to 0.6, only the first line break gets packed 
somewhat. But I can’t get the entire paragraph inside the frame packed. I 
played around with the placing of setupinterlinespace in that snippet above, 
but nothing really works so far.

I left the \colored etc in, because I also need to do all of those, so I need a 
solution that works in the above setting.

Gerben Wierda
Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>
Architecture for Real Enterprises 
<https://www.infoworld.com/blog/architecture-for-real-enterprises/> at InfoWorld
On Slippery Ice <https://eapj.org/on-slippery-ice/> at EAPJ

> On 24 Apr 2020, at 17:54, Wolfgang Schuster 
>  wrote:
> 
> Gerben Wierda schrieb am 24.04.2020 um 17:38:
>> I have been experimenting with \startpacked..\stoppacked but it doesn’t seem 
>> to work. What is the preferred way of getting lines in a normal paragraph 
>> (actually, we’re talking about a \framed with align, so a full paragraph in 
>> a TeX \vbox)
> 
> Do you want to have a linebreak at the end of the frame
> 
> \starttext
> 
> \startframed
> \samplefile{knuth}
> \stopframed
> 
> \startframed[width=max,align=normal]
> \samplefile{knuth}
> \stopframed
> 
> \stoptext
> 
> or do you want to change to change the spacing
> 
> \starttext
> 
> \startframedtext[width=max,style={\setupinterlinespace[medium]}]
> \samplefile{knuth}
> \stopframedtext
> 
> \startframedtext[width=max,style={\setupwhitespace[medium]}]
> \samplefile{knuth}
> \stopframedtext
> 
> \stoptext
> 
> Wolfgang

___
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] Setting vertical spacing of lines inside a \framed[align=]

2020-04-24 Thread Gerben Wierda
I have been experimenting with \startpacked..\stoppacked but it doesn’t seem to 
work. What is the preferred way of getting lines in a normal paragraph 
(actually, we’re talking about a \framed with align, so a full paragraph in a 
TeX \vbox)

(In addition, I try to find this kind of information first, in the manuals and 
in ConTeXtgarden, but I am failing. E.g. I look it up in the manual, do not 
really find it, then look it up in ConTeXt garden but it isn’t really 
documentend, then click ‘look in source’ and th elink doesn’t work. So, I have 
to bother people on the list for a basic question like this. I must be doing 
something wrong and looking in the wrong place)

Gerben Wierda
Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>
Architecture for Real Enterprises 
<https://www.infoworld.com/blog/architecture-for-real-enterprises/> at InfoWorld
On Slippery Ice <https://eapj.org/on-slippery-ice/> at EAPJ

___
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] Basic font question (Optima, but no bold, no italics). Standalone ConTeXt does not work. TeX Live 2019 works

2020-04-24 Thread Gerben Wierda


> On 24 Apr 2020, at 11:56, Taco Hoekwater  wrote:
> 
> Hi,
> 
> FYI, my "context mkiv” standalone seems to be fine (latest download). 
> “lmtx” standalone (also latest download) not so much (same problems).

Thx. How do I get/install a ‘context mkiv’ standalone? The standalone on 
http://www.pragma-ade.com/install.htm  
is only LMTX.

G

> 
> Looks like something is broken in ltmx’ TTC parser.
> 
> OS X Catalina 10.15.4
> 
> Taco
> ___
> 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] ConTeXt beta issue? Was: Basic font question (Optima, but no bold, no italics). Standalone ConTeXt (beta) does not work. TeX Live 2019 works

2020-04-24 Thread Gerben Wierda
As per the fuller console output I included (where you can find all the details 
of the run as put out by ConTeXt):

This is LuaMetaTeX, Version 2.05.01 
open source > level 1, order 1, name 'cont-yes.mkiv'
system  > 
system  > ConTeXt  ver: 2020.04.03 10:31 MKIV beta  fmt: 2020.4.7  int: 
english/english
system  > 
system  > 'cont-new.mkiv' loaded

If the standalone is used, it doesn’t work. If TeX Live 2019 is used, it does 
work.

Note, there is no ‘luatex’ command in the standalone. And I get a different 
output from the --version command for context:

$ context --version
mtx-context | ConTeXt Process Management 1.03
mtx-context |
mtx-context | main context file: 
/usr/local/context-osx-64/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2019.07.24 11:31
mtx-context | main context file: 
/usr/local/context-osx-64/tex/texmf-context/tex/context/base/mkiv/context.mkxl
mtx-context | current version: 2020.02.17 19:36

The version differences probably from

system  > beware: some patches loaded from cont-new.mkiv

I seem to be running a beta. I seem to recall I installed that because Hans 
patched something, but I am uncertain. Hans?

G

> On 24 Apr 2020, at 08:54, Henning Hraban Ramm  wrote:
> 
> 
> 
>> Am 24.04.2020 um 08:48 schrieb Gerben Wierda :
>> 
>> Then I thought, let’s test some other things. I logged in as another user, 
>> and used ConTeXt from TeX Live 2019:
>> 
>> 
>> It seems to be that on my system, the standalone installed ConTeXt does not 
>> work with Optima, but the TeX Live installed one does.
> 
> So what’s your ConTeXt version?
> 
> context --version
> current version: 2020.01.30 14:13
> 
> luatex --version
> This is LuaTeX, Version 1.11.1 (TeX Live 2020/dev)
> 
> 
> Best, 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
> ___

___
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] Basic font question (Optima, but no bold, no italics). Standalone ConTeXt does not work. TeX Live 2019 works

2020-04-24 Thread Gerben Wierda


> On 24 Apr 2020, at 08:53, Wolfgang Schuster 
>  wrote:
> 
> Can you try this:
> 
> \definefontfamily [mainface] [rm] [Optima]
>   [it=optimaitalic,
>bf=optimabold,
>bi=optimabolditalic]

I altready did that earlier as per the Wiki information (did not report it) and 
just tried again. No difference.

G

___
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] Basic font question (Optima, but no bold, no italics). Standalone ConTeXt does not work. TeX Live 2019 works

2020-04-24 Thread Gerben Wierda
With Arial:

\definefontfamily[mainface][rm][Arial]
\setupbodyfont[mainface,10pt]



with Optima:

\definefontfamily[mainface][rm][Optima]
\setupbodyfont[mainface,10pt]


It doesn’t matter if the font statements are before or after \starttext

Then I thought, let’s test some other things. I logged in as another user, and 
used ConTeXt from TeX Live 2019:


It seems to be that on my system, the standalone installed ConTeXt does not 
work with Optima, but the TeX Live installed one does.

G



> On 24 Apr 2020, at 08:09, Henning Hraban Ramm  wrote:
> 
> 
> 
>> Am 24.04.2020 um 05:19 schrieb kaddour kardio :
>> 
>> It's noticed that Optima is a Sans Serif font.
>> Maybe it conflicts with MacOS way to handle fonts. 
> 
> No, ConTeXt doesn’t care what kind of font you define as rm/ss/tt, and the OS 
> has no say in that.
> 
> Best, 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
> ___

___
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] Basic font question (Optima, but no bold, no italics)

2020-04-23 Thread Gerben Wierda

> On 23 Apr 2020, at 19:18, Henning Hraban Ramm  wrote:
> 
>> 
>> Am 23.04.2020 um 16:42 schrieb Gerben Wierda :
>> 
>>> 
>>> On 23 Apr 2020, at 16:34, Henning Hraban Ramm  wrote:
>>> 
>>>> 
>>>> Am 23.04.2020 um 16:22 schrieb Gerben Wierda :
>>>> 
>>>> 
>>>> 
>>>>> On 23 Apr 2020, at 16:16, Vladimir Lomov  wrote:
>>>>> 
>>>>> Hello,
>>>>> ** Gerben Wierda  [2020-04-23 16:00:34 +0200]:
>>>>> 
>>>>>> On my Mac, I am trying:
>>>>> 
>>>>>> \definefontfamily[mainface][rm][Optima]
>>>>>> \setupbodyfont[mainface,10pt]
>>>>> 
>>>>>> {\bf Bold} and {\it Italic} and {\rm Regular} text.
>>>>> 
>>>>> https://wiki.contextgarden.net/Font_Switching
>>>>> 
>>>>>> What do I need to do to get actual bold and italics in my output?
>>>>> 
>>>>> \bi == \bf\it
>>>>> 
>>>>> Or by "actual bold" you mean something different?
>>>> 
>>>> Yes, in my output everything is regular, there is no bold or italics text, 
>>>> even when I use \bf or \it
>>> 
>>> What do you get from
>>> mtxrun --script=fonts --list --all --pattern=Optima
>> 
>> hermione:Export and Metapost gerben$ mtxrun --script fonts --list --all 
>> --pattern=optima
>> identifier familyname   fontname   filename  
>>  subfont   instances
>> 
>> optimablackoptima   optimaextrablack   
>> /System/Library/Fonts/Optima.ttc   5
>> optimabold optima   optimabold 
>> /System/Library/Fonts/Optima.ttc   2
>> optimabolditalic   optima   optimabolditalic   
>> /System/Library/Fonts/Optima.ttc   4
>> optimaextrablack   optima   optimaextrablack   
>> /System/Library/Fonts/Optima.ttc   5
>> optimaitalic   optima   optimaitalic   
>> /System/Library/Fonts/Optima.ttc   3
>> optimanormal   optima   optimaregular  
>> /System/Library/Fonts/Optima.ttc   1
>> optimaregular  optima   optimaregular  
>> /System/Library/Fonts/Optima.ttc   1
> 
> Hm. Here, ConTeXt only found subfont #5 until I rebuilt the font cache, then 
> it looked like yours.
> 
> And the minimal example (plus \starttext ... \stoptext) worked.
> 
> (Latest ConTeXt on MacOS Mojave.)


No such luck for me. Any help welcome. I did remove the macOS font cache with 
sudo atsutil databases -remove and I rebooted. I am running an up to date macOS 
Mojave.

\starttext
\definefontfamily[mainface][rm][Optima]
\setupbodyfont[mainface,10pt]

{\bf Bold} and {\it Italic} and {\rm Regular} text.
\stoptext

results in



Gerben Wierda
Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>
Architecture for Real Enterprises 
<https://www.infoworld.com/blog/architecture-for-real-enterprises/> at InfoWorld
On Slippery Ice <https://eapj.org/on-slippery-ice/> at EAPJ

Console:

$ context test.tex

resolvers   | formats | executing runner 'run luametatex format': 
/usr/local/context-osx-64/tex/texmf-osx-64/bin/luametatex --jobname="test" 
--fmt=/usr/local/context-osx-64/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt
 
--lua=/usr/local/context-osx-64/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui
 cont-yes.mkiv --c:currentrun=1 --c:fulljobname="./test.tex" 
--c:input="./test.tex" --c:kindofrun=1 --c:maxnofruns=9 
--c:texmfbinpath="/usr/local/context-osx-64/tex/texmf-osx-64/bin"
This is LuaMetaTeX, Version 2.05.01 
open source > level 1, order 1, name 'cont-yes.mkiv'
system  > 
system  > ConTeXt  ver: 2020.04.03 10:31 MKIV beta  fmt: 2020.4.7  int: 
english/english
system  > 
system  > 'cont-new.mkiv' loaded
open source > level 2, order 2, name 
'/usr/local/context-osx-64/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 2, order 2, name 
'/usr/local/context-osx-64/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > files > jobname 'test', input './test', result 'test'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 2, order 3, name './test.tex'
fonts   > preloading latin modern fonts (second s

Re: [NTG-context] Is there a 'sized' command equivalent to \colored?

2020-04-23 Thread Gerben Wierda
Answering my own question: \switchtobodyfont

> On 23 Apr 2020, at 16:45, Gerben Wierda  wrote:
> 
> I can directly colour a text in rgb by doing 
> \colored[r=0.8,b=0.6,c=0.4]{Text}. Suppose I want to hard code a piece of 
> text as 12.8pt, is there a simple way to do that directly like with \colored 
> for colour?
> 
> G
> ___
> 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] Is there a 'sized' command equivalent to \colored?

2020-04-23 Thread Gerben Wierda
I can directly colour a text in rgb by doing \colored[r=0.8,b=0.6,c=0.4]{Text}. 
Suppose I want to hard code a piece of text as 12.8pt, is there a simple way to 
do that directly like with \colored for colour?

G
___
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] Basic font question

2020-04-23 Thread Gerben Wierda

> On 23 Apr 2020, at 16:34, Henning Hraban Ramm  wrote:
> 
>> 
>> Am 23.04.2020 um 16:22 schrieb Gerben Wierda :
>> 
>> 
>> 
>>> On 23 Apr 2020, at 16:16, Vladimir Lomov  wrote:
>>> 
>>> Hello,
>>> ** Gerben Wierda  [2020-04-23 16:00:34 +0200]:
>>> 
>>>> On my Mac, I am trying:
>>> 
>>>> \definefontfamily[mainface][rm][Optima]
>>>> \setupbodyfont[mainface,10pt]
>>> 
>>>> {\bf Bold} and {\it Italic} and {\rm Regular} text.
>>> 
>>> https://wiki.contextgarden.net/Font_Switching
>>> 
>>>> What do I need to do to get actual bold and italics in my output?
>>> 
>>> \bi == \bf\it
>>> 
>>> Or by "actual bold" you mean something different?
>> 
>> Yes, in my output everything is regular, there is no bold or italics text, 
>> even when I use \bf or \it
> 
> What do you get from
> mtxrun --script=fonts --list --all --pattern=Optima

hermione:Export and Metapost gerben$ mtxrun --script fonts --list --all 
--pattern=optima
identifier familyname   fontname   filename 
  subfont   instances

optimablackoptima   optimaextrablack   
/System/Library/Fonts/Optima.ttc   5
optimabold optima   optimabold 
/System/Library/Fonts/Optima.ttc   2
optimabolditalic   optima   optimabolditalic   
/System/Library/Fonts/Optima.ttc   4
optimaextrablack   optima   optimaextrablack   
/System/Library/Fonts/Optima.ttc   5
optimaitalic   optima   optimaitalic   
/System/Library/Fonts/Optima.ttc   3
optimanormal   optima   optimaregular  
/System/Library/Fonts/Optima.ttc   1
optimaregular  optima   optimaregular  
/System/Library/Fonts/Optima.ttc   1

> ?
> 
> Best, 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
> ___

___
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] Basic font question

2020-04-23 Thread Gerben Wierda


> On 23 Apr 2020, at 16:16, Vladimir Lomov  wrote:
> 
> Hello,
> ** Gerben Wierda  [2020-04-23 16:00:34 +0200]:
> 
>> On my Mac, I am trying:
> 
>> \definefontfamily[mainface][rm][Optima]
>> \setupbodyfont[mainface,10pt]
> 
>> {\bf Bold} and {\it Italic} and {\rm Regular} text.
> 
> https://wiki.contextgarden.net/Font_Switching
> 
>> What do I need to do to get actual bold and italics in my output?
> 
> \bi == \bf\it
> 
> Or by "actual bold" you mean something different?

Yes, in my output everything is regular, there is no bold or italics text, even 
when I use \bf or \it

G

> 
>> Thx,
> 
>> G
> 
> ---
> WBR, Vladimir Lomov
> 
> -- 
> There has been an alarming increase in the number of things you know
> nothing about.
> ___
> 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] Basic font question

2020-04-23 Thread Gerben Wierda
On my Mac, I am trying:

\definefontfamily[mainface][rm][Optima]
\setupbodyfont[mainface,10pt]

{\bf Bold} and {\it Italic} and {\rm Regular} text.

What do I need to do to get actual bold and italics in my output?

Thx,

G___
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] METAPOST: How do I get this 'max' cutafter to work?

2020-04-22 Thread Gerben Wierda
> On 22 Apr 2020, at 09:30, Taco Hoekwater  wrote:
> 
> Hi,
> 
>> On 21 Apr 2020, at 17:52, Gerben Wierda  wrote:
>> 
>>> pair a ; a := arrowHead intersection_point connection ;
> 
> Hans’ example also works with “intersectionpoint”: the differences between 
> intersectionpoint
> and intersection_point are minimal except if there is no intersection at all.
> 
> The trick is that Hans does not use cutafter. cutafter is designed to cut off 
> as little as 
> possible, it is a cutbefore on both paths reversed. So, uses the last 
> intersection point of 
> the paths, and in this case it will therefore use the top of the arrowhead. 
> 
> In contrast, intersectionpoint finds the first intersection on the 
> non-reversed paths, which 
> is the base of the arrowhead.
> 
> Alternatively (in this case), you could move the arrowhead up a tiny amount, 
> so that there is 
> only one intersection between the connection and arrowHead.

In fact I did something like this, except that I first shortened the line path 
so it ends in the middle of the triangle before doing a cutafter (twice in both 
directions and taking the one which cuts the most). This works reliably.

I gave up on another approach (which repeatedly cut a little bit from the path 
until it wasn’t intersecting anymore, then taking the one form thelast 
successful intersection)  as I also have paths that connect a path-cycle to 
itself. A ‘cut until it just doesn’t intersect anymore' would eat up the entire 
path in that case until only a single point is left.

G

> 
> Best wishes,
> Taco
> ___
> 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] METAPOST: How do I get this 'max' cutafter to work?

2020-04-21 Thread Gerben Wierda


> On 21 Apr 2020, at 14:41, Hans Hagen  wrote:
> 
> On 4/21/2020 1:29 PM, Gerben Wierda wrote:
[snip]
> 
> \startMPpage[instance=doublefun]
> 
> path arrowHead;
> arrowHead :=
>(542,-77.000186920166016)..controls 
> (545.37,-77.000186920166016) and
>(548.63,-77.000186920166016) 
> ..(552,-77.000186920166016)..controls
>(550.37,-73.666853586832687) and
>(548.63,-70.333520253499344) 
> ..(547,-67.000186920166016)..controls
>(545.37,-70.333520253499344) and
>(543.63,-73.666853586832687) ..cycle;
> 
> path connection;
> connection :=
>  (420.4959106445,-367)..controls (420.66670256708773,-367) and
>  (421.55543111,-367) ..(422.0851913427,-367)..controls
>  (425.3917170194,-367) and (428.698242696,-367)
>  ..(432.0047683727,-367)..controls (442.0015894574,-367) and
>  (451.9984105426,-367) ..(461.9952316273,-367)..controls
>  (464.76142345324098,-367) and (467,-364.76142382108867)
>  ..(467,-361.9997656772)..controls (467,-293.218926) and
>  (467,-226.781074) ..(467,-158.0002343228)..controls
>  (467,-155.23857623850762) and (469.23857634039018,-153)
>  ..(472.0014901161,-153)..controls (495.3338300389,-153) and
>  (518.6661699617,-153) ..(541.9985098839,-153)..controls
>  (544.76142368504975,-153) and (547,-150.76142367339932)
>  ..(547,-147.9983662815)..controls (547,-125.9994554271) and
>  (547,-104.0005445727) ..(547,-82.00163371837)..controls
>  (547,-78.68047283764) and (547,-75.35931195691)
>  ..(547,-72.03815107618)..controls (547,-70.98183460417) and
>  (547,-68.666792551813217) ..(547,-67.000186920166016);
> 
> pair a ; a := arrowHead intersection_point connection ;
> 
> draw connection cutafter arrowHead   withcolor red   withpen 
> pencircle scaled 2mm ;
> draw connection cutafter (reverse arrowHead) withcolor green withpen 
> pencircle scaled 1mm ;
> 
> draw arrowHead;
> 
> draw a withcolor blue withpen pencircle scaled 3mm ;
> 
> currentpicture := currentpicture shifted (-bbwidth(currentpicture), 0) ;
> 
> draw connection cutafter a ;
> 
> draw arrowHead;
> 
> 
> \stopMPpage

Hi Hans, thanks.

I am completely in the dark why your intersection_point works (and thus if it 
will keep working in all circumstances).

I’d like to understand what is going on here. Why does intersection_point work 
where cutafter does not? After all, both are based on the same 
intersectiontimes primitive to find the intersection and they should thus find 
the same one: the ’perfect’ intersection which is the end point of the path 
that is to be cut. 

I’d like to understand this, because otherwise I might run into the same 
problem again later with slightly different paths involved. The first algo that 
I was using worked fine in most cases, as well, then I created one that worked 
with paths with ‘internal spikes’ and now I run into this where two comparable 
situations behaved differently and my question copied the one that didn’t work. 
And while this example from you works, I need to have something that is 100% 
reliable.

What METAPOST comes with is:

path cuttings;  % what got cut off

tertiarydef a cutbefore b =  % tries to cut as little as possible
  begingroup save t;
  (t, whatever) = a intersectiontimes b;
  if t<0:
cuttings:=point 0 of a;
a
  else: cuttings:= subpath (0,t) of a;
subpath (t,length a) of a
  fi
  endgroup
enddef;

tertiarydef a cutafter b =
  reverse (reverse a  cutbefore  b)
  hide(cuttings:=reverse cuttings)
enddef;

secondarydef p intersectionpoint q =
 begingroup save x_,y_; (x_,y_)=p intersectiontimes q;
 if x_<0: errmessage("The paths don't intersect"); origin
 else: .5[point x_ of p, point y_ of q] fi endgroup
enddef;

What is in MetaFun is:

boolean intersection_found ;

secondarydef p intersection_point q =
begingroup
save x_, y_ ;
(x_,y_) = p intersectiontimes q ;
if x_< 0 :
intersection_found := false ;
center p % origin
else :
intersection_found := true ;
.5[point x_ of p, point y_ of q]
fi
endgroup
enddef ;

The thing I can think of is cutting a bit, trying if it still intersects and if 
it does repeat and if it doesn’t take the previous result. I can’t rely on the 
length of cuttings being 0, because this is true in the case of no intersection 
(cuttings equals (0,0)) as well as a ‘perfect’ intersection at the end of the 
path (cuttings is the point at the end of the path). I could rely on cuttings 
being the path (0,0) but how do I compare paths (and not pairs)?

G 

Pretty deep into MP now. Even looked up the reference in John Hobby’s manual to 
the METAFONT book, but that reference did not help.


_

[NTG-context] METAPOST: How do I get this 'max' cutafter to work?

2020-04-21 Thread Gerben Wierda
I have these two paths, but cutting doesn’t work because the path to be cut 
takes the wrong intersection regardless of how I direct the path to be cut 
after (reverse or not).

The path to cut after is a triangle with the base horizontal and the path to 
cut is a vertical line. The top of the triangle is the endpoint of the line and 
is selected as intersection by cutafter. This happens also if I reverse the 
triangle path, strangely enough. I have an alternative cutting algorithm, but 
that cuts as long as the length of cuttings is not 0, which is the case at the 
top too, so it won’t cut further.

I need a reliable algorithm to make a ‘maximum cutafter’. What might be a good 
approach?

G

path arrowHead;
arrowHead :=
  (542,-77.000186920166016)..controls (545.37,-77.000186920166016) 
and (548.63,-77.000186920166016)
  ..(552,-77.000186920166016)..controls (550.37,-73.666853586832687)
  and (548.63,-70.333520253499344)
  ..(547,-67.000186920166016)..controls (545.37,-70.333520253499344)
  and (543.63,-73.666853586832687)
  ..cycle;

path connection;
connection :=
  (420.4959106445,-367)..controls (420.66670256708773,-367) and 
(421.55543111,-367)
  ..(422.0851913427,-367)..controls (425.3917170194,-367) and 
(428.698242696,-367)
  ..(432.0047683727,-367)..controls (442.0015894574,-367) and 
(451.9984105426,-367)
  ..(461.9952316273,-367)..controls (464.76142345324098,-367) and 
(467,-364.76142382108867)
  ..(467,-361.9997656772)..controls (467,-293.218926) and 
(467,-226.781074)
  ..(467,-158.0002343228)..controls (467,-155.23857623850762) and 
(469.23857634039018,-153)
  ..(472.0014901161,-153)..controls (495.3338300389,-153) and 
(518.6661699617,-153)
  ..(541.9985098839,-153)..controls (544.76142368504975,-153) and 
(547,-150.76142367339932)
  ..(547,-147.9983662815)..controls (547,-125.9994554271) and 
(547,-104.0005445727)
  ..(547,-82.00163371837)..controls (547,-78.68047283764) and 
(547,-75.35931195691)
  ..(547,-72.03815107618)..controls (547,-70.98183460417) and 
(547,-68.666792551813217)
  ..(547,-67.000186920166016);

show connection cutafter arrowHead;
show connection cutafter (reverse arrowHead);


___
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] Using command line values in a TeX document; writing a script?

2020-04-15 Thread Gerben Wierda


> On 15 Apr 2020, at 13:54, Wolfgang Schuster 
>  wrote:
> 
> Gerben Wierda schrieb am 15.04.2020 um 12:19:
>>> On 14 Apr 2020, at 11:52, Taco Hoekwater  wrote:
>>>> On 14 Apr 2020, at 11:25, Gerben Wierda  wrote:
>>>> 
>>>> This helps for adding information to my processing.
>>>> 
>>>> What I was also looking for is that I don’t have a test.tex anymore, just 
>>>> the XML file I am parsing and a command line action.
>>>> 
>>>> So, I use mtxrun, give it the name of an XML. lua code (using a ’script’ 
>>>> somewhere?) reads the XML, extracts a name (e.g. ‘foo’) from it, creates a 
>>>> .tex file (e.g. ‘foo.tex’), produces a .pdf file from that .tex file (e.g. 
>>>> ‘foo.pdf').
>>> When processing XML, I normally use
>>> 
>>>   context —environment=whatever.tex file.xml
>>> 
>>> with whatever.tex being a mix of tex and lua to setup and process the XML 
>>> directly,
>>> perhaps including other XML files as needed.
>> But this means that the whatever.tex file needs to exist beforehand and the 
>> result is whatever.pdf
>> 
>> I want the actual PDF to be produced have a name that comes from the XML I 
>> am processing and thus the whatever.tex file be created by lua. There is no 
>> whatever.tex file before I run the command.
>> 
>> Pre-command:
>>  XML:
>>  contains file name “foo”
>>  there is no .tex file
>> 
>> Command:
>>  produces foo.tex (gets the name from the XML) and “foo.pdf"
> 
> The TeX file in Tacos example contains the xmlsetup entries which are used
> to map the XML tags to ConTeXt commands and environment, the resulting
> PDF file has the same name as the XML file.

That is different from

 the resulting PDF file has the name of an entry/field in the XML file.

So, what I am looking for is:

command foo.xml

which results in 

bar.pdf

where ‘bar’ is text in foo.xml

G

> 
> Wolfgang
> 

___
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] Using command line values in a TeX document; writing a script?

2020-04-15 Thread Gerben Wierda


> On 14 Apr 2020, at 11:52, Taco Hoekwater  wrote:
> 
> 
> 
>> On 14 Apr 2020, at 11:25, Gerben Wierda  wrote:
>> 
>> This helps for adding information to my processing. 
>> 
>> What I was also looking for is that I don’t have a test.tex anymore, just 
>> the XML file I am parsing and a command line action.
>> 
>> So, I use mtxrun, give it the name of an XML. lua code (using a ’script’ 
>> somewhere?) reads the XML, extracts a name (e.g. ‘foo’) from it, creates a 
>> .tex file (e.g. ‘foo.tex’), produces a .pdf file from that .tex file (e.g. 
>> ‘foo.pdf').
> 
> When processing XML, I normally use 
> 
>   context —environment=whatever.tex file.xml
> 
> with whatever.tex being a mix of tex and lua to setup and process the XML 
> directly,
> perhaps including other XML files as needed.

But this means that the whatever.tex file needs to exist beforehand and the 
result is whatever.pdf

I want the actual PDF to be produced have a name that comes from the XML I am 
processing and thus the whatever.tex file be created by lua. There is no 
whatever.tex file before I run the command.

Pre-command:
XML:
contains file name “foo”
there is no .tex file

Command:
produces foo.tex (gets the name from the XML) and “foo.pdf"

G

> 
> But when you need to extract stuff and rename files, a Makefile or shell 
> script
> comes more naturally (at least for me).
> 
> Taco
> ___
> 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] Using command line values in a TeX document; writing a script?

2020-04-14 Thread Gerben Wierda
This helps for adding information to my processing. 

What I was also looking for is that I don’t have a test.tex anymore, just the 
XML file I am parsing and a command line action.

So, I use mtxrun, give it the name of an XML. lua code (using a ’script’ 
somewhere?) reads the XML, extracts a name (e.g. ‘foo’) from it, creates a .tex 
file (e.g. ‘foo.tex’), produces a .pdf file from that .tex file (e.g. 
‘foo.pdf').

G

> On 14 Apr 2020, at 09:16, Taco Hoekwater  wrote:
> 
> Hi Gerben,
> 
> What you want is quite easy to do since you are using lua already. Try this:
> 
>  % context --whatever=green test
> 
> with test.tex:
> 
>  \starttext
>  \startluacode
>  table.print(environment.arguments)
>  \stopluacode
>  \stoptext
> 
> everything from the command line ends up in environment.arguments.
> 
> Best wishes,
> Taco
> ___
> 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] Using command line values in a TeX document; writing a script?

2020-04-13 Thread Gerben Wierda
Currently, I process a file like this:

mtxrun --autogenerate --script context test12.tex

and in the file test12.tex one sees something like this:

\input archimate-mp
\ctxlua{moduledata.archimate(“myarchimatefile.xml")}

The latter parses the xml file and produces a PDF using generated MP code.

What I would like to do is not have to edit the .tex file when I want to 
process another .xml file but just pass the name of the xml file on the command 
line. And I would like to pass on a second filename with some local overrides 
settings fr my code. All of this needs to be data that I can use in my 
programming. E.g. something like:

mtxrun --autogenerate --script myscriptname “ myarchimatefile.xml” 
“myhelper.xml"

It is OK that this would produce a fixed name output file (e.g. 
myparsedxml.pdf), so it is OK to have some generic myparsedxml.tex (instead of 
test12.tex as per my example) file that produces a .pdf and more in the current 
working directory but resides somewhere in a generic place. But preferably, 
this would produce myarchimatefile.pdf

I’ve read the manual on mtxrun scripts to see if I can make my own, but I’m 
utterly failing to understand what is written in a way that let me write my own.

G___
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] METAPOST/MetaFun withtransparency doesn't accept my pair primary argument, what am I doing wrong?

2020-04-10 Thread Gerben Wierda
As I only use one transparency method anyway I could also fix this by passing a 
numeric instead of a pair and use the standard withtransparency (I don’t like 
overriding a standard MetaFun method, one never knows what might break in 
future updates).

vardef Foo( expr w, h, fillColor, fillTransparency) =
  show "FOO:", w, h, fillColor, fillTransparency;
  save pic; picture pic;
  save circ; path circ;
  circ := (fullcircle xyscaled (h,h));
  pic := image (
fill (circ shifted (w-h/2,-h/2)) withcolor fillColor withtransparency 
(1,fillTransparency);
  );
  pic
enddef;

picture pic;
pic := Foo( 150, 50, (0.686,1.000,1.000), 0.5);
draw pic;
\stopMPpage
\stoptext


> On 9 Apr 2020, at 18:06, Hans Hagen  wrote:
> 
> On 4/9/2020 4:58 PM, Gerben Wierda wrote:
>> \starttext
>> \startMPpage[instance=doublefun]
>> vardef Foo( expr w, h, fillColor, fillTransparency) =
>>   show "FOO:", w, h, fillColor, fillTransparency;
>>   save pic; picture pic;
>>   save circ; path circ;
>>   circ := (fullcircle xyscaled (h,h));
>>   pic := image (
>> fill (circ shifted (w-h/2,-h/2)) withcolor fillColor withtransparency 
>> fillTransparency;
>>   );
>>   pic
>> enddef;
>> pic := Foo( 150, 50, (0.686,1.000,1.000), (1,1.000));
>> draw pic;
>> \stopMPpage
>> \stoptext
> 
> Maybe this definition is better then but I need to test it more
> 
> \starttext
> \startMPpage[instance=doublefun]
> 
> def withtransparency expr t =
>if pair t :
>withprescript "tr_alternative="  & decimal 
> transparency_alternative_to_number(xpart t)
>withprescript "tr_transparency=" & decimal ypart t
>else :
>mfun_with_transparency (transparency_alternative_to_number(t))
>fi
> enddef ;
> 
> def mfun_with_transparency (expr a) expr t =
>withprescript "tr_alternative="  & decimal a
>withprescript "tr_transparency=" & decimal t
> enddef ;
> 
> vardef Foo ( expr w, h, fillColor, fillTransparency) =
>  image (
>fill fullcircle xyscaled (h,h) shifted (w-h/2,-h/2)
>withcolor fillColor
>withtransparency fillTransparency
>;
>  )
> enddef;
> 
> vardef FooX ( expr w, h, fillColor) =
>  image (
>fill fullcircle xyscaled (h,h) shifted (w-h/2,-h/2)
>withcolor fillColor
>withtransparency (normaltransparent, .5)
>;
>  )
> enddef;
> 
> vardef FooY ( expr w, h, fillColor) =
>  image (
>fill fullcircle xyscaled (h,h) shifted (w-h/2,-h/2)
>withcolor fillColor
>withtransparency normaltransparent .5
>;
>  )
> enddef;
> 
> draw Foo  ( 350, 50, (0.5,1,0), (1,.5));
> draw FooX ( 250, 50, (1,0.5,1));
> draw FooY ( 150, 50, (1,1,0.5));
> 
> \stopMPpage
> \stoptext
> 
> 
> -- 
> 
> -
>  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] METAPOST/MetaFun withtransparency doesn't accept my pair primary argument, what am I doing wrong?

2020-04-09 Thread Gerben Wierda
I have refactored my code to use withtransparency and separate parameters for 
colors, sizes, transparency, etc. But I’m running into a problem. The 
fillTransparency parameter is a pair primary (as can be seen from the show 
command)

Here is a pretty minimum example (in reality there are multiple colors and 
transparencies passed on):

\starttext
\startMPpage[instance=doublefun]

vardef Foo( expr w, h, fillColor, fillTransparency) =
  show "FOO:", w, h, fillColor, fillTransparency;
  save pic; picture pic;
  save circ; path circ;
  circ := (fullcircle xyscaled (h,h));
  pic := image (
fill (circ shifted (w-h/2,-h/2)) withcolor fillColor withtransparency 
fillTransparency;
  );
  pic
enddef;

pic := Foo( 150, 50, (0.686,1.000,1.000), (1,1.000));
draw pic;
\stopMPpage
\stoptext

and the result is:

metapost log> >> "FOO:"
metapost log> >> 150
metapost log> >> 50
metapost log> >> (0.68605,1,1)
metapost log> >> (1,1)
metapost log> ! Missing argument to withtransparency.
metapost log>  
metapost log>((1,1))
metapost log>  ...005,1,1))withtransparency((1,1))
metapost log>   ;
metapost log> image->...ture;currentpicture:=nullpicture;(TEXT3)
metapost log>   
;currentpicture.if.str(SUF...
metapost log> 
metapost log> Foo->...)withcolor(EXPR4)withtransparency(EXPR5);)
metapost log>   
;pic.endgroup
metapost log> <*> ...o( 150, 50, (0.686,1.000,1.000), (1,1.000))
metapost log>   ; draw pic; 
;

What am I doing wrong here?

Thanks,

G

PS. Given the complaint about asking both here and on tex.stackexchange, which 
of the two is the best place?___
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] Why does this example from the MetaFun manual not work?

2020-04-09 Thread Gerben Wierda
Thank you.


> On 9 Apr 2020, at 10:01, Taco Hoekwater  wrote:
> 
> Hi Gerben,
> 
> Changing the macro header to this will work:
> 
>   vardef SampleText (expr t)(text c) =
> 
> or you can use the answer from stackexchange, same approach.

> BTW Hans would like people to use “withtransparency” instead as that is a 
> newer, more flexible approach (but that would also need the above change,
> or a split into multiple parameters).

Oh, wait, I think I understand it. I would still do

vardef SampleText (expr t)(text c) =

and the call is SampleText( t, somecolor withtransparency sometransparency)

So, use withtrapsparency in the call?

I tried

\starttext
\startMPpage[instance=doublefun]

vardef SampleText (expr t)(text c)(text d) =
  save p ; picture p ;
  p := image (draw t infont "\truefontname{Regular}") ;
  draw (p shifted (- xpart center p,0)) scaled 5 withcolor c;
  draw (p shifted (- ypart center p,0)) scaled 5 withcolor d;
enddef;

SampleText ("Much Of This", transparent(1, .5, red  ) , transparent(1, .5, 
green  )) ;

\stopMPpage
\stoptext

But that does not work. Mmm. Maybe I need another approach to pass 4 values 
(r,g,b,t) as one parameter.

G 

> 
> Taco
> 
> 
>> On 9 Apr 2020, at 09:04, Gerben Wierda  wrote:
>> 
>> Nobody?
>> 
>>> On 8 Apr 2020, at 12:20, Gerben Wierda  wrote:
>>> 
>>> I would like to use the result of transparent() straight in my macros, so I 
>>> can pass the colors with transparency using a single parameter. That should 
>>> be possible if I understand the MetaFun manual (where I’ve copy-pasted this 
>>> example from):
>>> 
>>> \starttext
>>> \startMPpage[instance=doublefun]
>>> 
>>> vardef SampleText (expr t, c) =
>>>  save p ; picture p ;
>>>  p := image (draw t infont "\truefontname{Regular}") ;
>>>  draw (p shifted (- xpart center p,0)) scaled 5 withcolor c;
>>> enddef ;
>>> SampleText ("Much Of This"   , transparent(1, .5, red  )) ;
>>> SampleText ("Functionality"  , transparent(1, .5, green)) ;
>>> SampleText ("Was Written", transparent(1, .5, blue )) ;
>>> SampleText ("While Listening", transparent(1, .5, cmyk(1,0,0,0))) ;
>>> SampleText ("To the CD's Of" , transparent(1, .5, cmyk(0,1,0,0))) ;
>>> SampleText ("Tori Amos"  , transparent(1, .5, cmyk(0,0,1,0))) ;
>>> 
>>> \stopMPpage
>>> \stoptext
>>> 
>>> But it results in:
>>> 
>>> system  > files > jobname 'testcolor', input './testcolor', result 
>>> 'testcolor'
>>> fonts   > latin modern fonts are not preloaded
>>> languages   > language 'en' is active
>>> open source > level 2, order 3, name './testcolor.tex'
>>> fonts   > preloading latin modern fonts (second stage)
>>> fonts   > 'fallback modern-designsize rm 12pt' is loaded
>>> metapost> initializing instance 'doublefun:1' using format 
>>> 'metafun' and method 'double'
>>> metapost> loading 'metafun' as 
>>> '/usr/local/context-osx-64/tex/texmf-context/metapost/context/base/mpiv/metafun.mpxl'
>>>  using method 'double'
>>> metapost> initializing number mode 'double'
>>> metapost log> 
>>> metapost log> loading metafun, including plain.mp version 1.004 for 
>>> metafun iv and xl
>>> metapost log> 
>>> metapost log> ! Missing ')' has been inserted.
>>> metapost log>  
>>> metapost log>withprescript
>>> metapost log> transparent->(1)withprescript
>>> metapost log>  
>>> "tr_alternative="_alternat...
>>> metapost log> <*> ... ("Much Of This" , transparent(1, .5, red )
>>> metapost log>   ) ; 
>>> SampleText ("Functiona...
>>> metapost log> 
>>> backend > xmp > using file 
>>> '/usr/local/context-osx-64/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
>>> pages   > flushing realpage 1, userpage 1, subpage 1
>>> close source> level 2, order 3, name './testcolor.tex'
>>> close source> level 1, order 3, name 'cont-yes.mkiv'
>>> 
>>> For me, it is not about passing colour on to ConTeXt to typeset text, these 
>>> are colors that normally would be drawn with “withcolor ca withtransparency 
>>> (method

Re: [NTG-context] Why does this example from the MetaFun manual not work?

2020-04-09 Thread Gerben Wierda
Nobody?

> On 8 Apr 2020, at 12:20, Gerben Wierda  wrote:
> 
> I would like to use the result of transparent() straight in my macros, so I 
> can pass the colors with transparency using a single parameter. That should 
> be possible if I understand the MetaFun manual (where I’ve copy-pasted this 
> example from):
> 
> \starttext
> \startMPpage[instance=doublefun]
> 
> vardef SampleText (expr t, c) =
>   save p ; picture p ;
>   p := image (draw t infont "\truefontname{Regular}") ;
>   draw (p shifted (- xpart center p,0)) scaled 5 withcolor c;
> enddef ;
> SampleText ("Much Of This"   , transparent(1, .5, red  )) ;
> SampleText ("Functionality"  , transparent(1, .5, green)) ;
> SampleText ("Was Written", transparent(1, .5, blue )) ;
> SampleText ("While Listening", transparent(1, .5, cmyk(1,0,0,0))) ;
> SampleText ("To the CD's Of" , transparent(1, .5, cmyk(0,1,0,0))) ;
> SampleText ("Tori Amos"  , transparent(1, .5, cmyk(0,0,1,0))) ;
> 
> \stopMPpage
> \stoptext
> 
> But it results in:
> 
> system  > files > jobname 'testcolor', input './testcolor', result 
> 'testcolor'
> fonts   > latin modern fonts are not preloaded
> languages   > language 'en' is active
> open source > level 2, order 3, name './testcolor.tex'
> fonts   > preloading latin modern fonts (second stage)
> fonts   > 'fallback modern-designsize rm 12pt' is loaded
> metapost> initializing instance 'doublefun:1' using format 'metafun' 
> and method 'double'
> metapost> loading 'metafun' as 
> '/usr/local/context-osx-64/tex/texmf-context/metapost/context/base/mpiv/metafun.mpxl'
>  using method 'double'
> metapost> initializing number mode 'double'
> metapost log> 
> metapost log> loading metafun, including plain.mp version 1.004 for 
> metafun iv and xl
> metapost log> 
> metapost log> ! Missing ')' has been inserted.
> metapost log>  
> metapost log>withprescript
> metapost log> transparent->(1)withprescript
> metapost log>  
> "tr_alternative="_alternat...
> metapost log> <*> ... ("Much Of This" , transparent(1, .5, red )
> metapost log>   ) ; 
> SampleText ("Functiona...
> metapost log> 
> backend > xmp > using file 
> '/usr/local/context-osx-64/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
> pages   > flushing realpage 1, userpage 1, subpage 1
> close source> level 2, order 3, name './testcolor.tex'
> close source> level 1, order 3, name 'cont-yes.mkiv'
> 
> For me, it is not about passing colour on to ConTeXt to typeset text, these 
> are colors that normally would be drawn with “withcolor ca withtransparency 
> (method,factor)” but that requires the passing of many more parameters and a 
> lot more work in coding.
> 
> Does transparent() maybe produce a string that looks like “ca 
> withtransparency (method,factor)” so something only usable in draw/fill/etc 
> statements? But in that case how does that work without scantokens to parse 
> the string?
> 
> Is there a way I can do this without having twice the parameters (and I have 
> to pass multiple colours)  in my macros everywhere?
> 
> Thanks,
> 
> G
> ___
> 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] Why does this example from the MetaFun manual not work?

2020-04-08 Thread Gerben Wierda
I would like to use the result of transparent() straight in my macros, so I can 
pass the colors with transparency using a single parameter. That should be 
possible if I understand the MetaFun manual (where I’ve copy-pasted this 
example from):

\starttext
\startMPpage[instance=doublefun]

vardef SampleText (expr t, c) =
  save p ; picture p ;
  p := image (draw t infont "\truefontname{Regular}") ;
  draw (p shifted (- xpart center p,0)) scaled 5 withcolor c;
enddef ;
SampleText ("Much Of This"   , transparent(1, .5, red  )) ;
SampleText ("Functionality"  , transparent(1, .5, green)) ;
SampleText ("Was Written", transparent(1, .5, blue )) ;
SampleText ("While Listening", transparent(1, .5, cmyk(1,0,0,0))) ;
SampleText ("To the CD's Of" , transparent(1, .5, cmyk(0,1,0,0))) ;
SampleText ("Tori Amos"  , transparent(1, .5, cmyk(0,0,1,0))) ;

\stopMPpage
\stoptext

But it results in:

system  > files > jobname 'testcolor', input './testcolor', result 
'testcolor'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 2, order 3, name './testcolor.tex'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
metapost> initializing instance 'doublefun:1' using format 'metafun' 
and method 'double'
metapost> loading 'metafun' as 
'/usr/local/context-osx-64/tex/texmf-context/metapost/context/base/mpiv/metafun.mpxl'
 using method 'double'
metapost> initializing number mode 'double'
metapost log> 
metapost log> loading metafun, including plain.mp version 1.004 for metafun 
iv and xl
metapost log> 
metapost log> ! Missing ')' has been inserted.
metapost log>  
metapost log>withprescript
metapost log> transparent->(1)withprescript
metapost log>  
"tr_alternative="_alternat...
metapost log> <*> ... ("Much Of This" , transparent(1, .5, red )
metapost log>   ) ; 
SampleText ("Functiona...
metapost log> 
backend > xmp > using file 
'/usr/local/context-osx-64/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
pages   > flushing realpage 1, userpage 1, subpage 1
close source> level 2, order 3, name './testcolor.tex'
close source> level 1, order 3, name 'cont-yes.mkiv'

For me, it is not about passing colour on to ConTeXt to typeset text, these are 
colors that normally would be drawn with “withcolor ca withtransparency 
(method,factor)” but that requires the passing of many more parameters and a 
lot more work in coding.

Does transparent() maybe produce a string that looks like “ca withtransparency 
(method,factor)” so something only usable in draw/fill/etc statements? But in 
that case how does that work without scantokens to parse the string?

Is there a way I can do this without having twice the parameters (and I have to 
pass multiple colours)  in my macros everywhere?

Thanks,

G___
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] Trying to understand this ctxlua error

2020-04-06 Thread Gerben Wierda
On 6 Apr 2020, at 02:54, Wolfgang Schuster  
wrote:
> 
> Gerben Wierda schrieb am 06.04.2020 um 00:41:
>> I got this error after I had changed some lua code:
>> tex error   > tex error on line 272 in file archimate-lua.new: ! 
>> Undefined control sequence
>> warnIfVerbose( "Breaking off the processing of node %s\nNo
>>   l...eak
>>  xsi:type", node)
>> \luat_start_lua_code_indeed ...ormalexpanded {\endgroup \noexpand \directlua 
>> {#1
>>  
>> }}
>> l.272 \stopluacode
>> 
>> The control sequence at the end of the top line of your error message was 
>> never
>> \def'ed. You can just continue as I'll forget about whatever was undefined.
>> I have been looking at that code for over two hours, not seeing anything 
>> wrong with it. But I’ve now finally found the culprit and I still do not get 
>> it.
>> The culprit was:
>>   warnIfVerbose( "Breaking off the processing of %s\n No 
>> elementRef", node)
>> The problem goes away when I use:
>>   warnIfVerbose( "Breaking off the processing of %s\nNo elementRef", 
>> node)
>> (I don’t want the line after the node is printed to begin with a space).
>> But the lack of space between \n and N kills lua (apparently). For 
>> completeness (as string.format and texio.write_nl are also in play):
>> function warnWithLabelIfVerbose( str, ... )
>>   if verboseProgram then
>> texio.write_nl( str .. string.format(...))
>>   end
>> end
>> function warnIfVerbose( ... )
>>   warnWithLabelIfVerbose("-> ", ...)
>> end
>> Is this a lua bug? A ConTeXt bug? Expected behaviour? And if so, why is 
>> reported that on line 272 (where \stopluacode is) is the error? Or is the 
>> error message indeed helpful and do I just lack the know how to interpret it?
> 
> ConTeXt expands TeX commands in a luacode-environment
> and when you have \n followed by text you create a new
> command with starts with \n but since it isn't defined
> you get a error message.
> 
> In the example below the commented block produces
> the same error message as you get.
> 
> \starttext
> 
> %\startluacode
> %print("text\ntext")
> %\stopluacode
> 
> \startluacode
> print("text\n text")
> \stopluacode
> 
> \stoptext

OK, thanks. This means the ConTeXt environment mixes standard TeX (where \nfoo 
would be considered a TeX command) and lua string substitution (where \nfoo 
would mean a newline followed by foo), correct? I understand why that happens 
(otherwise one would have to escape all \ characters directed at TeX) but it 
really took me hours (because I did not understand the error message that 
correctly told me \Nno was the problem). It’s what you see depends on what you 
are looking for, I guess.

Maybe a warning in the documentation (or maybe there is one and I missed it)

G

___
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] Trying to understand this ctxlua error

2020-04-05 Thread Gerben Wierda
I got this error after I had changed some lua code:

tex error   > tex error on line 272 in file archimate-lua.new: ! Undefined 
control sequence

warnIfVerbose( "Breaking off the processing of node %s\nNo 
  l...eak   
 xsi:type", node)
\luat_start_lua_code_indeed ...ormalexpanded {\endgroup \noexpand \directlua {#1

}}
l.272 \stopluacode





The control sequence at the end of the top line of your error message was never
\def'ed. You can just continue as I'll forget about whatever was undefined.

I have been looking at that code for over two hours, not seeing anything wrong 
with it. But I’ve now finally found the culprit and I still do not get it.

The culprit was:

  warnIfVerbose( "Breaking off the processing of %s\n No elementRef", 
node)

The problem goes away when I use:

  warnIfVerbose( "Breaking off the processing of %s\nNo elementRef", 
node)

(I don’t want the line after the node is printed to begin with a space).

But the lack of space between \n and N kills lua (apparently). For completeness 
(as string.format and texio.write_nl are also in play):

function warnWithLabelIfVerbose( str, ... )
  if verboseProgram then
texio.write_nl( str .. string.format(...))
  end
end

function warnIfVerbose( ... )
  warnWithLabelIfVerbose("-> ", ...)
end

Is this a lua bug? A ConTeXt bug? Expected behaviour? And if so, why is 
reported that on line 272 (where \stopluacode is) is the error? Or is the error 
message indeed helpful and do I just lack the know how to interpret it?

G

(Took me three hours, this one. Just removing that space that happened with 
some other changes was the culprit. Totally unexpected for me.)___
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] Bounding box of picture returned by textext() in METAPOST

2020-04-05 Thread Gerben Wierda
Nobody?

> On 4 Apr 2020, at 22:58, Gerben Wierda  wrote:
> 
> I have this METAPOST macro:
> 
> vardef makeTeXLabel( expr w, h, name) =
>   if debugProgram or debugLabels: show "NAME makeTeXLabel:", name, tostring 
> 0.8w, tostring 0.8h; fi
>   save p; picture p;
>   p := textext( "\startframedtext[middle]" &
> "[align=middle,frame=on" &
> ",width=" & tostring 0.8w & "bp" &
> ",height=" & tostring 0.8h & "bp]" &
> name & "\stopframedtext");
>   save b; path b; b := boundingbox p;
>   save dim; pair dim;
>   dim := (urcorner b) - (llcorner b);
>   save width, height; numeric width, height;
>   width := xpart dim;
>   height = ypart dim;
>   if debugLabels: show "PLACE:", w, h, width, height; fi
>   if (width > 0.8w) or (height > 0.8h):
> if (width > height):
>   if debugLabels: show "XSCALING:", (0.8w/width,0.8w/width); fi
>   p:= p xyscaled (0.8w/width,0.8w/width);
> else:
>   if debugLabels: show "YSCALING:", (0.8h/height,0.8h/height); fi
>   p:= p xyscaled (0.8h/height,0.8h/height);
> fi
>   fi
>   p
> enddef;
> 
> It gets called with w=133 and h=53 (I am working in METAPOST native units, so 
> bp)
> 
> So, the textext() command gets something like 106bp x 42bp, which seems to be 
> the case:
> 
> metapost log> >> "NAME makeTeXLabel:"
> metapost log> >> "My 'Application' Function"
> metapost log> >> "106.41"
> cld > tex > w : - : \MPLIBsetNtextX{1}{\startframedtext 
> [middle][align=middle,frame=on,width=106.41bp,height=42.406bp]My
>  'Application' Function\stopframedtext }
> cld > tex > F : - : \startblankhandling
> cld > tex > w : - : \setblankcategory{6}
> cld > tex > F : - : \flushblankhandling
> cld > tex > F : - : \stopblankhandling
> metapost log> >> "42.406"
> metapost log> >> "PLACE:"
> metapost log> >> 133
> metapost log> >> 53
> metapost log> >> 511.0865990822
> metapost log> >> 42.3051402
> 
> But the bounding box is 511bp wide (something like 7in or 18cm, probably 
> textwidth) but I’m asking for a box that is 106bp wide.
> 
> What happens here? And how do I get it right? 
> 
> G
> 
> 
> ___
> 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] Is there a robust way to find the first (or last intersection) of path p with path q?

2020-04-05 Thread Gerben Wierda
Intersecting path p and q will give you more or less randomly (actually, there 
is an algorithm, but not a very useful one for METAPOST) an intersection (time 
on p, time on q)

I am trying to find out if anybody as already created a macro that gives you 
the intersection with the smallest (or largest) time on p. Probably requires 
finding all the intersections and then returning either the point on p with 
minimum (or maximum) t.

Before writing myself, maybe someone already has this, in which case thanks in 
advance.

G
___
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] What was that 'rounding paths' metafun(?) function again?

2020-04-05 Thread Gerben Wierda


> On 5 Apr 2020, at 15:24, Keith McKay  wrote:
> 
> Would sections 1.3, 1.18, 2.5 and 2.6 in the Metafun manual help?

I used what is in 1.3 (though I actually used Peter Grogono’s PDF MetaPost: A 
Reference Manual <https://users.encs.concordia.ca/~grogono/Writings/mpref.pdf> 
which I find the best educational document about plain METAPOST so far).

1.18 was what I was looking for but did not work in my situation (don’t know 
why, but it exploded). I fixed another issue (calling cornering on top of 
cornering when doing recursion) and that made my own macro behave perfectly 
civilised.

I had looked at 2.5 and 2.6 but this was not required (nor of any use).

G

> 
> Keith
> 
> On 05/04/2020 11:31, Gerben Wierda wrote:
>> I think I saw a function in MetaFun somehwre that you could give a ‘hard’ 
>> path, i.e. (0,0) -- (0,1) — (1,1) and it would become a path with nicely 
>> rounded (part of a circle) corners (still straight lines), but I can’t find 
>> it anymore. I wrote my own, but it is giving me headaches so I’d like to 
>> find something that is better than what I produce.
>> 
>> G
>> ___
>> 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
> ___

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


  1   2   3   4   5   >