jaywcjlove / svgtofont

Read a set of SVG icons and ouput a TTF/EOT/WOFF/WOFF2/SVG font.
https://jaywcjlove.github.io/svgtofont
MIT License
515 stars 81 forks source link

Support for react native functional components #217

Closed LucasBourgeois closed 6 months ago

LucasBourgeois commented 6 months ago

Hello maintainers.

Why this PR : Ive many SVG's in a directory, in React Native, assets are loaded at buildTime. So you must load all of them at the startup to be able to import them and add a babel transformer to make them as RN components. The real issue with that is that it's not possible to do dynamic imports. So a font is the main solution.

I did everything to not being dependent of an external React Native package. Ive tested this implementation on my own project with success.

It was a little bit challenging because of those particularities:

So here is a (among unknown others) implementation of your package for ReactNative.

I would love to see this merged after all your reviews. Im sure that it'll help many ppl.

Feel free to give me your feedback.

jaywcjlove commented 6 months ago

@LucasBourgeois Upgrade v4.1.0