[mapserver-dev] Letterspacing is different for polyline labels
Oliver Tonnhofer
olt at omniscale.de
Tue Jul 24 07:33:46 PDT 2012
Hi,
while comparing the rendering of Mapnik and Mapserver I found out that the letter spacing of line labels is much larger with Mapserver.
After diving into the source code, I found out that labels on a straight line are rendered differently than on curved lines. As mentioned in #4026, the inter-character spacing is defined in the font itself, but that spacing is multiplied by 1.25 when a label is rendered on a polyline.
See: https://github.com/mapserver/mapserver/blob/master/mapprimitive.c#L1818
Here you can see how "Alter Wall" and "Neuer Wall" are rendered with different spacing. "Alter Wall" is on a straight line, while "Neuer Wall" is on a curved line.
https://dl.dropbox.com/u/2633201/issues/mapserver/letterspacing-125.png
Changing the letterspacing to 1.0 in mapprimitive.c makes the rendering more similar:
https://dl.dropbox.com/u/2633201/issues/mapserver/letterspacing-100.png
The output is now also quite similar to the output of Mapnik (after adapting the fontsize).
I've created a ticket for that issue: https://github.com/mapserver/mapserver/issues/4404
Regards,
Oliver
--
Oliver Tonnhofer | Omniscale GmbH & Co KG | http://omniscale.de
http://mapproxy.org | https://github.com/olt | @oltonn
More information about the mapserver-dev
mailing list