[NTG-context] AutoScale and AutoSize

luigi.scarso luigi.scarso at logosrl.it
Fri Apr 15 11:43:30 CEST 2005


% AutoSize seem better, but
% I must setup ss and tfb inside body
% (I need these) so it's no a general macros
% Same problems of previous version.
%
\def\AutoSize#1#2#3{% #1=string #2=horiz.limit #3=startfont
\newdimen\Limit \Limit=#2 %
\newdimen\FontSize \FontSize=#3 %
\doloop{%
\setbox800=\hbox{\switchtobodyfont[ss,\the\FontSize]\tfb #1}%
\ifdim\wd800 <\Limit\exitloop%
\else%
\ifdim\FontSize <1bp\exitloop%
\else %
\advance\FontSize by -0.5bp%
\fi%
\fi}%
\box800\relax%
}


More information about the ntg-context mailing list