Re: [NTG-context] MetaPost label font size

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

Am 06.07.22 um 15:24 schrieb Fabrice L:

Here are slightly different syntax that could be useful perhaps ? In the second 
one, the scaled parameter can be replaced easily with a variable, so you can 
decide and change the size of the label during the course of a picture.


Thank you (all), I resolved to using the usual \tfx or \definedfont.

Hraban

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost label font size

2022-07-06 Thread Fabrice L via ntg-context


> Le 5 juill. 2022 à 19:00, Henning Hraban Ramm via ntg-context 
>  a écrit :
> 
> How can I change the font size of labels within one picture?
> 
> Hraban
> 
> \startMPpage
> defaultfont := "\truefontname{Sans}";
> defaultfontsize := \the\bodyfontsize;
> 
> label.top(defaultfontsize, (0,0));
> 
> defaultfontsize := 4bp;
> 
> label.top(defaultfontsize, (50,0));
> % shows that the variable changed,
> % but font size is the same
> 
> \stopMPpage

Here are slightly different syntax that could be useful perhaps ? In the second 
one, the scaled parameter can be replaced easily with a variable, so you can 
decide and change the size of the label during the course of a picture.

\starttext

\startMPpage
defaultfont := "\truefontname{Sans}";
defaultfontsize := \the\bodyfontsize;

defaultscale := 0.5;
label.top("small label", (-10,0));

defaultscale := 1.0;
label.top("normal label", (50,5));
label.top("another normal label", (50,-5));

defaultscale := 2.0;
label.top("Huge label", (10,-25));

\stopMPpage

\startMPpage

 draw textext.top("small label") scaled 0.5 
shifted (-10,0) ;
 draw textext.top("normal label") scaled 1 
shifted (50,5) ;
 draw textext.top("second normal label") scaled 1 
shifted (50,-5) ;
 draw textext.top("Huge label") scaled 2 
shifted (10,-25) ;

\stopMPpage

\stoptext

Fabrice.


___
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 label font size

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

On 7/6/2022 1:36 PM, Henning Hraban Ramm via ntg-context wrote:

Am 06.07.22 um 12:45 schrieb Hans Hagen via ntg-context:

On 7/6/2022 12:19 PM, fv leung via ntg-context wrote:

My stupid way to get labels of different sizes:

\starttext

\startMPcode

   label("normal label", (0, 0));

   label("\setsmallbodyfont small label", (0, 18));

   label("\setbigbodyfont big label", (0, -18));

\stopMPcode

\stoptext

nothing stupid about that ... it's how i would do it


Okay. So there’s really no possibility to adapt whatever defines the 
label font size except defaultfontsize inbetween? Strange.


My solution so far was to split the picture and re-combine it afterwards.
well, if there would be another way you would find it strange there if 
that would interfere with whatever else goes into a label text because 
we support arbitrary tex ... no way to figure out what struts, line 
distances, spacing, either of not adapt to current situation, delayed vs 
immediate inclusion, etc ... you can't have both worlds


if course you can make some macro (or define a highlight) and use that 
in the labels


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost label font size

2022-07-06 Thread fv leung via ntg-context
I've used something like the following before.


\starttext

\startMPcode

  label("normal label", (0, 0));

  label("{\switchtobodyfont[3pt] tiny label}", (0, 18));

  label("{\switchtobodyfont[72pt] giant label}", (0, -72));

\stopMPcode

\stoptext

Henning Hraban Ramm via ntg-context  於 2022年7月6日 週三
晚上7:36寫道:

