Meer, Hans van der mailto:H.vanderMeer@uva.nl 14. Mai 2016 um 21:13 I think I did not state the problem clear enough. The solution given here supposes that the fontsize is known beforehand. However, what I am doing is calculating a font size based on the current one and than switch to that size. It is part of a fontsize changing mechanism inside an xmlsetup. In short what I am doing is:
\scratchdimen=\the\dimexpr\bodyfontsize\relax \advance\scratchdimen 'somevalue' \relax %\definebodyfontenvironment[\the\scratchdimen] \begingroup % must keep the change local \switchtobodyfont[\the\scratchdimen] ... \endgroup
The commented out \definebodyfontenvironment kills a lot of the font messages but I fear that each the time the same work is done as without it. The only benefit being the suppression of the font messages in the log ;-)
It might be impossible to accomplish this efficiently -- that is execute the font calculations once only for the given size. But at least I would like to give it a try.
You can save time with the \definebodyfontenvironment command. In the following example context has to create a new bodyfont environment for each iteration (because the values are local to the group) to calculate the a, b, c etc. sizes which takes time but in the same loop context only has to load the predefined size. \starttext \testfeatureonce{1000} {\begingroup \switchtobodyfont[18pt] \endgroup} \definebodyfontenvironment[18pt] \testfeatureonce{1000} {\begingroup \switchtobodyfont[18pt] \endgroup} \stoptext Wolfgang