home-assistant / Iconic

:art: Auto-generated icon font library for iOS, watchOS and tvOS
Apache License 2.0
1.58k stars 86 forks source link

how to generate multiple fonts? #23

Closed connectdotz closed 7 years ago

connectdotz commented 7 years ago

looks like we can only generate one font at a time because the source directory is override everytime. Wondering if the iconizer.sh can take a font directory (FONT_DIR) environment variable, in addition to the FONT_PATH, to generate for all the *.ttf files found in the directory?

dzenbot commented 7 years ago

The initial design allowed this but I very recently simplified it. See my answer in https://github.com/dzenbot/Iconic/issues/24#issuecomment-233477611

Why would you use multiple fonts? Can you describe your use case plz?

connectdotz commented 7 years ago

Why would you use multiple fonts?

Because each icon font is different, some icons only available in certain fonts, not to mention the style difference... That's why there are many font packages out there.

Can you describe your use case plz?

our project currently uses 3 icon fonts simply because they are in 3 different font packages.

dzenbot commented 7 years ago

Makes sense. Will then consider adding support for multiple fonts again.

dzenbot commented 7 years ago

FONT_DIR could be interesting indeed

connectdotz commented 7 years ago

I really liked the enum approach you took and curious about SwiftGen, so forked your repo and played around over the weekend. Added the multi-fonts support and refactor the Iconic class to make it more swifty by moving most of the logic to a swift protocol so each icon font enum can be simplified, self-contained, cleaner and more swift-3 compliant. However the Iconic class is still around mainly to host the generated wrapper functions for objective-c compatibility (since they can't access enum extension and protocol).

If you are open for contribution, I can submit a PR

dzenbot commented 7 years ago

I would love to see what you've achieved!

dzenbot commented 7 years ago

Closing this for now. Will def. consider it for the future.