[Therion] Hiding small objects at large scales
Thomas Holder
thomas at thomas-holder.de
Sun Feb 7 23:47:33 CET 2010
Hi Bruce,
> % 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;
>
> Thomas
> The above does not seem to work. It seems likely to me that the third to
> last line is missing a ; although adding it does not seem to help that much.
no, the semicolon is not necessary here.
> The definition p_label_orig does not seem familiar to me. The data.mp file
> produced by Therion does not contain one of that name, only a p_label.
> In the above code I changed p_label_orig to p_label (assuming recursive
> definitions might be OK), but I get an error,
>>> p_label_orig.lft
> ! Isolated expression.
recursion on the original p_label definition is not possible, it just
gets overwritten. So you need to carry the complete label code when
overwriting it, what I did with introducing p_label_orig (you could put
it all in the p_label definition, but I tried to separate new code from
existing one for clarity).
> culminating in "can't open file" and no pdf output.
uhm, now it gets crude. I haven't looked in detail into the code, but a
quick inspection led me to this hack:
vardef p_label@#(expr txt,pos,rot,mode) =
if abs(llcorner txt - ulcorner txt) > 5pt:
p_label_orig@#(txt,pos,rot,mode)
else:
last_write := charcode
fi;
enddef;
Has to do with the temporary file written by write_circ_bbox, which
might not be created if the label gets skipped.
> The differences between what you posted and what I have been using are...
>
> code metapost
> fonts_setup(6,8,10,12,16)
>
> instead of...
> % set xs and s to 1pt
> verbatimtex
> \def\thsmallsize{\size[1]}
> \def\thtinysize{\size[1]}
> etex
looks good, I just forgot that there was a fonts_setup method ;-)
> I did not define my own p_label_orig (because I assumed the default must
> already be defined somewhere). If I do define as per your entire example I
> get different, and perhaps less serious errors, "can't open file" and still
> no output...
see above. In any case you need the p_label_orig.
Cheers,
Thomas
More information about the Therion
mailing list