danmarshall / google-font-to-svg-path

Create an SVG path from a Google font
https://danmarshall.github.io/google-font-to-svg-path
MIT License
754 stars 128 forks source link

"fill-rule: evenodd" causing holes in glyphs #30

Closed joliss closed 2 years ago

joliss commented 2 years ago

Selecting "Source Code Pro" and Variant 500, and setting Text to "4", there's a hole in the glyph where the strokes overlap:

4

At first blush, this seems to be because the <g> element has fill-rule="evenodd" set. Changing it to the default fill-rule="nonzero" fixes the issue:

4

P.S. Love this tool, thanks for creating it!

danmarshall commented 2 years ago

Thanks for pointing this out! It seems that some fonts have degenerate outlines, we should add a fill-rule checkbox.