[NTG-context] Is it possible to automatically determine font size to fit text to a given space?

Hans Hagen pragma at wxs.nl
Fri Dec 2 15:02:54 CET 2005


Daniel Pittman wrote:

>Hints about that, or a native TeX method[1], would be very much
>appreciated.  At the moment it is a relatively slow process of manual
>trial and error.
>  
>
this is something tex is pretty good at and it runs as fast as normal

how does your current code look? (the solution depends a bit it); think 
of something

\doloop{
  \setbox\scratchbox=\vbox
     {the content of the label}
   \ifx\ht\scratchbox>10cm
       \switchtobodyfont[small] 
   \else
       \unvbox\scratchbox
       \exitloop
   \fi
}

Hans


More information about the ntg-context mailing list