[GRASS-dev] improved d.labels rendering

Hamish hamish_nospam at yahoo.com
Tue Apr 17 00:34:24 EDT 2007

> Hamish wrote:
> > Text rotation now works properly in d.labels for any justification
> > setting. Also placement is improved for all center and lower
> > justified text. Even multi-line labels are working correctly.
> > 
> > Only lightly tested so far.

Wolf wrote:
> I haven't tested multi-line labels, but rotation seems to work nicely.
> There is however a bug. If there is a space between the ':' and the
> label text, the space becomes part of the label and thus the label is
> shifted to the right by one space. I have worked around this in
> v.label.sa by not adding a space between the ':' and the label text.

this is a bug in the rendering stage, not at the labels file creation
stage (there is nothing wrong with the labels file). Fixed last week in
d.labels/do_labels.c revs 1.20,1.21 with the improved rotation code.

ps.map was already working correctly.
> I have also attached a patch which will add support for a label
> position "none none", which simply means to place the label at the
> exact point given (no shifting in any direction).

how does that differ from center,center (the default)? or is it "raw",
which is {R_move_abs(x,y); R_text(string);} in that case how does
none,none differ from the lower,left case?
(why is this useful?)

I just added some debug code in d.labels to write the rotated text
bounding boxes out to a vector ascii file. (zoom dependent, even with
size=mapunits, as the rendered font size is not smooth but jumps by
quantum amounts)

(mostly off-line for the next few days)

More information about the grass-dev mailing list