patrickhulce / fontmin-webpack

Minifies icon fonts to just the used glyphs.
MIT License
137 stars 19 forks source link

Font Awesome 6 Duotone glyphs not properly extracted #63

Open Moustachos opened 2 years ago

Moustachos commented 2 years ago

Hello Patrick,

Font Awesome Duotone icons are made up of 2 glyphs, 1 for ::before & 1 for ::after.

In V5, ::after code was the same as ::before prefixed with 10, example: https://fontawesome.com/v5/icons/spinner-third?s=duotone

In V6, ::after is a doubled ::before code, example: https://fontawesome.com/icons/spinner-third?s=duotone

::before glyph is still extracted properly, but ::after glyph is missing in output file.

Any idea on how to approach / fix this?

Thanks :)

Moustachos commented 2 years ago

@patrickhulce could you take a look at this one when you got some time?

Apparently they're using ligatures to handle Duotone glyphs since version 6.

patrickhulce commented 2 years ago

Ah shoot, thanks for the ping @Moustachos. Yeah we'd have to adjust our glyph set to handle this multi-glyph case. I don't really have the bandwidth to investigate a fix right now but if anyone is interested in contributing, this would be a great way to have an impact.

patrickhulce commented 2 years ago

The fix would probably look similar to the multi-byte unicode fix PR (https://github.com/patrickhulce/fontmin-webpack/commit/e0743ba8fe8af549d684122afdcd3b01f206ac55)

Moustachos commented 2 years ago

Thanks for the update :)

I tried to look into it myself but sadly I don't get how to work with ligatures.

So yeah, any help would be welcome 👍