MapServer / MapServer-import

3 stars 2 forks source link

Inter-character spacing control for labels and annotation #2295

Closed mapserver-bot closed 8 years ago

mapserver-bot commented 12 years ago

Reporter: panzel Date: 2011/09/17 - 21:09 Original: http://trac.osgeo.org/mapserver/ticket/4026 When text (labels, annotation) is drawn, the default inter-character spacing (also called “tracking” in typography) rules defined by the font (especially in the case of TrueType or FreeType fonts) are applied. In some cases, common practice suggests larger inter-character spacing than common for the font, such as for labeling large bodies of water.

When used to label sinuous vectors, such as stream lines or contour lines in mountainous terrain, labels may exhibit character overlap, despite fine-tuning of the MAXOVERLAPANGLE. Tweaking font choice does help in some cases, but is not always available as an option or entirely sufficient. By adding another text attribute, in parallel to FONT or SIZE, the inter-character spacing may be introduced.

I suggest the new parameter be called INTERCHARSPACING (or any other semi-intelligible name) and that it take a value of a floating point number. This number would be interpreted as the width to insert between adjacent characters in units of “em”, or the width of the font’s upper-case “M” character. The value should default to 0, for no additional space. A value of “0.3” would represent the addition of 0.3 “M” widths (“0.3em”) between adjacent characters. The parameter might, for no good reason, allow negative values as well. For example, a value of “-0.05” might reduce spacing by 5% of an em.

By extension, an INTERWORDSPACING suggests itself, again with a float value in “em” units. This would allow tighter control of spacing between words. It might be applied to the space between a whitespace and non-whitespace character, or to any adjacent whitespace characters.

mapserver-bot commented 8 years ago

This is an automated comment

This issue has been closed due to lack of activity. This doesn't mean the issue is invalid, it simply got no attention within the last year. Please reopen if still valid.