Re: [NTG-context] Font for MetaPost graphics

2012-05-10 Thread Procházka Lukáš Ing . - Pontex s . r . o .
Hello, many thanks Marco for wikifying. On Tue, 08 May 2012 21:57:04 +0200, Marco net...@lavabit.com wrote: Thanks a lot Hans for implementing this. Wikified: http://wiki.contextgarden.net/Command/defineMPinstance http://wiki.contextgarden.net/Command/setupMPinstance Best wishes Marco

Re: [NTG-context] Font for MetaPost graphics

2012-05-10 Thread Marco
On 2012-05-10 Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz wrote: With the permission, I tried to replace the tag texcode with context to get source and result. context mode=mkiv source=yes text=Gives: ... /context Unfortunately, the result doesn't appear. The code is MkIV

Re: [NTG-context] Font for MetaPost graphics

2012-05-08 Thread Marco
On 2012-05-05 Hans Hagen pra...@wxs.nl wrote: This code fails: \defineMPinstance [mympinstance] [metafun] [textcolor=red] \starttext \startMPcode draw textext(some text) ; \stopMPcode \startMPcode{mympinstance} draw textext(some text) ; \stopMPcode \stoptext Marco

Re: [NTG-context] Font for MetaPost graphics

2012-05-08 Thread Hans Hagen
On 8-5-2012 19:01, Marco wrote: On 2012-05-05 Hans Hagenpra...@wxs.nl wrote: Did I? This code fails: \defineMPinstance [mympinstance] [metafun] [textcolor=red] \starttext \startMPcode draw textext(some text) ; \stopMPcode \startMPcode{mympinstance} draw textext(some

Re: [NTG-context] Font for MetaPost graphics

2012-05-08 Thread Marco
On 2012-05-08 Hans Hagen pra...@wxs.nl wrote: On 8-5-2012 19:01, Marco wrote: On 2012-05-05 Hans Hagenpra...@wxs.nl wrote: Did I? My bad ;) This code fails: \defineMPinstance [mympinstance] [metafun] [textcolor=red] \starttext \startMPcode draw textext(some text) ;

Re: [NTG-context] Font for MetaPost graphics

2012-05-08 Thread Hans Hagen
On 8-5-2012 19:19, Marco wrote: On 2012-05-08 Hans Hagenpra...@wxs.nl wrote: On 8-5-2012 19:01, Marco wrote: On 2012-05-05 Hans Hagenpra...@wxs.nl wrote: Did I? My bad ;) This code fails: \defineMPinstance [mympinstance] [metafun] [textcolor=red] \starttext \startMPcode

Re: [NTG-context] Font for MetaPost graphics

2012-05-08 Thread Marco
On 2012-05-08 Hans Hagen pra...@wxs.nl wrote: ok, can you add this to cont-new.mkiv (after \unprotect): \def\m_meta_colo_initializations{% vardef OverlayLineColor=\MPcolor{\overlaylinecolor} enddef; vardef OverlayColor=\MPcolor{\overlaycolor} enddef; } That works. As I've used

Re: [NTG-context] Font for MetaPost graphics

2012-05-05 Thread Hans Hagen
On 4-5-2012 13:09, Marco wrote: On 2012-05-04 Aditya Mahajanadit...@umich.edu wrote: On Fri, 4 May 2012, Mojca Miklavec wrote: But my guess is that the argument goes into the opposite way. I past (and still in MKII) one *had to* set up fonts twice - once for the main document and once

Re: [NTG-context] Font for MetaPost graphics

2012-05-05 Thread Hans Hagen
On 4-5-2012 09:13, Aditya Mahajan wrote: On Fri, 4 May 2012, Mojca Miklavec wrote: I can think of many workarounds to this, but I agree that there is a valid reason why \startMPenvironment (or some other command) should be able to change the font inside metapost labels only. A better

Re: [NTG-context] Font for MetaPost graphics

2012-05-05 Thread Marco
On 2012-05-05 Hans Hagen pra...@wxs.nl wrote: That means, MPenvironment will be dropped, right? But what is the new interface, \setupMPtext or MPinstance? +1 Marco So .. we know who is going to wikify this ... You're welcome :) Marco

Re: [NTG-context] Font for MetaPost graphics

2012-05-05 Thread Aditya Mahajan
On Sat, 5 May 2012, Marco wrote: On 2012-05-05 Hans Hagen pra...@wxs.nl wrote: That means, MPenvironment will be dropped, right? But what is the new interface, \setupMPtext or MPinstance? \setupMPinstance The advantage is that you can have multiple instances in parallel. Aditya

Re: [NTG-context] Font for MetaPost graphics

2012-05-04 Thread Mojca Miklavec
On Thu, May 3, 2012 at 3:13 AM, Marco wrote: The text in Metapost adapts to the text set in ConTeXt. But the font setup should *only* be set for MetaPost, not regular text. Does that mean, that MPenvironment is deprecated and does not work at all? Please don't rely on my answer since I

Re: [NTG-context] Font for MetaPost graphics

2012-05-04 Thread Aditya Mahajan
On Fri, 4 May 2012, Mojca Miklavec wrote: I can think of many workarounds to this, but I agree that there is a valid reason why \startMPenvironment (or some other command) should be able to change the font inside metapost labels only. A better alternative would to define \setupMPtext [

Re: [NTG-context] Font for MetaPost graphics

2012-05-04 Thread Marco
On 2012-05-04 Aditya Mahajan adit...@umich.edu wrote: On Fri, 4 May 2012, Mojca Miklavec wrote: But my guess is that the argument goes into the opposite way. I past (and still in MKII) one *had to* set up fonts twice - once for the main document and once for MetaPost since MetaPost

[NTG-context] Font for MetaPost graphics

2012-05-02 Thread Marco
The wiki claims setting up an MPenvironment is enough to change the font in MetaPost graphics: \startMPenvironment%[global] \switchtobodyfont [sans] \stopMPenvironment \starttext This should be serif. \startMPcode draw textext(This should be in sans.);

Re: [NTG-context] Font for MetaPost graphics

2012-05-02 Thread Aditya Mahajan
On Thu, 3 May 2012, Marco wrote: The wiki claims setting up an MPenvironment is enough to change the font in MetaPost graphics: \startMPenvironment%[global] \switchtobodyfont [sans] \stopMPenvironment \starttext This should be serif. \startMPcode draw

Re: [NTG-context] Font for MetaPost graphics

2012-05-02 Thread Marco
On 2012-05-02 Aditya Mahajan adit...@umich.edu wrote: Metapost now runs as a library. All the text is first typeset by ConTeXt and metapost only knows the bounding box of the labels. You can try (untested): \starttext This is serif \switchtobodyfont[sans] \startMPcode draw