I did some further experimentation, hoping using dimexp calculations would 
help. But either I am doing somthing wrong or I do not understand the innards 
of bodyfont switching well enough.
The example program seems to have accessed a 30 pt font (see the log file) but 
did not typeset in it, the dimexpr does evaluates to 30 pt.
Where am I at fault?

Hans van der Meer

\setuppapersize[A6][A6]
\setupbodyfont[10pt]
\starttext
10pt\ \begingroup\switchtobodyfont[20pt]20pt\endgroup\ 10pt\par
\writestatus{==============}{}
10pt\ \begingroup\switchtobodyfont[\the\dimexpr(3\bodyfontsize)] times 
3\endgroup\ 10pt\par
dimexpr=\the\dimexpr(3\bodyfontsize)\par
\stoptext

fonts           > 'fallback modern rm 10pt' is loaded
fonts           > bodyfont '20pt' is defined (can better be done global)
fonts           > bodyfont '24pt' is defined (can better be done global)
fonts           > bodyfont '16pt' is defined (can better be done global)
==============  >
fonts           > bodyfont '30.0pt' is defined (can better be done global)
fonts           > bodyfont '36pt' is defined (can better be done global)
fonts           > bodyfont '24pt' is defined (can better be done global)
fonts           > bodyfont '30.0pt' is defined (can better be done global)
fonts           > bodyfont '30.0pt' is not defined


On 6 May 2013, at 8:57 PM, "Meer, H. van der" 
<h.vanderm...@uva.nl<mailto:h.vanderm...@uva.nl>> wrote:

This is but a partial solution in my case, for two reasons:
1. \textstyle=\small gives few control, I tried textstyle=5pt without result
2. the setup cannot be placed inside \startuseMPgraphic, where I need it most.

I skimmed through meta-ini.mkiv, but did not find a solution.
It is however quite possible things cannot be done other than by putting a 
fontchange inside each label.

Hans van der Meer



On 6 May 2013, at 6:04 PM, Marco Patzer 
<home...@lavabit.com<mailto:home...@lavabit.com>> wrote:

On 2013–05–06 Meer, H. van der wrote:

What is the simplest way to change the size of fonts in labels drawn in 
MetaPost?

Probably a font switch directly in the label:

label("\small foobar", origin);

\switchtobodyfont[size] can be done in \startMPenvironment and inside each 
label.

Better use setupMPinstance:

\setupMPinstance
  [metafun]
  [textstyle=\small]

Marco
_____________________________________________________________________________

Attachment: dimexpr.pdf
Description: dimexpr.pdf

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to