[dev-context] ugly bug in sometxt
Mojca Miklavec
mojca.miklavec.lists at gmail.com
Fri Dec 1 18:50:57 CET 2006
Hello Hans,
I don't understand how I managed not to spot this before since I use
it frequently, but \sometxt seems to scale the labels according to the
last defined label. In other words, if one defines one \sometxt{short}
in the first graphic and one \sometxt{\dorecurse{10}{very }long} then
the first text will be scaled to the length of the second one.
Mojca
\setupcolors[state=start]
\setuptyping[file][option=TEX]
% In my opinion this should be the default
\chardef\TeXtextcolormode\zerocount
\def\getexample{\placefigure[force]{none}{\getbuffer}}
\startbuffer
\startMPcode
draw fullcircle xyscaled (3cm,2cm);
label(\sometxt{Hello world!}, origin);
\stopMPcode
\stopbuffer
\typebuffer
\getexample
\startbuffer
\startTeXtexts
\TeXtext{1}{Hello}
\TeXtext{2}{world!}
\stopTeXtexts
\startMPcode
draw sometxt(1) withcolor red;
draw sometxt(2) shifted (2cm,0) withcolor blue;
\stopMPcode
\stopbuffer
\typebuffer
\getexample
\startbuffer
\def\ForThoseWhoReallyHateLongCommands#1%
{\framed[framecolor=blue]{\strut\bs #1}}
\definetextext[xs]{\ForThoseWhoReallyHateLongCommands}
\startMPcode
picture p; p = \sometxt[xs]{Framed title with eXtra Small overhelm};
fill bbox p withcolor .7white;
draw p;
\stopMPcode
\stopbuffer
\typebuffer
% try to uncomment this one
\getexample
\stoptext
More information about the dev-context
mailing list