[Therion] ***UNCHECKED*** Custom label style for a custom point
Tarquin Wilton-Jones
tarquin.wilton-jones at ntlworld.com
Tue Nov 26 19:14:09 CET 2019
Hi all,
Next puzzle...
I am trying to define a custom point type:
p_u_ropelength
This will allow me to specify rope lengths on a rigging topo. What I
want is exactly what Therion does for a p_passageheight - a circle
around a label, which has been the norm in UK topos for decades (though
they are also sometimes written as a basic label with no circle). This
should be easy, but Therion seems to hide the p_passageheight code, or
at least put it somewhere I can't find it in order to work out how it works.
I am guessing it calls p_label with txt set to the text, pos set to the
point position, and mode set to 5 (p_label_mode_passageheight). But
somehow it is also specifying the scale and I can't see how it does that
since it ignores my attempts, and it also seems to work with Align
there, while with my own code, it applies align with the most tiny
fractional changes, instead of moving the label as far as I would have
expected.
Obviously I am doing something wrong.
def p_u_ropelength (expr P,R,S,A)=
T:=identity aligned A rotated R scaled S shifted P;
if known ATTR_text:
p_label(ATTR_text,P,R,5);
fi;
enddef;
Does anyone have a nice working example where A and S are correctly
respected, so that I can see how to apply them when calling p_label? Do
I have to manually parse A and call the correct p_label.lft(...) to get
the right alignment, or is there a way to ask it to do that?
Incidentally, you can set orientation on a p_label, but not on a
p_passageheight - the orientation is ignored. Seems like a bug...
More information about the Therion
mailing list