<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="color: rgb(0, 0, 0); font-family: Arial,Helvetica,sans-serif; font-size: 12pt;">
Sorry Beni you'll get this twice as I forgot to send to the list...</div>
<div style="color: rgb(0, 0, 0); font-family: Arial,Helvetica,sans-serif; font-size: 12pt;">
<br>
</div>
<div id="Signature">
<div>
<div>
<div style="color:rgb(0,0,0); font-family:Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="color:rgb(0,0,0); font-family:Arial,Helvetica,sans-serif; font-size:12pt">
The function def p_continuation (I know not the one you're using).</div>
<div style="color:rgb(0,0,0); font-family:Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="color:rgb(0,0,0); font-family:Arial,Helvetica,sans-serif; font-size:12pt">
has the line:</div>
<div style="color:rgb(0,0,0); font-family:Arial,Helvetica,sans-serif; font-size:12pt">
if known(ATTR__text) and picture(ATTR__text):</div>
<div style="color:rgb(0,0,0); font-family:Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="color:rgb(0,0,0); font-family:Arial,Helvetica,sans-serif; font-size:12pt">
This seems to work, but not sure if it's because of the next few lines:</div>
<div style="color:rgb(0,0,0); font-family:Arial,Helvetica,sans-serif; font-size:12pt">
<span> % set labeling color to light orange<br>
</span>
<div>      push_label_fill_color(0.8, 0.8, 0.0);​</div>
<div>      % draw filled label with text next to symbol ?​</div>
<div>      p_label.urt(ATTR__text,(.5u,-.25u) transformed T,0.0,8);​</div>
<div>      % restore original labeling color​</div>
<div>      pop_label_fill_color;​</div>
<span>      fi;</span></div>
<div style="color:rgb(0,0,0); font-family:Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="color:rgb(0,0,0); font-family:Arial,Helvetica,sans-serif; font-size:12pt">
It seems like the P_label.urt is fairly important, as this is what tells it where to place the label, in this case in the upper right (.urt) and then tells it to put the attr_text there.</div>
<div style="color:rgb(0,0,0); font-family:Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="color:rgb(0,0,0); font-family:Arial,Helvetica,sans-serif; font-size:12pt">
<img width="341.76" height="306.66" tabindex="-1" style="width:341.76px; height:306.66px" size="32823" data-outlook-trace="F:2|T:2" src="cid:4b8816ef-abef-4e06-8047-3dee7b44eed9"><br>
</div>
<div style="color:rgb(0,0,0); font-family:Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div style="color:rgb(0,0,0); font-family:Arial,Helvetica,sans-serif; font-size:12pt">
<a id="LPlnk248043" href="https://books.google.co.uk/books?id=hh6rdgZ9m3MC&pg=PA65&lpg=PA65&dq=p_label.urt&source=bl&ots=1unNIgxr0Q&sig=ACfU3U39-oFLnFB5msQcedNUKtjMkbdY8A&hl=en&sa=X&ved=2ahUKEwig4MyeqfDnAhUyThUIHUSxDSIQ6AEwBHoECAkQAQ#v=onepage&q=p_label.urt&f=false">https://books.google.co.uk/books?id=hh6rdgZ9m3MC&pg=PA65&lpg=PA65&dq=p_label.urt&source=bl&ots=1unNIgxr0Q&sig=ACfU3U39-oFLnFB5msQcedNUKtjMkbdY8A&hl=en&sa=X&ved=2ahUKEwig4MyeqfDnAhUyThUIHUSxDSIQ6AEwBHoECAkQAQ#v=onepage&q=p_label.urt&f=false</a><br>
</div>
<br>
<div style="color:rgb(0,0,0); font-family:Arial,Helvetica,sans-serif; font-size:12pt">
<br>
</div>
<div id="Signature">
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; font-family:Arial,Helvetica,sans-serif" dir="ltr">
<font class="ecxApple-style-span" size="3"><font face="Arial">Regards,</font><font face="Arial"><br>
</font><font face="Arial">Alastair Gott.</font><font face="Arial"><br>
<br>
</font><font face="Arial">AlastairGott@hotmail.com,</font><font face="Arial"><br>
</font><font face="Arial">M: 07931779380.</font></font><br>
</div>
</div>
<div id="appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font color="#000000" face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b> Therion <therion-bounces@speleo.sk> on behalf of Benedikt Hallinger <beni@hallinger.org><br>
<b>Sent:</b> 26 February 2020 22:47<br>
<b>To:</b> therion@speleo.sk <therion@speleo.sk><br>
<b>Subject:</b> Re: [Therion] Need metapost wizard: new text label</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">Hello,<br>
meanwhile i tried to play more with this.<br>
I'm nearly there, however i still have no clue how to read out the text <br>
attribute i attached to the symbol in the th2. "txt := ATTR__text;" <br>
throws metapost out the window.<br>
<br>
The point is defined like this:<br>
   point 234.0909090909091 626.3636363636364 u:mappe -attr text 1234<br>
<br>
<br>
Layout i came up with so far (does not support <br>
scaling/alignment/rotation, but thats fine so far):<br>
<br>
<br>
<br>
---------------------<br>
layout m<br>
<br>
   # Symbol to denote assigned survey.<br>
   # If option -attr text <string> is given, it will be used; otherwise <br>
current survey is shown.<br>
   code metapost<br>
     def p_u_mappe(expr pos, theta, sc, al) =<br>
       T:=identity aligned al rotated theta scaled sc shifted pos;<br>
<br>
       % GET LABEL TEXT:<br>
       string txt;<br>
       txt := "123";<br>
       %txt := ATTR__text;   % does not work. How do i get the value from <br>
' -attr text "345" '?<br>
       if known(ATTR__text):<br>
         txt := ATTR_text;   % NEVER evaluates to TRUE!?!?<br>
       else:<br>
             txt := ATTR__survey;<br>
       fi;<br>
<br>
       % DRAW LABEL:<br>
       lab:=thelabel(txt, pos);<br>
       process_label(pos, 0.001);<br>
<br>
<br>
       % BORDER:<br>
       pickup PenA;                  % border thickness<br>
       interim bboxmargin:=6.5bp;    % padding border->text<br>
       q:=((bbox lab) smoothed 4);   % smoothness of corners<br>
       draw q;<br>
<br>
     enddef;<br>
<br>
     initsymbol("p_u_mappe");<br>
   endcode<br>
endlayout<br>
---------------------<br>
<br>
<br>
Am 2020-02-19 18:34, schrieb Benedikt Hallinger:<br>
> Hi there,<br>
> i need some new point symbol (text label). Its a simple text on white<br>
> color within a box with rounded corners, like the attached image.<br>
> <br>
> <br>
> My metapostskills are not good enough to get this to work...<br>
> <br>
> For now i would be happy to have such a user point symbol.<br>
> It would be important that it scales well and react to xtherions<br>
> direction setting.<br>
> <br>
> Optional it would be cool if the default symbol could show the current<br>
> survey identifier of the nearest station in the scrap and maybe also<br>
> the nearest next survey.<br>
> But this information could also be maintained manually for now.<br>
> <br>
> Is there someone here for my rescue? :)<br>
> Thanks in advance,<br>
> Beni<br>
_______________________________________________<br>
Therion mailing list<br>
Therion@speleo.sk<br>
<a href="https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.speleo.sk%2Flistinfo%2Ftherion&amp;data=02%7C01%7C%7C2bdebe7ad80d4d85719908d7bb0df4e5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637183540918837472&amp;sdata=pcZw3mupgUp94GoqSpUCkEtezYMPaJhzPwEIabpXt%2Fo%3D&amp;reserved=0">https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.speleo.sk%2Flistinfo%2Ftherion&amp;data=02%7C01%7C%7C2bdebe7ad80d4d85719908d7bb0df4e5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637183540918837472&amp;sdata=pcZw3mupgUp94GoqSpUCkEtezYMPaJhzPwEIabpXt%2Fo%3D&amp;reserved=0</a><br>
</div>
</span></font></div>
</div>
</div>
</div>
</body>
</html>