Multiple XML tags in arcade label expression

231
1
02-24-2021 01:06 AM
Labels (1)
MathiasBerlin
New Contributor

Hello,

I am trying to build a label expression with two fields where one field has a smaller font size and is top aligned relative to its bigger part. I've managed to change the font size between the two parts, but not combined with a vertical alignment. 

My expression looks like this: 

 "<v_align='top'>"+"<FNT size='5'>" + $feauture.Karttext_superscript + "</v_align>"+"</FNT>" + $feature.Karttext_base

I've tried different alignment tags but they don't seem to work combined with the font size tag. 
Any ideas on how to make this work? 

Thanks

0 Kudos
1 Reply
XanderBakker
Esri Esteemed Contributor

Hi @MathiasBerlin ,

In this help page you find a list of all the available tags to format labels in ArcGIS Pro: https://pro.arcgis.com/en/pro-app/latest/help/mapping/text/text-formatting-tags.htm 

There is no vertical-align tag, however, you can get close by using this:

"<FNT size= '12'>" + "First Text" + "</FNT>" + "<FNT size= '9'> <SUP>" + "Second Text" + "</SUP></FNT>"

XanderBakker_0-1614263240306.png

Make sure to switch off the option "Stack labels" in the label placement options, to avoid the text being wrapped and appear on multiple lines.

XanderBakker_1-1614263331457.png