> Am 06.07.22 um 12:45 schrieb Hans Hagen via ntg-context:
> > On 7/6/2022 12:19 PM, fv leung via ntg-context wrote:
> >> My stupid way to get labels of different sizes:
> >>
> >> \starttext
> >>
> >> \startMPcode
> >>
> >>label("normal label", (0, 0));
> >>
> >>label("\setsmallbodyfont small label", (0, 18));
> >>
> >>label("\setbigbodyfont big label", (0, -18));
> >>
> >> \stopMPcode
> >>
> >> \stoptext
> > nothing stupid about that ... it's how i would do it
>
> Okay. So there’s really no possibility to adapt whatever defines the
> label font size except defaultfontsize inbetween? Strange.
>
> My solution so far was to split the picture and re-combine it afterwards.
>
> 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] MetaPost label font size

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

Am 06.07.22 um 12:45 schrieb Hans Hagen via ntg-context:

On 7/6/2022 12:19 PM, fv leung via ntg-context wrote:

My stupid way to get labels of different sizes:

\starttext

\startMPcode

   label("normal label", (0, 0));

   label("\setsmallbodyfont small label", (0, 18));

   label("\setbigbodyfont big label", (0, -18));

\stopMPcode

\stoptext

nothing stupid about that ... it's how i would do it


Okay. So there’s really no possibility to adapt whatever defines the 
label font size except defaultfontsize inbetween? Strange.


My solution so far was to split the picture and re-combine it afterwards.

Hraban

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost label font size

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

On 7/6/2022 12:19 PM, fv leung via ntg-context wrote:

My stupid way to get labels of different sizes:

\starttext

\startMPcode

   label("normal label", (0, 0));

   label("\setsmallbodyfont small label", (0, 18));

   label("\setbigbodyfont big label", (0, -18));

\stopMPcode

\stoptext

nothing stupid about that ... it's how i would do it

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost label font size

2022-07-06 Thread fv leung via ntg-context
My stupid way to get labels of different sizes:

\starttext

\startMPcode

  label("normal label", (0, 0));

  label("\setsmallbodyfont small label", (0, 18));

  label("\setbigbodyfont big label", (0, -18));

\stopMPcode

\stoptext

Henning Hraban Ramm via ntg-context  於 2022年7月6日 週三
下午5:23寫道:

> Am 06.07.22 um 07:17 schrieb Aditya Mahajan via ntg-context:
> > On Wed, 6 Jul 2022, Henning Hraban Ramm via ntg-context wrote:
> >
> >> How can I change the font size of labels within one picture?
> >
> > (Untested): See https://www.contextgarden.net/Command/setupMPinstance
> >
> > \setupMPinstance[metafun][textstyle=sans]
> >
> > Or define a new instance, which sets the textstyle to sans.
>
> Thank you for trying, but that doesn’t seem to have anything to do with
> my question.
>
> I need a different font size for different labels within one picture.
>
> 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] MetaPost label font size

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

Am 06.07.22 um 07:17 schrieb Aditya Mahajan via ntg-context:

On Wed, 6 Jul 2022, Henning Hraban Ramm via ntg-context wrote:


How can I change the font size of labels within one picture?


(Untested): See https://www.contextgarden.net/Command/setupMPinstance

\setupMPinstance[metafun][textstyle=sans]

Or define a new instance, which sets the textstyle to sans.


Thank you for trying, but that doesn’t seem to have anything to do with 
my question.


I need a different font size for different labels within one picture.

Hraban

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] MetaPost label font size

2022-07-05 Thread Aditya Mahajan via ntg-context
On Wed, 6 Jul 2022, Henning Hraban Ramm via ntg-context wrote:

> How can I change the font size of labels within one picture?

(Untested): See https://www.contextgarden.net/Command/setupMPinstance

\setupMPinstance[metafun][textstyle=sans]

Or define a new instance, which sets the textstyle to sans.

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] MetaPost label font size

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

How can I change the font size of labels within one picture?

Hraban

\startMPpage
defaultfont := "\truefontname{Sans}";
defaultfontsize := \the\bodyfontsize;

label.top(defaultfontsize, (0,0));

defaultfontsize := 4bp;

label.top(defaultfontsize, (50,0));
% shows that the variable changed,
% but font size is the same

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