[Therion] Defining a user symbol that contains a short text string

Bruce Mutton bruce at tomo.co.nz
Tue May 29 12:14:55 CEST 2018


Good evening

I'd like to make a user defined symbol that is simply an ascii text string.
A quick and dirty adhoc symbol if you like. If I was going to be fancy, I
would add a box around it like in the example of Dave Clucas that I have
copied and modified below.

 

So rather than defining the shape of the omega symbol using metapost, I'd
like to hard code an ascii character, say "E".

The yellow shaded text below needs to be replaced with some simple metapost,
but I am too lazy to research and trial things.

I notice that other examples tend to use a copy of the p_label definition,
and modify that.  I would rather not head down that route, as then my custom
code would overwrite potential future improvements to Therion's source code.


 

My plan is not really to create an alternative to the entrance symbol, but
rather to create a template quick and dirty creation of single use or
unusual symbols, that can be enumerated in the legend.

 

Does anyone happen to know how to modify the code below to do what I
describe?

 

Thanks

Bruce

 

 
<https://therion.speleo.sk/wiki/_detail/metapost:entrancesymbol.png?id=metap
ost> 

code metapost

def p_u_ent (expr pos,theta,sc,al)=

  U:=(.2u,.5u);

  T:=identity aligned al rotated theta scaled sc shifted pos;

  path p;

  p = (-.3u,-.25u) -- (-.2u,-.25u){dir 135} .. (0u, .25u) .. {dir
225}(.2u,-.25u) -- (.3u,-.25u); % define omega shape

  thdraw p withpen PenA;  % draw it with fat pen

  thdraw unitsquare scaled u shifted (-0.5u,-0.5u) rotated 45 withpen PenD;
% diagonal box with thin pen

enddef;

 

initsymbol("p_u_ent")
  
def p_u_ent_legend =
         p_u_ent( <I forget where to find code for point drawing in the
legend> )
enddef;
endcode
text en "point u:ent" "E for entrance" #text to appear in legend
 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20180529/7d16045b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 8640 bytes
Desc: not available
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20180529/7d16045b/attachment.png>


More information about the Therion mailing list