I want to create a label expression with two lines of text, this should be simple but I'm having a lot of trouble. Basically, I need the top line to be 10 pt font, and the next line to be 8pt font that is italicized.
This is what I have:
def FindLabel ( [LABEL1], [LABEL2] ):
return "<FNT size = '10'>" + [LABEL1] + "</FNT>" + "\n" + "<FNT size = '8'><ITA>" + [LABEL2] + "</FNT><ITA>"
This is interpreting the formatting as a string, so it's just spitting out exactly what I put in.
The piece of code below will work fine, but as soon as I add the new line everything is messed up.
"<FNT size = '10'>" + [LABEL1] + "</FNT>"
I would like to do this using Python.
Best Answer
You fell a victim to the Expression Verification window (activated by clicking the
Verify
button).The code:
The new lines won't be rendered properly there. You have to hit
OK
and thenApply
and actually see how labels look on the map.It is also possible to include other tags such as
<BOL>
and<ITA>
: