Including Font-Awesome in Electron Build


#1

Does anyone have experience including Font-Awesome in their electron build? It has been a bit cumbersome up to this point, so I’m wondering if there is an easier solution. I see that @lludol has done so in an atom build using

2) In your .less, load the font like this:

@font-face {
    font-family: 'TheNameOfYourFont';
    src: url(atom://name-of-your-plugin/resources/fontName.woff) format('woff');
}

3) Now you can use your font like this:

.element { font-family: "FontAwesome"; }

What is the best way to include Font-Awesome in an electron build?


#2

Using webpack to build your app, your would just need to use something like font-awesome-webpack and import 'font-awesome-webpack' in you main .js file.


#3

Thanks for the response, I’ll give this a go and update this weekend. I’m not yet familiar with webpack.


#4

It’s a pain to get started, but once you get it you don’t want to go back !