[Therion] symbol-show fixed points / point text
Ben Cooper
ben at caver.plus.com
Fri Dec 2 21:27:47 CET 2011
Of course you can define as many attr xyz as you need, and create different
layout definitions to select them at will.
- Ben
_____
From: therion-bounces at speleo.sk [mailto:therion-bounces at speleo.sk] On Behalf
Of Bruce
Sent: 02 December 2011 09:43
To: 'List for Therion users'
Subject: Re: [Therion] symbol-show fixed points / point text
That looks good Ben
Seems like 'we' have full control now.
Although ultimately it would be good to move away from having to modify each
station with text in the th2 files each time we wanted to toggle the output
of text for individual point types (mark or flag), and move towards putting
this type of control back into the layout files.
A symbol-show, symbol-hide that pertained to the text comment for stations
with specific mark and flag combinations would perhaps be ideal.
So we could have control of printing each of the three components of station
individually (mark, flag symbol, text) dependant on the mark and flag status
of each point.
Of course having a fourth controlling factor or override, ATTR_print, as you
have come up with is useful as well.
Bruce
_____
From: therion-bounces at speleo.sk [mailto:therion-bounces at speleo.sk] On Behalf
Of Ben Cooper
Sent: Friday, 2 December 2011 9:59 a.m.
To: 'List for Therion users'
Subject: Re: [Therion] symbol-show fixed points / point text
Hi Bruce,
Here is my re-defined p_station code that now works. For each station that
you want to print the text for, set attr print "true" in the th2 file as I
illustrated in my earlier email. If you want to turn off printing you can
set the text to "false". This works for any station, no matter what its
subtype or flags that are set. The code is as follows:
layout l_p_station_text
code metapost
def p_station(expr pos,mark,txt)(text flags) =
% draw default station
p_station_SKBB(pos, mark, txt, flags);
% now print the text
if picture(txt):
picture ATTR__text;
ATTR__text := txt;
if known(ATTR_print):
if (ATTR_print="true"):
if not numeric txt:
p_smartlabel(txt,pos);
else:
% draw filled label with text next
p_label.urt(ATTR__text,(.5u,-.25u) transformed T,0.0,8);
fi;
fi;
fi;
save ATTR__text;
fi;
enddef;
endcode
endlayout
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20111202/c81191b0/attachment.htm>
More information about the Therion
mailing list