[Therion] Hiding small objects at large scales

Thomas Holder thomas at thomas-holder.de
Sat Feb 6 00:13:09 CET 2010


Hi Bruce,

> Thomas Holders scalebar1 is also very nice, although I can only get it to
> work at 1:1000.  Get error cp-02 for larger and smaller scales....

that's strange, it should work at any scale. What is error cp-02 ?

> Still haven't cracked the syntax for label size.
> Are you going to make me lookup the metapost references :)
> 
>> if and(size <> xs, size <> s)
>> [standard label metapost code]
>> fi;

the label size is not passed to metapost but is controlled with tex 
macros like \thlargesize. You might achieve what you want like this:

   code metapost

     % set xs and s to 1pt
     verbatimtex
       \def\thsmallsize{\size[1]}
       \def\thtinysize{\size[1]}
     etex

     % label with minimum text height condition
     vardef p_label@#(expr txt,pos,rot,mode) =
       if abs(llcorner txt - ulcorner txt) > 5pt:
         p_label_orig@#(txt,pos,rot,mode)
       fi;
     enddef;

     % original therion label definition
     vardef p_label_orig@#(expr txt,pos,rot,mode) =
       if (mode=1) or (mode=7): interim labeloffset:=(u/8) fi;
       lab:=thelabel@#(txt, pos);
       if mode>1: pickup PenD fi;
       if mode=1:
         pickup pencircle scaled (u/6);
         drawdot(pos);
         process_label(pos,0);
       elseif mode=2: process_uplabel;
       elseif mode=3: process_downlabel;
       elseif mode=4: process_updownlabel;
       elseif mode=5: process_circledlabel;
       elseif mode=6: process_boxedlabel;
       elseif mode=7: process_label(pos,rot);  % station name
       elseif mode=8: process_filledlabel(pos, rot);
       else: process_label(pos,rot); fi;
     enddef;

   endcode

It's not very nice and may fail for multiline labels.

Cheers,
   Thomas



More information about the Therion mailing list