Scaling text and text orientation
As with most drawing packages, it seems that one needs to have the final presentation scale in mind when placing text labels within scraps. Change the output scale up or down, and the labels either move very far away from the drawing, or overlap and over power the drawing. This is a shame because most of the other features are fairly scale independent. I can use the scale and basescale commands, and <left> and <br> etc to counteract this to some extent. 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? 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? 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? Again, thank you for your patience Bruce
Quoting Bruce Mutton <bruce.mutton@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.
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@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Stacho Mudrak Sent: Friday, 16 November 2007 11:14 p.m. To: therion@speleo.sk Subject: Re: [Therion] Scaling text and text orientation Quoting Bruce Mutton <bruce.mutton@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@speleo.sk http://www.speleo.sk/mailman/listinfo/therion
Quoting Bruce Mutton <bruce.mutton@paradise.net.nz>:
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.
Well, as far as I understand - you would like to have another option in addition to -align. Let's call it -offset and it would mean, how far from the desired feature the label should be. And this offset would be scale independent. Is it really like that? Regards, S.
Yes, more or less like that, except perhaps a bit trickier, in that the 'text' should detect how far offset it needs to be to just clear the meanderings of any nearby cave walls or other lines. It could be very problematic with convoluted drawings I concede. I would say that at this stage this should be quite a low priority. Thanks Bruce -----Original Message----- From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Stacho Mudrak Sent: Monday, 19 November 2007 9:49 p.m. To: therion@speleo.sk Subject: Re: [Therion] Scaling text and text orientation Quoting Bruce Mutton <bruce.mutton@paradise.net.nz>:
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.
Well, as far as I understand - you would like to have another option in addition to -align. Let's call it -offset and it would mean, how far from the desired feature the label should be. And this offset would be scale independent. Is it really like that? Regards, S. _______________________________________________ Therion mailing list Therion@speleo.sk http://www.speleo.sk/mailman/listinfo/therion
Second thoughts Stacho, Perhaps -offset exactly as you describe in real world, unscaled millimetres would be useful, especially with the additional option of a leader line pointing to the text insertion point. Regards Bruce -----Original Message----- From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Stacho Mudrak Sent: Monday, 19 November 2007 9:49 p.m. To: therion@speleo.sk Subject: Re: [Therion] Scaling text and text orientation Quoting Bruce Mutton <bruce.mutton@paradise.net.nz>:
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.
Well, as far as I understand - you would like to have another option in addition to -align. Let's call it -offset and it would mean, how far from the desired feature the label should be. And this offset would be scale independent. Is it really like that? Regards, S. _______________________________________________ Therion mailing list Therion@speleo.sk http://www.speleo.sk/mailman/listinfo/therion
The problem is that as the text size scales, it overlays cave passage. So a scrap has to be drawn with the scale in mind. In that case, the offset needs to scale with the text size. A simple solution would be for the text of a point label to be left or right justified, so it can be positioned close to the relevant feature, and the text will then scale harmlessly to the right or left. This doesn't solve the problem of the text overlaying other adjacent scraps or cave passages, of course. - Ben
-----Original Message----- From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Bruce Mutton Sent: 19 November 2007 17:55 To: therion@speleo.sk Subject: Re: [Therion] Scaling text and text orientation
Second thoughts Stacho, Perhaps -offset exactly as you describe in real world, unscaled millimetres would be useful, especially with the additional option of a leader line pointing to the text insertion point. Regards Bruce
-----Original Message----- From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Stacho Mudrak Sent: Monday, 19 November 2007 9:49 p.m. To: therion@speleo.sk Subject: Re: [Therion] Scaling text and text orientation
Quoting Bruce Mutton <bruce.mutton@paradise.net.nz>:
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.
Well, as far as I understand - you would like to have another option in addition to -align. Let's call it -offset and it would mean, how far from the desired feature the label should be. And this offset would be scale independent. Is it really like that?
Regards, S. _______________________________________________ Therion mailing list Therion@speleo.sk http://www.speleo.sk/mailman/listinfo/therion
_______________________________________________ Therion mailing list Therion@speleo.sk http://www.speleo.sk/mailman/listinfo/therion
On 2007-11-19 21:38 -0000, Cooper, Ben wrote:
The problem is that as the text size scales, it overlays cave passage. So a scrap has to be drawn with the scale in mind. In that case, the offset needs to scale with the text size. A simple solution would be for the text of a point label to be left or right justified, so it can be positioned close to the relevant feature, and the text will then scale harmlessly to the right or left. This doesn't solve the problem of the text overlaying other adjacent scraps or cave passages, of course.
I've had real troubles with this too. You can label an individual scrap OK, but then some other scrap will come and make your lables look crap by half-overlaying some. In a complex multi-layer cave with different output sizes this is a real problem. It is incredibly inefficient opening a scrap file to edit one label position a tiny bit to the right then regenerating the whole thing and loading the PDF again to see if it is in thte right place yet. Of courtse the solution to this is very difficult, but some kind of algorithm to place labels on the final map, not just the one scrap might get close to doing the right thing. Julian Todd suggested a(n invisble) line along which the label could move outwards until it found it was not overlapping anything. With some kind of limit when it simply decides the label 'doesn't fit' and should just be left off. This is a really hard problem, but currently Therion doesn't even try to solve it, and doing it manually is very tedious. There is definately room for improvement, although Therion's design makes it difficult. I like the metpost for large-area label-selectivity. That could be really useful. I just got a much faster computer going today so may try some of the mulu stuff again (I pretty-much gave up as the rendering was so slow). Wookey -- Principal hats: Balloonz - Toby Churchill - Aleph One - Debian http://wookware.org/
On 20.11.2007, at 0:40, Wookey wrote:
It is incredibly inefficient opening a scrap file to edit one label position a tiny bit to the right then regenerating the whole thing and loading the PDF again to see if it is in thte right place yet.
I know it is not the therion solution, but you may open pdf in suitable software and edit it directly. It is faster if you need a map for poster or publication. Martin
participants (5)
-
Bruce Mutton -
Cooper, Ben -
Martin Sluka -
Stacho Mudrak -
Wookey