Auto Font Size / Alignment for Labels?

Delfos, Jacob jacob.delfos at MAUNSELL.COM
Wed Nov 16 17:59:52 EST 2005


Hi Jack,

I think it's important for you to understand the difference between an
annotation and a label.

A label is the value of an attribute. For example, in a shapefile, a
street might have attributes "name", "length", "id". Displaying any of
these values on the map would be a label. You could use " angle 'auto' "
to rotate this label to the orientation of the feature it belongs to.

An annotation is a text object, a graphic. It is an independent object
that bears no relation to any other object. Its only relevant attribute
is "text". The other attributes it has relate to things like font-size,
colour, angle, etc. An annotation is not, and does not belong to, a
geometry. An annotation can not align itself to the road automatically,
because it does not have anything to do with the road. Any resemblance
in rotation-angle was done manually by whom designed the DGN. It does
not know that it should align itself to a particular feature. 

So in your case, the only way to get rotated items is if the rotation
exists in the DGN. However, I am NOT sure how to get this rotation to
show with "styleitem 'auto'". I believe you can use "labelangleitem
'ANGLE'" to get it, but I'm not sure. Also, annotations/labels can only
be rotated for true-type, but it seems that "styleitem 'auto'" picks
non-truetype fonts. So you may have to experiment with that. In the
past, I have saved the annotation layers to point files (with angle),
and then use labelangleitem to show them (in a separate layer).

Hope this helps,

Jacob

 

> -----Original Message-----
> From: UMN MapServer Users List 
> [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Jack Ling
> Sent: 15 November 2005 13:57
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: [UMN_MAPSERVER-USERS] Auto Font Size / Alignment for Labels?
> 
> Hi all,
> 
> 
> After you experts gave me advice so that my map could show the label
> for the map (ie. oads/buildings etc.), I've been struggling to get the
> display right for me.
> 
> - 1st, the labels include things such as Street names, Street No,
> Building Names etc. I would like the Street Nos to be smaller in font
> size, while Building Names be bigger. However, since so far I put a
> finite SIZE (e.g SIZE 14) for the Label layer, all labels have the
> same font size. My DGN file only have one attribute named "TEXT" which
> is utiltized as Label annotation. I don't how to have the Font Size of
> various elements be displayed proportionally.? Anything auto adjusted?
> 
> -also, the labels are aligned horizontally. I should expect the Labels
> be aligned properly with the feature. e.g. align along the road
> direction, building direction etc.
> 
> - I have perfect display of the maps if I were to open the DXF format
> version from AutoCad. But seems I can't use DXF as MapServer doesn't
> support it? That pushes me to ask from my source for a DGN format
> version of the maps. Now, with the DGN version, I've the
> above-mentioned probelms....Furthermore, I don't have Microstation to
> edit a DGN file. I have AutoCad to edit the maps (turn on / off
> layers), but seems no way I can closely work with MapServer...? Any
> change I can use AutoCad to do some thing for me?
> 
> Thanks again.
> jack ling
> 



More information about the mapserver-users mailing list