Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with Icons containing circles: some circles will be filled, although they shouldn't #135

Open
scrapix opened this issue Mar 3, 2021 · 15 comments

Comments

@scrapix
Copy link

scrapix commented Mar 3, 2021

Icon creation + SVG export tool: figma
OS: OS X BigSur
Browsers: Safari, Firefox, Chrome
fantasticon version: 1.1.1

Problem
no matter how I create Icons, some circles get filled unexpectedly

Icon Creation in 4 different ways

  • decision-tree2: only centered strokes
  • decision-tree3: converted strokes to paths
  • decision-tree4: unioned together everything
  • decision-tree5: flattened result

image

Result
image

@tancredi
Copy link
Owner

tancredi commented Mar 3, 2021

Hi @scrapix - can you share your SVG? I would imagine there's a transparent fill circle somewhere in there :)

@scrapix
Copy link
Author

scrapix commented Mar 3, 2021

Hi @tancredi , thanks for the quick reply. Sure, here are the SVGs:
Archive.zip

@scrapix
Copy link
Author

scrapix commented Mar 3, 2021

I've double-checked the svg in Adobe illustrator and in Atom. There seems to be no additional object withing the SVG. Also interesting is, that all circles are copies of one object. So it's unclear why some get a fill, while others not. :-O

@tancredi
Copy link
Owner

tancredi commented Mar 3, 2021

Yes, decision-tree5 looks fine and should work - in facts, I tested it in an icon set and it renders correctly post-generation for me.

Screenshot 2021-03-03 at 10 08 04

@tancredi
Copy link
Owner

tancredi commented Mar 3, 2021

Really strange - are you sure it's the same exact version of the SVG that was used for that reported test?

@scrapix
Copy link
Author

scrapix commented Mar 3, 2021

Super strange indeed! Super sure, that I'm using the same SVG.

So here is my terminal:
image

Here is the whole directory with the source Icons + generated font:
icons-test.zip

Note
I've created (from scratch) the same Icon, with the same steps in Adobe Illustrator
--> Adobe Illustrator SVG: Work perfectly
--> Figma SVG: not working

Result
image

@stupidkitty
Copy link

Same on ubuntu 20.04

@samschooler
Copy link

I've had this issue with similar icons. The icons look correct on macOS Catalina, however are filled on macOS Big Sur.

@rhenriquez28
Copy link

I'm having the exact same issue

@giovanni-bertoncelli
Copy link

giovanni-bertoncelli commented May 5, 2021

Same identical issue on Catalina... is there any workaround on this?
Maybe it is related to this: nfroidure/svgicons2svgfont#62

@miguelsolorio
Copy link

miguelsolorio commented Sep 2, 2021

I've been encountering this issue for a number of years, even in the previous icon-font-generator version, and I believe it does come down to how Figma is exporting SVGs. A simple square with outline strokes:

CleanShot 2021-09-02 at 11 52 16@2x

Generates this SVG code in Figma:

<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 2H2V14H14V2ZM1 1V15H15V1H1Z" fill="white"/>
</svg>

While the same icon in Illustrator is exported as:

<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14 2V14H2V2H14ZM15 1H1V15H15V1Z" fill="white"/>
</svg>

The main difference is that Figma is using fill-rule="evenodd" and Illustrator does not and composes the path differently:

Figma

<path d="M14 2H2V14H14V2ZM1 1V15H15V1H1Z" />

Illustrator

<path d="M14 2V14H2V2H14ZM15 1H1V15H15V1Z" />

I filled this on the Figma forum in case anyone wants to upvote

@uyarn
Copy link

uyarn commented Oct 11, 2021

same issue with figma export + fill-rule="evenodd"

@miguelsolorio
Copy link

I learned that there is a "Fill Rule Editor" Figma plugin that allows you to toggle the fill rules and properly export svgs to be used with font tools like fantasticon. I've been using this as an alternative and it's working well.

@receptiryaki
Copy link

Fill Rule Editor has not worked for me. But I've re-created the icon in Vectornator software on MacOS. It exported without any issue now.

@vdcrea
Copy link

vdcrea commented Jun 19, 2023

This package works like a charm https://www.npmjs.com/package/svg-reorient and fixed my output. After running it against the files all clip-rule="evenodd" are removed and the font is perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants