[NTG-context] adapt fontsize to given width

Alan BRASLAU alan.braslau at cea.fr
Wed Jan 14 19:05:05 CET 2015


On Wed, 14 Jan 2015 17:50:12 +0100
Pablo Rodriguez <oinos at gmx.es> wrote:

> Dear list,
> 
> I have the following sample:
> 
>     \showframe
>     \starttext
>     {\setupbodyfont[120pt]My Title}
>     \stoptext
> 
> Is there a way to make ConTeXt automatically calculate the size of the
> \setupbodyfont, so that the passage fits exactly to text width?
> 
> Many thanks for your help,
> 
> 
> Pablo

There is a MP solution:

\starttext
\startMPcode
   draw textext("My Title") xsized TextWidth ;
\stopMPcode
\stoptext

Alan


More information about the ntg-context mailing list