Using text formatting tags for labeling with Maplex
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 formatting parameters
Text formatting tags are designed to override the properties assigned to the text symbol of a label class. The ESRI 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 ESRI 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 ESRI Maplex Label Engine.
- The character spacing text formatting tag is ignored by the ESRI 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 ESRI Maplex Label Engine. Word spacing must be set in the text symbol to be respected.
- Font reduction behavior in the ESRI 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 ESRI 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 Maplex for ArcGIS
Maplex for ArcGIS offers an additional tag that is unique to the extension.
Base
"<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 ESRI Maplex Label Engine. If the ESRI Standard Label Engine encounters the <BSE> tag, it will be ignored and removed before the label is placed.
Example
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]