Map Typography – Formatting Tags in ArcMap

Posted by in ArcMap, Design, GIS, Labeling

Text formatting can be controlled through the use of formatting tags. The syntax is similar to html or xml tags. Formatting tags make controlling how your type appears much more efficient that using the graphical interface in ArcMap. Instead of going through multiple windos to set the character spacing for a piece of type, you can wrap the text with an opening tag <chr spacing=”150″> and a closing tag </chr>.

I keep a text file of these formatting tags open at all times while I’m working. I use notepad++ so I can have many files open in a tabbed manner, like tabs in a browser.

I’ve uploaded the text file I created with all the ArcMap formatting tags here and one with many of the dynamic tags here.

Now I’ll take you step by step to build the following text using only formatting tags.

Sequence 00

start by adding a text box in ArcMap and paste the following:
title name
Project name & location
< 50 miles of coast

Sequence 01

Now add the all caps tag around the title name text so that line reads
<acp>title name</acp>

Sequence 02

This tag is not working because there are two invalid characters. The ampersand and less than character. When using formatting tags, you must replace these characters with a coded string. To display the ampersand, replace the & with &amp; and the < character with &lt;.

Your code should look like this:
<acp>title name</acp>
Project name &amp; location
&lt; 50 miles of coast

And the text in the layout like this:

Sequence 03

Formatting tags will also not work if the case of the tags is inconsistent, you can’t start a tag in all caps and end it lowercase. You also cannot mix cases when using more than one tag.

Now add the italics tags <ita></ita> around the word name.
<acp>title <ita>name</ita></acp>
Project name &amp; location
&lt; 50 miles of coast

All tags must be closed and when using more than one tag, you must ensure that the are closed in the opposite order that they were opened. The first tag opened is the last tag closed.

Add this font tag around the entire first line:
<fnt name="Franklin Gothic Demi Cond" size="18"></fnt>

Sequence 04

Now add another font tag for both the second and third line, open the tag at the start of the second line and close it at the end of the third line. Use the following:
<fnt name="Palatino Linotype" size="14"></fnt>

Sequence 05
<fnt name="Franklin Gothic Demi Cond" size="18"><acp>title <ita>name</ita></acp></fnt>
<fnt name="Palatino Linotype" size="14">Project name &amp; location
&lt; 50 miles of coast</fnt>

Notice the Properties window for the text still shows Arial 10 but there is no Arial in the display! Now add a font tag around only the third line, this time define only the size and not the typeface.
<fnt size="10"></fnt>

Sequence 06
<fnt name="Franklin Gothic Demi Cond" size="18"><acp>title <ita>name</ita></acp></fnt>
<fnt name="Palatino Linotype" size="14">Project name &amp; location
<fnt size="10">&lt; 50 miles of coast</fnt></fnt>

Add a bold tag around the second and third lines.
<bol></bol>

Sequence 07
<fnt name="Franklin Gothic Demi Cond" size="18"><acp>title <ita>name</ita></acp></fnt>
<fnt name="Palatino Linotype" size="14"><bol>Project name &amp; location
<fnt size="10">&lt; 50 miles of coast</fnt></bol></fnt>

The closing bold tag has to be placed between the two closing font tags because there is one font tag opened before the bold tag and one open after the bold tag.

Add an italics tag to the second line.
<ita></ita>

Sequence 08
<fnt name="Franklin Gothic Demi Cond" size="18"><acp>title <ita>name</ita></acp></fnt>
<fnt name="Palatino Linotype" size="14"><bol><ita>Project name &amp; location</ita>
<fnt size="10">&lt; 50 miles of coast</fnt></bol></fnt>

Add an underline tag to the third line.
<und></und>

Sequence 09
<fnt name="Franklin Gothic Demi Cond" size="18"><acp>title <ita>name</ita></acp></fnt>

<fnt name="Palatino Linotype" size="14"><bol><ita>Project name &amp; location</ita>
<fnt size="10"><und>&lt; 50 miles of coast</und></fnt></bol></fnt>

Add a color tag around the first line.
<clr cyan="63" magenta="52" yellow="51" black="100"></clr>

<fnt name="Franklin Gothic Demi Cond" size="18"><acp><clr cyan="63" magenta="52" yellow="51" black="100">title <ita>name</ita></clr></acp></fnt>
<fnt name="Palatino Linotype" size="14"><bol><ita>Project name &amp; location</ita>
<fnt size="10"><und>&lt; 50 miles of coast</und></fnt></bol></fnt>

Not much of a change visually but now the black will print rich black instead of plain black. Notice that the color tag is closed outside the closing italics tag for the first line.

Add a color tag for the second line. If you have zero values the parameteres can be left out.
<clr cyan="100"></clr>
is the same, but shorter, as
<clr cyan="100" magenta="0" yellow="0" black="0"></clr>

Sequence 10

Add a color tag for the third line.
<clr magenta="100"></clr>

Sequence 11
<fnt name="Franklin Gothic Demi Cond" size="18"><acp><clr cyan="63" magenta="52" yellow="51" black="100">title <ita>name</ita></clr></acp></fnt>
<fnt name="Palatino Linotype" size="14"><bol><ita><clr cyan="100">Project name &amp; location</clr></ita>
<fnt size="10"><und><clr magenta="100">&lt; 50 miles of coast</clr></und></fnt></bol></fnt>

Finally, add a line tag around the entire text block to reduce the line spacing.
<lin leading="-4"></lin>

Sequence 12
<lin leading="-4"><fnt name="Franklin Gothic Demi Cond" size="18"><acp><clr cyan="63" magenta="52" yellow="51" black="100">title <ita>name</ita></clr></acp></fnt>
<fnt name="Palatino Linotype" size="14"><bol><ita><clr cyan="100">Project name &amp; location</clr></ita>
<fnt size="10"><und><clr magenta="100">&lt; 50 miles of coast</clr></und></fnt></bol></fnt></lin>

Use your imagination and some creativity. Tags can be applied to one character in a string.

Sequence 13

tes<acp><ita>t</ita></acp>

They can also be used in the legend through the table of contents text.

Sequence 14

Use tags!

2 Comments

  1. Whitney
    October 2, 2015

    Hey Brian,

    Excellent tips! Question though, what if you are using an advanced labeling expression? I have a written a Advanced Python Label Expression through Label Manager, and I can’t get ArcMap to recognize that, for instance, < is not just a text string.

    Here is an example…

    def FindLabel(value):

    a = value
    if a == “55” or a== “55.0”:
    a = “<” + a

    return a

    Reply
    • Brian
      October 6, 2015

      Hey Whitney, thanks! The “<" should be replaced with "& l t ;" [remove the spaces] if formatting tags are used. I may be reading the question wrong, though. You may have to convert a to a string before passing it to the labeler? str(a) or "<" + str(a)

      Reply

Leave a Reply