I figured out how to use your own icons and add it to Font Awesome for use in these various stacks.
-
Icon must be in SVG format. Use Illustrator, or similar to create the SVG.
-
Download font awesome from fontawesome.com and follow the directions for installing it to your own server. It’s really as simple as dragging the fontawesome-all.js file to a place on your server and then adding one line in your section to call up the file. It’s in the Getting Started section.
-
Go to IcoMoon at https://icomoon.io
From here you can see if someone else has an icon you can use or import your custom icon into the web app. Download the Font.
-
Find the downloaded icomoon.zip file and extract it. Open the icomoon selection.json file and the fontawesome-all.js file you uploaded to your server.
-
You now want to copy some data for the icon you want to load into font awesome (the fontawesome-all.js file) from the selection.json file.
-
Scroll down in the fontawesome-all.js file until you get to “var icons = {” on line 116. Below this you will see the code for all of the font awesome icons. Each new icon starts with it’s name followed by dimensions, an ID (I think), and the code for the shape that starts with “M”.
-
Duplicate one of these icons and start replacing the data with that found in the selection.json file you previously opened.
For example, I wanted to add two icons of a plane landing and taking off. Here is the code I put in for “aircraft-take-off”.
"aircraft-take-off": [1100, 700, [], "f900", "M1017.344 330.394c6.093 13.158 6.502 66.048-250.061 186.47l-251.546 118.067c-87.552 41.114-214.579 95.181-270.592 110.131-39.219 10.445-76.646-16.179-76.646-16.179s-112.947-101.12-142.95-123.853c-29.952-22.733-27.392-34.304 11.008-46.592 23.91-7.629 160.256 25.242 218.368 39.936 68.557-40.96 131.174-76.083 160.819-92.058-71.475-52.89-205.21-151.654-247.859-181.76-40.909-28.928 0.512-39.322 0.512-39.322 18.842-5.069 59.494-11.674 79.974-7.373 139.315 29.133 371.866 106.035 389.683 111.923 42.598-22.323 108.954-55.91 149.606-75.008 106.24-49.869 221.542-1.894 229.683 15.616z"],
and here is the code I copied from in selection.js
"icon": {
"paths": [
"M1017.344 330.394c6.093 13.158 6.502 66.048-250.061 186.47l-251.546 118.067c-87.552 41.114-214.579 95.181-270.592 110.131-39.219 10.445-76.646-16.179-76.646-16.179s-112.947-101.12-142.95-123.853c-29.952-22.733-27.392-34.304 11.008-46.592 23.91-7.629 160.256 25.242 218.368 39.936 68.557-40.96 131.174-76.083 160.819-92.058-71.475-52.89-205.21-151.654-247.859-181.76-40.909-28.928 0.512-39.322 0.512-39.322 18.842-5.069 59.494-11.674 79.974-7.373 139.315 29.133 371.866 106.035 389.683 111.923 42.598-22.323 108.954-55.91 149.606-75.008 106.24-49.869 221.542-1.894 229.683 15.616z"
],
"attrs": [
{}
],
"isMulticolor": false,
"isMulticolor2": false,
"tags": [
"aircraft-take-off"
========
I hope this helps some of you who may have that custom icon you would like to control within font awesome. One thing I forgot to mention is that the first two numbers specify the dimensions of the space that the icon will take up without changing the aspect ratio of the icon itself, i.e., it appears padding is added around the icon based on the numbers used. Also, it seems that the smaller the numbers, the larger the icon. Maybe somebody understands how that works. Anyway, I just played around with the numbers until it looked good on my site.
As for the ID, I don’t understand the naming convention for it except it looks like they are all 4 digits and start with the letter f. I just made up my own number where you can see I assigned an ID of f900.
Well, that’s all I have on this. If you have any questions I’ll try to answer them but I just learned this myself.
Mike
Edit: I almost forgot add that the code I used to generate the icon is as follows:
<i class="fas fa-aircraft-take-off" data-fa-transform="up-4"></i>
<i>
is the tag
data-fa-transform takes the icon and shifts it up by 4/16em. It was a bit low so you can actually nudge it around. There are instructions for that on fontawesome.com