<?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: acrgis python add text background color in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448300#M35158</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's what you can do with labels&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/fr/help/main/10.2/index.html#//00s30000002t000000" title="http://resources.arcgis.com/fr/help/main/10.2/index.html#//00s30000002t000000"&gt;Aide ArcGIS (10.2, 10.2.1 et 10.2.2)&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jul 2015 18:11:03 GMT</pubDate>
    <dc:creator>WesMiller</dc:creator>
    <dc:date>2015-07-13T18:11:03Z</dc:date>
    <item>
      <title>acrgis python add text background color</title>
      <link>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448296#M35154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is possible to add text background color using python on ArcGIS(ArcMap 10)? I wrote a function that able to change font color of the string but I want to add background color to it as well&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="kwd"&gt;def&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; changeColor &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;([&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;s1&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;]):&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;return&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"&amp;lt;CLR red = '255'&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;+&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;s1&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;]&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;+&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"&amp;lt;/CLR&amp;gt;"&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="str"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Following links show me how add background color manually &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Creating_text_symbols/00s60000000z000000/" rel="nofollow"&gt;http://resources.arcgis.com/en/help/main/10.2/index.html#/Creating_text_symbols/00s60000000z000000/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Is that a way that I can write a python script instead of doing manually?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 17:11:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448296#M35154</guid>
      <dc:creator>dz1</dc:creator>
      <dc:date>2015-07-13T17:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: acrgis python add text background color</title>
      <link>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448297#M35155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aside from using &lt;A _jive_internal="true" href="https://community.esri.com/message/401088#401088"&gt;ArcObjects with Python&lt;/A&gt;, I don't believe text background is directly customizable. At least, not through &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s800000017000000"&gt;formatting tags&lt;/A&gt; or the &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/TextElement/00s30000000m000000/"&gt;TextElement &lt;/A&gt;object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a workaround, you could add a formatted text element to your mxd, then use it as a template for other TextElements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 17:42:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448297#M35155</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-07-13T17:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: acrgis python add text background color</title>
      <link>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448298#M35156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are trying to change colors in a text element? What are you trying to do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 17:42:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448298#M35156</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-07-13T17:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: acrgis python add text background color</title>
      <link>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448299#M35157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I want to create a label that I can change font color and background color of the text&lt;/P&gt;&lt;P&gt;ex: in below&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #d99594; background: red;"&gt;&amp;nbsp; ABC&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #d99594; background: black;"&gt;DE&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 17:51:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448299#M35157</guid>
      <dc:creator>dz1</dc:creator>
      <dc:date>2015-07-13T17:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: acrgis python add text background color</title>
      <link>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448300#M35158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's what you can do with labels&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/fr/help/main/10.2/index.html#//00s30000002t000000" title="http://resources.arcgis.com/fr/help/main/10.2/index.html#//00s30000002t000000"&gt;Aide ArcGIS (10.2, 10.2.1 et 10.2.2)&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 18:11:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448300#M35158</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-07-13T18:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: acrgis python add text background color</title>
      <link>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448301#M35159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As &lt;A href="https://community.esri.com/migrated-users/19932"&gt;Darren Wiens&lt;/A&gt;&amp;nbsp; mentioned these properties are not exposed to arcpy and can only be changed using ArcObjects. It is not possible to achieve this with formatting tags. These are the only available ones:&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00s800000017000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//00s800000017000000"&gt;http://resources.arcgis.com/en/help/main/10.2/index.html#//00s800000017000000&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only think I can think of, is that you is that you pre-create layers with different types of background colors (if the number of colors is low) and use these by changing the datasource and other aspects available through arcpy...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 18:11:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448301#M35159</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-07-13T18:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: acrgis python add text background color</title>
      <link>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448302#M35160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have few thousands data(only require five colors), I need to format the label according to it's string value. (It doesn't&amp;nbsp; need to be in label, It can be in any form) I just need to show something like this &lt;SPAN style="color: #d99594; background: teal;"&gt;ABC&lt;/SPAN&gt;&lt;SPAN style="color: #0070c0; background: yellow;"&gt; EFG&lt;SPAN style="color: #0070c0; background: yellow;"&gt;G&lt;/SPAN&gt; &lt;/SPAN&gt;on the map. Is there a way I can do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is possible that I can create two label then I can combine these label into one?&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;label 1&amp;nbsp;&amp;nbsp; +&amp;nbsp; label 2&amp;nbsp;&amp;nbsp;&amp;nbsp; = label&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #d99594; background: teal;"&gt;ABC&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0070c0; background: yellow;"&gt;EFG&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #d99594; background: teal;"&gt;ABC&lt;/SPAN&gt;&lt;SPAN style="color: #0070c0; background: yellow;"&gt; EFG&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 17:27:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448302#M35160</guid>
      <dc:creator>dz1</dc:creator>
      <dc:date>2015-07-14T17:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: acrgis python add text background color</title>
      <link>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448303#M35161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create one label for each color background, style the label as you want it, give it an ID, and save them in your mxd (off the map is fine). Then, you can access the TextElement by its ID, copy it, and position it, all through Python.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 18:12:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448303#M35161</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-07-14T18:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: acrgis python add text background color</title>
      <link>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448304#M35162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The only thing I can come up with is using label classes on a point featureclass:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/117289_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;As you can see, when the labels get close together (lower left) the formatting is changed.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each feature has a label part1 and a label part2&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/117293_pastedImage_2.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;In this case I only create a single color combination. However, you can add label classes with its corresponding color (for part 1 and 2 separately) and set the SQL Query according to the field values you want to distinguish. A feature is labeled twice: once for part 1 and once for part 2. Both use have the same placement property (prefer upper left) this causes the second part to be placed directly against the first part without the spacing which you would have if you define part 1 upper left and part 2 upper right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might take some time to tweak, but could work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The option provided by Darren (copy the element with python) is an option, but you would have to handle overlapping labels manually and when you have a lot of features, will create a very dense layout (lots of elements).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 18:41:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448304#M35162</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-07-14T18:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: acrgis python add text background color</title>
      <link>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448305#M35163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 13:58:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acrgis-python-add-text-background-color/m-p/448305#M35163</guid>
      <dc:creator>dz1</dc:creator>
      <dc:date>2015-07-15T13:58:53Z</dc:date>
    </item>
  </channel>
</rss>

