Opened 9 years ago

Last modified 9 years ago

#4026 new enhancement

Inter-character spacing control for labels and annotation

Reported by: panzel Owned by: tbonfort
Priority: normal Milestone:
Component: Renderer API Version: unspecified
Severity: normal Keywords:


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.

Change History (1)

comment:1 Changed 9 years ago by panzel

Component: MapServer C LibraryRenderer API
Owner: changed from sdlime to tbonfort
Note: See TracTickets for help on using tickets.