<?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: custom fontIcons in Tools</title>
    <link>https://community.cisco.com/t5/tools/custom-fonticons/m-p/3468405#M101</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nwm, I have managed to solve this by duplicating the nx.grapphic.Icons class in a separate js file an modify the registerFonIcon as following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;registerFontIcon: function(name, fontfamily, fontCharacter, fontSize) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ICONS.icons[name] = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size: {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: fontSize,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: fontSize&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name: name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Array.isArray(fontCharacter)) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ICONS.icons[name].font = [fontCharacter[0], fontCharacter[1]];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ICONS.icons[name].font = [fontCharacter, fontCharacter];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; nx.dom.Document.addRule(".n-topology g[icontype=" + name + "] .fontIcon", "font-family: " + fontfamily + " !important;");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems to preserve the core functions yet allowing me to add font icons with the background just like the original icons.&lt;/P&gt;&lt;P&gt;Might be something to add to the core library in the future though in case one would like to use custom font icon but take advantage of the css behavior.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Apr 2018 07:05:40 GMT</pubDate>
    <dc:creator>Jhallqvist</dc:creator>
    <dc:date>2018-04-20T07:05:40Z</dc:date>
    <item>
      <title>custom fontIcons</title>
      <link>https://community.cisco.com/t5/tools/custom-fonticons/m-p/3468404#M100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I love the possibilities with this framework but the last couple of night I have been stumped in how to make my custom webfonts act like the built in webfont. From what I gathered in the sourcecode the built in icons use a background version of themself to match the selected theme and hide the link from showing if the svg has any transparent parts. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I register my custom webfont I am only allowed to register one and that one acts as the foreground icon. Since my icons (like a router) has transparent parts in it (just like built in ones) I can see the connector through the arrow symbols in the icon. Is there a way to remedy this? Maybe to be able to register a background icon as well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2018 10:32:23 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/custom-fonticons/m-p/3468404#M100</guid>
      <dc:creator>Jhallqvist</dc:creator>
      <dc:date>2018-04-19T10:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: custom fontIcons</title>
      <link>https://community.cisco.com/t5/tools/custom-fonticons/m-p/3468405#M101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nwm, I have managed to solve this by duplicating the nx.grapphic.Icons class in a separate js file an modify the registerFonIcon as following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;registerFontIcon: function(name, fontfamily, fontCharacter, fontSize) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ICONS.icons[name] = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size: {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: fontSize,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: fontSize&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name: name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Array.isArray(fontCharacter)) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ICONS.icons[name].font = [fontCharacter[0], fontCharacter[1]];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ICONS.icons[name].font = [fontCharacter, fontCharacter];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; nx.dom.Document.addRule(".n-topology g[icontype=" + name + "] .fontIcon", "font-family: " + fontfamily + " !important;");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems to preserve the core functions yet allowing me to add font icons with the background just like the original icons.&lt;/P&gt;&lt;P&gt;Might be something to add to the core library in the future though in case one would like to use custom font icon but take advantage of the css behavior.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2018 07:05:40 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/custom-fonticons/m-p/3468405#M101</guid>
      <dc:creator>Jhallqvist</dc:creator>
      <dc:date>2018-04-20T07:05:40Z</dc:date>
    </item>
  </channel>
</rss>

