[NTG-context] adapt fontsize to given width

Hans Hagen pragma at wxs.nl
Wed Jan 14 22:00:01 CET 2015


On 1/14/2015 7:05 PM, Alan BRASLAU wrote:
> 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

\scale[width=\textwidth]{My Title}


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list