I want to convert an svg as an icon font element in my HTML/CSS using icomoon app
<svg width="325" height="350" viewBox="0 0 325 350" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M205.43 59.38C205.43 26.5853 232.015 0 264.81 0C297.605 0 324.19 26.5853 324.19 59.38C324.19 92.1747 297.605 118.76 264.81 118.76C246.525 118.76 230.17 110.495 219.277 97.4975L116.536 157.274C117.985 162.41 118.76 167.83 118.76 173.43C118.76 178.348 118.162 183.127 117.035 187.697L222.002 248.758C232.806 237.522 247.991 230.53 264.81 230.53C297.605 230.53 324.19 257.115 324.19 289.91C324.19 322.705 297.605 349.29 264.81 349.29C232.015 349.29 205.43 322.705 205.43 289.91C205.43 280.791 207.486 272.152 211.159 264.431L109.497 205.292C98.9566 221.836 80.4498 232.81 59.38 232.81C26.5853 232.81 0 206.225 0 173.43C0 140.635 26.5853 114.05 59.38 114.05C79.7735 114.05 97.7659 124.331 108.457 139.992L209.556 81.1716C206.893 74.4248 205.43 67.0733 205.43 59.38ZM264.81 19C242.509 19 224.43 37.0787 224.43 59.38C224.43 81.6813 242.509 99.76 264.81 99.76C287.111 99.76 305.19 81.6813 305.19 59.38C305.19 37.0787 287.111 19 264.81 19ZM59.38 133.05C37.0787 133.05 19 151.129 19 173.43C19 195.731 37.0787 213.81 59.38 213.81C81.6813 213.81 99.76 195.731 99.76 173.43C99.76 151.129 81.6813 133.05 59.38 133.05ZM224.43 289.91C224.43 267.609 242.509 249.53 264.81 249.53C287.111 249.53 305.19 267.609 305.19 289.91C305.19 312.211 287.111 330.29 264.81 330.29C242.509 330.29 224.43 312.211 224.43 289.91Z" fill="#0D0F13"/>
</svg>
But every time I generate the icon font file one of the three circles is filled black in icomoon preview and when used in HTML:
<span class="icon icon-share">

This rendering issue is caused by non ideal path directions.
You icon is a compound path – it contains multiple subpaths (the cut out "holes").
Usually, you define which shapes should be interpreted as solid or cut-out by switching path directions:
E.g. if the outer shape's path commands have a clockwise path direction – the inner ones should use a counter-clockwise direction.
It doesn't matter if you're using clockwise vs. counter-clockwise or the other way around. Inner (cut out) paths just have to use the opposite direction.
Also explained in this article: The Winding Order of the Fill Rule
Svg: fill-rule="evenodd
The original svg file renders fine since it has a
fill-rule="evenodd"applied to the path element.Apparently, icomoon font generator expects your icons to have the aforementioned alternating directions.
In other words it can't use fill-rules when converting svg to font files.
Fix path directions
Here is a helper script to fix inner paths.
(Inspect the element in your dev tools to get the new path)
How it works
1.2 the path data is retrieved in a normalized way (
path.getPathData({normalize: true}):all commands will be converted to a reduced set using only absolute
M,L,C,Zcommands.Mcommand)isClockwise(path)helper)reversePathData(pathdata))dpropertyCodepen example
You might also use this codepen helper: Fix svg compound path direction
This script will keep the original command types – so
A,Qcommands won't be converted to cubic béziers.HTML/CSS example
Alternative: paper.js:
If your app already employs paper.js you can also use its
reorient()method to fix path directions. See related post "Paper.js reorient: SVG subpaths are lost"