[Therion] Scaling text and text orientation

Bruce Mutton bruce.mutton at paradise.net.nz
Sun Nov 18 09:50:54 CET 2007


Thanks Stacho, 

-align fixes the declination induced problem perfectly, but it doesn't shift
the text off to the side of the passage, it just aligns it from the point
where it is inserted, which I am sure is what it's intended function is.
Doing it this way means you have to be aware of the scale of the finished
product at the time of drawing.  Plot at much smaller scale, and the text
will be far from the drawn feature, plot at a much larger scale and the text
will tend to overwrite the cave map.  Using -align I can almost get my
desired effect by placing the text insertion points on the passage walls
near the feature in the cave to be labelled.  A good enough solution if
there is no specific feature for this.

Haven't tried the 'magic' code yet, but I'm sure it will come in handy. I
notice the -context option (Pg 21 Therion Book) would complement it.
Bruce

-----Original Message-----
From: therion-bounces at speleo.sk [mailto:therion-bounces at speleo.sk] On Behalf
Of Stacho Mudrak
Sent: Friday, 16 November 2007 11:14 p.m.
To: therion at speleo.sk
Subject: Re: [Therion] Scaling text and text orientation

Quoting Bruce Mutton <bruce.mutton at paradise.net.nz>:

> Is there a way to place a text label, say ON a pitch line, and tell
therion,
> label this pitch "10 P" and left justify the text it out to the right-hand
> side, just beyond the displayed passage wall, so that it always displays
> just clear of the drawing?

If you are using line label - there is no possibility, but if you are using
point label - you can use -align option as for any other point object. E.g.
you
may also place "stalactites" aligned left to passage wall.

> Also I notice that text with orientation 0 degrees prints at an angle
equal
> to the declination, which is 22 degrees here abouts these days.  Is there
a
> better way to straighten the text than give it all an orientation of 338
> degrees to compensate?

Again - please use rather -align then orientation option. E.g.:

point 0 0 label -text "label above some feature" -align top

If map will be rotated due to orientation, this alignment should be
automatically rotated also.

> If I want to present two maps, say one at 1:500 scale, and one at 1:2000
> scale, I would want many labels on the former and few labels on the
latter.
> Can this be done with one set of scraps, or would I have to create
> duplicates and adjust the labels in one of the sets?

Currently, there is no straight way how to hadle this situation, but there
exists workaround using generic attributes and a little bit of magic
metapost
code copied from "mpost/thText.mp" file and modified a little bit.

1. Make sure to add some label importance flag to all labels. E.g.

point 0 0 label -text "Important label" -attr importance 1
point 123 456 label -text "Unimportant label"

2. Then use following magic :) code in 1:2000 layout:

code metapost
vardef p_label@#(expr txt,pos,rot,mode) =
  if ATTR_importance = 1:
  if (mode=1) or (mode=7): interim labeloffset:=(u/8) fi;
  lab:=thelabel@#(txt, pos);
  if mode>1: pickup PenD fi;
  if mode=1:
    pickup pencircle scaled (u/6);
    drawdot(pos);
    process_label(pos,0);
  elseif mode=2: process_uplabel;
  elseif mode=3: process_downlabel;
  elseif mode=4: process_updownlabel;
  elseif mode=5: process_circledlabel;
  elseif mode=6: process_boxedlabel;
  elseif mode=7: process_label(pos,rot);  % station name
  elseif mode=8: process_filledlabel(pos, rot);
  else: process_label(pos,rot); fi;
  fi;
enddef;
endcode

I hope this will help you.

Regards, S.
_______________________________________________
Therion mailing list
Therion at speleo.sk
http://www.speleo.sk/mailman/listinfo/therion




More information about the Therion mailing list