<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Forcing label new line width in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/forcing-label-new-line-width/m-p/1033605#M38201</link>
    <description>&lt;P&gt;I bet there is a better way of working around the issue, but you could try adding a stacking separator such as "*" and making it not visible.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Mar 2021 21:17:06 GMT</pubDate>
    <dc:creator>MarkVolz</dc:creator>
    <dc:date>2021-03-05T21:17:06Z</dc:date>
    <item>
      <title>Forcing label new line width</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/forcing-label-new-line-width/m-p/1033050#M38161</link>
      <description>&lt;P&gt;Using ArcGIS Pro 2.7.1 with the Maplex labeling engine.&lt;/P&gt;&lt;P&gt;Trying to figure out how to force the maximum width of a label.&lt;/P&gt;&lt;P&gt;I have created a label expression in Arcade:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;"Species: " +  DomainName($feature, 'spp')
+TextFormatting.NewLine
+ "Height: " + $feature.height
+TextFormatting.NewLine
+"DBH: " +$feature.dbh
+TextFormatting.NewLine
+"Notes: " + $feature.longtermnotes&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the output I get is:&lt;/P&gt;&lt;P&gt;Species: spruce, engelmann&lt;BR /&gt;Height: 55&lt;BR /&gt;DBH: 28&lt;BR /&gt;Notes: Already half way through life span in this planting strip.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I force a paragraph width of say 25 characters?&amp;nbsp; I'm trying to avoid a long label width from "longtermnotes" field (last label line)&lt;/P&gt;&lt;P&gt;I have found when I go to the label properties:&lt;/P&gt;&lt;P&gt;Position: Stack options, that no mater what I put in for the "Maximum Characters per line" value that it won't limit the width of the label.&lt;/P&gt;&lt;P&gt;Is there a programmatic way to do that with Arcade or a text formatting tag?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Matt_Trebesch_0-1614886616611.png" style="width: 694px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/7535i56D156ADB874CBA8/image-dimensions/694x460?v=v2" width="694" height="460" role="button" title="Matt_Trebesch_0-1614886616611.png" alt="Matt_Trebesch_0-1614886616611.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 19:37:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/forcing-label-new-line-width/m-p/1033050#M38161</guid>
      <dc:creator>Matt_Trebesch</dc:creator>
      <dc:date>2021-03-04T19:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Forcing label new line width</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/forcing-label-new-line-width/m-p/1033605#M38201</link>
      <description>&lt;P&gt;I bet there is a better way of working around the issue, but you could try adding a stacking separator such as "*" and making it not visible.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 21:17:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/forcing-label-new-line-width/m-p/1033605#M38201</guid>
      <dc:creator>MarkVolz</dc:creator>
      <dc:date>2021-03-05T21:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Forcing label new line width</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/forcing-label-new-line-width/m-p/1033958#M38246</link>
      <description>&lt;P&gt;yeah, I thought about that, but I'm hoping for a programmatic solution that doesn't require altering data, but your suggestion is appreciated!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 15:17:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/forcing-label-new-line-width/m-p/1033958#M38246</guid>
      <dc:creator>Matt_Trebesch</dc:creator>
      <dc:date>2021-03-08T15:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Forcing label new line width</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/forcing-label-new-line-width/m-p/1166700#M54302</link>
      <description>&lt;P&gt;You could add a function to the Arcade expression to modify the longtermnotes field. That function could add line breaks at the desired intervals and return the modified notes that you can output in your original label expression. Here's an updated label expression that uses an Arcade function to add a line break once there are at least 24 characters in a line.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;function FormatNotes(notes){
  var formattedNotes = "";
  var lineCharCount = 0;
  var wordArray = Split(notes, ' ');
  for (var i in wordArray) {
    if (lineCharCount &amp;gt;= 24) {
      lineCharCount = Count(wordArray[i]);
      formattedNotes += TextFormatting.NewLine + wordArray[i];
    }
    else {
      lineCharCount += (1 + Count(wordArray[i]));
      formattedNotes += " " + wordArray[i];
    }
  }
  return formattedNotes;
}

"Species: " + DomainName($feature, 'spp') + TextFormatting.NewLine +
"Height: " + $feature.height + TextFormatting.NewLine +
"DBH: " + $feature.dbh + TextFormatting.NewLine +
"Notes: " + FormatNotes($feature.longtermnotes)&lt;/LI-CODE&gt;&lt;P&gt;If you need to limit each line to a max of 25 characters you'd have to add some additional checks on the next word but this should give you a good starting point.&lt;/P&gt;&lt;P&gt;Here's an example label with this expression applied:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JesseWickizer_0-1650558836932.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/39559i1419C1D0DADD8CA7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JesseWickizer_0-1650558836932.png" alt="JesseWickizer_0-1650558836932.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 16:35:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/forcing-label-new-line-width/m-p/1166700#M54302</guid>
      <dc:creator>JesseWickizer</dc:creator>
      <dc:date>2022-04-21T16:35:53Z</dc:date>
    </item>
  </channel>
</rss>

