On Tue, Dec 15, 2009 at 5:21 AM, Carl Magnuson <magnu213 at umn.edu> wrote:
> These are two features that I would like to make use of and may already be
> possible, I just don't know how its done. Â I have played around with custom
> metapost cide for making labels with a transparent background and can either
> make a therion label with a colored background or a label with a transparent
> background but none of the Therion text formatting. Â Has anybody coded a
> transparent label for Therion?
Hi Carl,
if you mean something like on attached picture, I can give you some
hints how to modify the existing code until it would be implemented as
a regular feature:
therion provides a metapost macro def_transparent_rgb to define
transparent colors like
def_transparent_rgb(tr_blue, 0, 0, 1);
you apply it using 'withtransparentcolor <colorname>' operator.
Following code redefines p_continuation to use transparency:
def p_continuation(expr pos,theta,sc,al) =
p_continuation_UIS(pos,theta,sc,al);
if known(ATTR__text) and picture(ATTR__text):
p_label.urt(ATTR__text,(.5u,-.25u) transformed T,0.0,8); % last
argument (8) instructs therion to use filledlabel
fi;
enddef;
def process_filledlabel(expr cent, rot) =
begingroup;
interim bboxmargin:=2.0bp;
q:=((bbox lab) smoothed 2) rotatedaround (cent, rot);
fill q withtransparentcolor tr_blue; % transparency used
draw lab rotatedaround (cent, rot);
write_circ_bbox(q); % without corners smoothing it was enough to use
% write_bbox(q);
endgroup;
enddef;
All text formatting should be available as usual. Which problems did you have?
> My second thought is about hyperlinks from within a label. Â For example one
> may want to label a significant feature and also include a link to a flickr
> photo or online video of the feature. This may already be possible by just
> inserting some Latex code, but I'm not sure what kind of processing Therion
> does on the label text.
Unfortunately it requires changes in the core, but it is so useful
that I will give it high priority.
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transp.png
Type: image/png
Size: 25174 bytes
Desc: not available
URL:
<http://mailman.speleo.sk/pipermail/therion/attachments/20100102/9963866c/attachment.png>