2

Using ArcGIS Pro 3.2.2, I'm unable to get a particular feature class to have its multiline labels' text aligned left. They only come out centre-aligned.

I have found that the horizontal alignment options (in the labelling properties) are not available (greyed out) when using the Maplex engine (default). According to the documentation, it can be controlled with label stacking constraints instead. However, when this also failed, further research found that label stacking configuration is ignored when labels use formatting tags. In my case, I want the first line bold and underlined, so stacking wont work with these formatting tags.

So my third attempt at getting the text aligned left was to use the <ALIGN> formatting tags within the label text expression. However, this appears to be doing nothing also!

I've tried varitions on the following label expression (Python), but with no joy:

"<ALIGN horizontal = 'left'><BOL><UND><BSE>BLAH</BSE></UND></BOL></ALIGN>\nArea: 1,000 ha\nCapacity: 2,000 ML\n<ALIGN horizontal = 'left'>Irrigators: 123</ALIGN>"

The above example attempts to align the first and last lines left. I've also tried it with a single <ALIGN> tag pair which covers all of the text to align all lines left, but that also did nothing.

As suggested in comments, I have also tried removing all tags apart from the <ALIGN> tags, again without any luck. Also tried with the Javascript, VBScript and Arcade parsers, again with no joy.

How can I get both formating (bold, underline for the first line) plus left-alignment in these labels?

3
  • 1
    Have you tried using different label expression parsers? Or removing some of your extra tags to see what impact that has (if any)?
    – Midavalo
    Commented May 13 at 23:20
  • @Midalvalo - good suggestions. I have updated the question to include the answers (same result with VBScript, Javascript and Arcade, and same result with removing all non-ALIGN tags). I have also simplified the expression to be a plain text string, with no variable interpolation. Commented May 14 at 0:04
  • If I copy your example expression "<ALIGN horizontal = 'left'><BOL><UND><BSE>BLAH</BSE></UND></BOL></ALIGN>\nArea: 1,000 ha\nCapacity: 2,000 ML\n<ALIGN horizontal = 'left'>Irrigators: 123</ALIGN>" into my ArcGIS Pro, the labels align as expected. Makes me think that perhaps there's a setting somewhere that you've set and need to unset. I'm trying to see if I can find one. Pro 3.3 here.
    – Midavalo
    Commented May 14 at 0:39

1 Answer 1

1

Figured it out. The label 'Callout' was set to 'Composite' (not sure why). Changing it to 'Background' resolved the issue.

It's unclear to me why this does not work for 'Composite' label callouts (which I don't actually know anything about), but hey... it's a solution that works for me, for now.

In fact, with this change, the Stacking 'Constrain Left' now works for me also, and I don't even need the ALIGN tags at all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.