Closed optimuspwnius closed 2 years ago
@optimuspwnius Hey there! Thanks for the report. Sorry it's taken so long to get back to you. This fell off my radar a bit.
You're absolutely right. Because the SVG element doesn't have a d
attribute, it's falling back to attempting to find a nested path
element and throwing an error when attempting to access hasAttribute
on that, which is undefined
. I'll take a look here and see if excluding items with no d
attribute would work, or if FontAwesome's CSS is relying on that somehow for rendering.
It does look like they are still referencing them, despite the paths being blank. I'll see what I can do about inserting an empty d=""
attribute on glyphs that do not have it, so we can still generate those fonts as expected.
Some duotone icons fail subsetting. For example:
Results in:
Looking at Line 99 in index.js
svgContentsNew for this svg outputs 2 glyphs, "sort-primary" and "sort-secondary". I believe svg2ttf fails on some duotone icons because one of the glyphs have no "d" attribute. Here's a sample of the output:
Edit: Removed some icon specific stuff, I shouldn't have pasted the full icon output here due to license restrictions.