font-awesome-sass icon indicating copy to clipboard operation
font-awesome-sass copied to clipboard

Font Awesome Pro

Open miguelpeniche opened this issue 6 years ago • 19 comments

More than an issue, i want to know how to use our FontAwesome Pro account with this gem.

miguelpeniche avatar Feb 13 '18 00:02 miguelpeniche

Same here :) Thanks for any advice.

themilkman avatar Feb 28 '18 08:02 themilkman

Right now our focus is on supporting JavaScript packages and bundlers like webpack and rollup. We might eventually make Rails-specific integrations for our SVG with JS but we'll have to see what the demand is and what benefit it might provide.

https://github.com/FortAwesome/Font-Awesome/issues/12596#issuecomment-373490415

Not sure if this is coming folks. I guess email [email protected] to show demand and explain the benefits.

sunnyrjuneja avatar Mar 15 '18 22:03 sunnyrjuneja

You can just use pro icons if you have pro package installed in your load paths. Even the helpers, which just translates to content_tag, work with pro icons.

hirokihokari avatar Nov 16 '18 06:11 hirokihokari

I'm not saying it's okay this way, but you can work around it while the team's focus is somewhere else.

hirokihokari avatar Nov 16 '18 06:11 hirokihokari

I'm also frustrated with Font Awesome's position on this, and have purchased the pro version. I think a workaround would be to fork the gem to a private repo and then copy in the pro fonts.

Does anyone have specific instructions on how to do this?

scarroll32 avatar Dec 15 '18 09:12 scarroll32

I am currently looking into how to create a private gem repo because Pro is commercial software. You can use Font Awesome Pro with webpacker for the different NPM packages we have for using Pro in different frameworks. The @fortawesome/fontawesome-pro package has the SASS and webfonts needed. Is the need for a gem to have this be used with the asset pipeline?

supercodepoet avatar Dec 19 '18 15:12 supercodepoet

@supercodepoet I'm also interested in the ruby function helpers but @hirokihokari mentioned that we could have done it with the free version.

sunnyrjuneja avatar Dec 19 '18 18:12 sunnyrjuneja

Also, to answer your question, yes.

sunnyrjuneja avatar Dec 19 '18 18:12 sunnyrjuneja

As a suggestion, users who have Font Awesome Pro accounts may have an api key and set it in an initializer. This is the way every commercial product works.

miguelpeniche avatar Jan 25 '19 22:01 miguelpeniche

In my case, I need SVG pro icons so I had to download Font Awesome and import the all.min.js file in my vendors. But I have to remove the gem to prevent duplicate loading of free icons. 😕

ghost avatar Jan 30 '19 10:01 ghost

Has anyone determined how to do what hirokihokari suggested?

dan avatar Jul 27 '19 18:07 dan

@dan

If you look into the source code, it ends up to L.6 of https://github.com/FortAwesome/font-awesome-sass/blob/8f5c2f742b6d8bc25a3b3db4ff2287f2b0332fe8/assets/stylesheets/font-awesome/_variables.scss

$fa-font-path: if($fa-sass-asset-helper, "font-awesome", "../fonts/font-awesome") !default;

Basically it says "if there's helper(font-url() for Rails for example), then use it with "font-awesome" string argument, by which font-url() will generate "fonts/font-awesome" by default; otherwise "../fonts/font-awesome", which is I guess the content that comes with the gem.

So if you put the downloaded Pro content in there, that is assets/fonts/font-awesome, then the gem will take it (at least with default Rails load order? with app/assets over lib/assets etc) and use it.

That's my understanding and experience.

hirokihokari avatar Jul 27 '19 19:07 hirokihokari

@hirokihokari Fantastic, thank you! Do I put the entire directory structure there (all sub-folders such as webfonts, svgs, sprites, scss, etc. or just one of them?

(I ask because I've tried it both ways, adding it to assets.rb, with no luck).

Thanks again.

dan avatar Jul 29 '19 15:07 dan

Still trying to get this 3 days later. Any tips?

dan avatar Aug 01 '19 20:08 dan

personally i use https://github.com/tomkra/font_awesome5_rails which has support for pro

VinylVault avatar Aug 03 '19 02:08 VinylVault

Thanks, @VinylVault, I might have to unless @hirokihokari replies to me, as his suggestion doesn't work.

dan avatar Aug 09 '19 18:08 dan

@supercodepoet - I noticed that this gem doesn't contain the pro icon unicode mappings (eg fa-tire).

Even if we override the default font files provided by the gem, pro-only icons are inaccessible because the unicode mapping is not defined.

What do you think about providing mappings for all icons (including pro), but leaving it up to the user to provide their own pro webfont files to the asset pipeline?

jessedoyle avatar Sep 05 '19 19:09 jessedoyle

I created a readme that explains how you can use font awesome pro using this gem. In involves you to make some changes. So far it is working for me.

https://github.com/SaimonL/font-awesome-sass/blob/master/README.md Scroll all the way down.

SaimonL avatar Oct 15 '19 01:10 SaimonL

@SaimonL is your approach still working for you? As your approach involves manually downloading every new version, it seems using a package manager may be the easier path where possible.

Here are your steps I am referring to:

Screen Shot 2021-07-08 at 10 10 25 am

And here is some info regarding using a package manager from the official docs:

Screen Shot 2021-07-08 at 10 12 55 am

MrHubble avatar Jul 08 '21 00:07 MrHubble