How to automate icon font generation with fontello🔗
Fontello is an icon fonts generator that allow you to select icons from several icon providers like Fonticon or Fontawesome and generate a unique icon font with your selection.
You can create and download your font from the Fontello website but it's not very easy to update your font once downloaded.
Fontello provides an API that allows you to upload your font config and download the updated font.
Makefile🔗
Put the following code in your Makefile:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
Update FONT_DIR
with the path where you want to store the Fontello webfont.
Create the font🔗
First go to http://fontello.com and create your font by selecting icons.
Then download the config file by clicking on the "Download webfont > Get config only" button.
Put the downloaded json file into the FONT_DIR
you configured in the Makefile.
Install the font🔗
Use the make font-install
command to download the font in your project.
Then import the fontello.css
file into your sass code.
1 |
|
Build your assets and you will be able to use icons in your html:
1 |
|
Update the font🔗
Use the make font-push
command to send your config and start a Fontello session. You will get an url. Visit that url and update the font with the Fontello website.
Once the font is updated, press the "Save session" button.
Then use the make font-pull
to update the font files in your project.
Customize the font🔗
You can customize some parameters in the font config.json
file like the class prefix or the font name:
1 2 3 4 5 6 7 8 9 10 |
|
And change each icon names with the css
property:
1 2 3 4 5 6 7 8 9 10 |
|
You can also do this from the Fontello website: