Select to view content in your preferred language

Arcade In Line Styling for Labels

657
2
Jump to solution
01-18-2024 10:07 AM
JohnKellyNeedsGISHelp
New Contributor

Hi all.  

I am currently trying to make a label in Arcade for a layer I am working on.  I would like to have one of the lines (the one below in bold) in the label be a different font size than the rest of the label.  Is there a way to do this within Arcade?  I thought it would be in the TextFormatting constant but it doesn't seem to be.

Thanks, and please let me know what you think.

return 'Hard: ' +DomainName($feature, 'PER_HARDWO') +'%'+TextFormatting.NewLine+
'Con: '+DomainName($feature, 'PER_CONIFE')+'%'+TextFormatting.NewLine+
'Shrub: '+DomainName($feature, 'PER_SHRUB')+'%'+TextFormatting.NewLine+
'Herb: '+DomainName($feature, 'HERB_CODE')+'%'+TextFormatting.NewLine+
DomainName($feature, 'Map_Unit')+TextFormatting.NewLine+
'Acres: '+Ceil((($feature.Shape__Area)/4046.91),2);

 

-John

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

In Pro, you can alter the font with HTML tags, like "<BOL>".

Also, check out using template literals, it can make for a much easier-to-read expression. Not sure about Pro, but in other contexts, it will respect a line break within the backtick string:

return `Hard: ${DomainName($feature, 'PER_HARDWO')}%
Con: ${DomainName($feature, 'PER_CONIFE')}%
Shrub: ${DomainName($feature, 'PER_SHRUB')}%
Herb: ${DomainName($feature, 'HERB_CODE')}%
<BOL>${DomainName($feature, 'Map_Unit')}</BOL>
Acres: ${Ceil((($feature.Shape__Area)/4046.91),2)}`

 

- Josh Carlson
Kendall County GIS

View solution in original post

2 Replies
jcarlson
MVP Esteemed Contributor

In Pro, you can alter the font with HTML tags, like "<BOL>".

Also, check out using template literals, it can make for a much easier-to-read expression. Not sure about Pro, but in other contexts, it will respect a line break within the backtick string:

return `Hard: ${DomainName($feature, 'PER_HARDWO')}%
Con: ${DomainName($feature, 'PER_CONIFE')}%
Shrub: ${DomainName($feature, 'PER_SHRUB')}%
Herb: ${DomainName($feature, 'HERB_CODE')}%
<BOL>${DomainName($feature, 'Map_Unit')}</BOL>
Acres: ${Ceil((($feature.Shape__Area)/4046.91),2)}`

 

- Josh Carlson
Kendall County GIS
JohnKellyNeedsGISHelp
New Contributor

Thanks for the advice Josh, I'll check out HTML tags, and hopefully that will work well. 

0 Kudos