![](https://secure.gravatar.com/avatar/e5aa6984b53b8925e405ebbdbc051ad9.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/e5aa6984b53b8925e405ebbdbc051ad9.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/b9093698dc66621c584549528e50e2d1.jpg?s=120&d=mm&r=g)
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
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
___________________________________________________________________________________
![](https://secure.gravatar.com/avatar/ed6f43113e3f1cee031ebd13654fc703.jpg?s=120&d=mm&r=g)
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 -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/e5aa6984b53b8925e405ebbdbc051ad9.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/b9093698dc66621c584549528e50e2d1.jpg?s=120&d=mm&r=g)
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
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
___________________________________________________________________________________
![](https://secure.gravatar.com/avatar/ed6f43113e3f1cee031ebd13654fc703.jpg?s=120&d=mm&r=g)
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
On 7/6/2022 1:36 PM, Henning Hraban Ramm via ntg-context wrote: 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 -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/cf6e5310df1761759e546bd7a6e037f7.jpg?s=120&d=mm&r=g)
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.
![](https://secure.gravatar.com/avatar/e5aa6984b53b8925e405ebbdbc051ad9.jpg?s=120&d=mm&r=g)
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
participants (5)
-
Aditya Mahajan
-
Fabrice L
-
fv leung
-
Hans Hagen
-
Henning Hraban Ramm