Automate font&selection.json generation from svgs

35 views
Skip to first unread message

linesh....@gmail.com

unread,
Apr 19, 2018, 2:37:26 AM4/19/18
to IcoMoon
Hi there,

I find that introducing a new IcoMoon icon to our React Native project follows couple of steps that're pretty much the same each time(and possibly for other RN projects) like below, and I'm now wondering if there's a command line tool or something else to help automate these:

1. find the name of the icon you want to import
2. click the 'Generate Font' button in IcoMoon app to download a svg format icon
3. copy that svg file to the folder where all svgs of our project lie(resources/svgs in our case)
4. click the 'Import Icons' button and select all svgs in step 3
5. select all imported icons
6. click the 'Generate SVG & More' button to download a list of font files and the `selection.json` generated by IcoMoon
7. copy the `font/` folder and the `selection.json` back to our project

Instead, I would be very happy if I can do that in just one or two line(s) of code like this(or something similar)...

```bash
icomoon generate chervon-right chervon-down
cp generated resources/
```

or

```bash
npm run icomoon chervon-right chervon-down
```

... and the command will do all the heavy-lifting work for you(generate svg from icon name, re-generate ttfs & selection.json from all svgs and copy the generated selection.json and ttfs back to where they are).

So I'm asking if such a command line tool exist and where to find them, or if it doesn't is it possible to accomplish the above idea. Let me know your thoughts, inputs, anything.

linesh....@gmail.com

unread,
May 10, 2018, 5:08:45 AM5/10/18
to IcoMoon
Hello, any updates on this one :)

Keyamoon

unread,
May 10, 2018, 5:33:18 AM5/10/18
to IcoMoon
As mentioned in other similar posts, IcoMoon does not provide CLI tools/APIs right now. Maybe in future.
Reply all
Reply to author
Forward
0 new messages