Using text formatting tags with the Maplex Label Engine
ArcGIS text formatting tags allow you to modify the formatting for a portion of a piece of text. This lets you create mixed-format text where, for example, you could create a label expression to label city features with the city name and population. To help map readers distinguish between the two pieces of information, you might format the label expression so the city name would be drawn in black and the population of the city in red. Text formatting tags allow you to specify the text symbol of a particular part of a label. You can change the font color, height, type, and style and create subscripts and superscripts. You can also control character and word spacing and leading between lines.
Text formatting tags are entered in the Label Expression dialog box and can also be part of the attribute field itself.
Using text formatting tags with Maplex Label Engine formatting parameters
Text formatting tags are designed to override the properties assigned to the text symbol of a label class. The Maplex Label Engine detects text formatting tags during the label placement process. Because text formatting tags dictate a label's appearance and override formatting parameters, the Maplex Label Engine will switch off its formatting parameters for a label class in some cases when it detects a text formatting tag in a label string.
The following is a list of situations in which text formatting tags are either ignored or change the behavior of the Maplex Label Engine.
- The character spacing text formatting tag is ignored by the Maplex Label Engine. Character spacing must be set in the text symbol to be respected.
- The word spacing text formatting tag is ignored by the Maplex Label Engine. Word spacing must be set in the text symbol to be respected.
- Font reduction behavior in the Maplex Label Engine is turned off when a label has either a font size or leading text formatting tag.
- Labels containing text formatting tags will not be abbreviated by the Maplex Label Engine when using an abbreviation dictionary.
If some labels from a label class have text formatting tags but none of them are present in the current map extent, no text formatting tags will be detected, and the text formatting tag restrictions above will not come into effect.
Additional text formatting tags supported with the Maplex Label Engine
The Maplex Label Engine offers an additional unique tag.
"<BSE>" & [FIELDNAME] & "</BSE>"
When multiple label fields are used to label a feature, it is necessary to designate which label is the key or base label. The base label is used for the placement strategies, and the other labels are placed in relation to the base label.
The Base tag is only supported by the Maplex Label Engine. If the Standard Label Engine encounters the <BSE> tag, it will be ignored and removed before the label is placed.
This label class has a placement location of East, so the label is placed due east of the point features. By associating the Base tag label with the first line in the label expression, you control how the complete label expression is placed relative to the feature.
"<BSE>" & [Name] & "</BSE>" & vbnewline & "Population: " & [Pop2000] & vbnewline & "Median Age: " & [MED_AGE]