Hi Bruce,
You beat me to it! I've spent the last few days
learning metapost and rummaging around the bowels of the Therion's source
code and have more or less got to what you have summarised below. I
also spotted the smartlabel, though haven't yet tried it in the
re-definition of p_continuation.
I surmise that stations with fixed co-ordinates are
not exported by Therion in any detectable way; while the th2 mark
"fixed" is exported as "mark", and the th2 flags are exported as
"flags". The items that are exported are accessible in
metapost. In the debug output data.mp file, I saw that
"attr code" is exported by Therion as ATTR_code, where "code" is whatever
attr has been declated in the th2 file. Note that it only has one "_"
whereas ATTR__text has two "_". So one thing I
tried that did work is to print the value of my user define attr statements
instead of the text, which is potentially quite useful, as I can display a
short code, and use continuation.html for the longer description.
However, this still relies on having the "continuation" flag set.
I used the following re-definition of
p_continuation using ATTR_code instead of the example's ATTR__text,
as follows
**THE FOLLOWING WORKS**
code metapost
def
p_continuation(expr pos,theta,sc,al) =
% draw default
continuation
symbol
p_continuation_UIS(pos,theta,sc,al);
% if attr code is
set
if known(ATTR_code):
% set labeling color to light
orange
push_label_fill_color(1.0, 0.9,
0.8);
% draw filled
label with text next to
?
p_label.urt(ATTR_code,(.5u,-.25u) transformed
T,0.0,8);
% restore
original labeling
color
pop_label_fill_color;
fi;
enddef;
endcode
Looking at p_station_SKBB, the problem you and I are
facing is that it's only for the "continuation" flags that ATTR__text has
been set. It occurred to me that if it was possible to
refedine p_station_SKBB in the thconfig file, then it would be possible to
output ATTR__text if an "attr code" has been declared in the th2 file.
For example, th2 file:-
station 1 "Some text to output" entrance attr print
"true"
My example p_station_SKBB is below.
Unfortunately, I've so far not managed to see it
being executed. I can see it appear in the data.mp debug file, but the
changes I've made to it don't appear to work - the text is not yet being
output to my pdf file. Also, I don't understand yet the purpose of the
metapost "save" command, and the manual doesn't really shed much light on
it! So it's possible that I've just not yet properly understood
metapost syntax.