FortAwesome / font-awesome-sass

Font-Awesome Sass gem for use in Ruby/Rails projects
MIT License
906 stars 265 forks source link

Font Awesome Pro #146

Open miguelpeniche opened 6 years ago

miguelpeniche commented 6 years ago

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

themilkman commented 6 years ago

Same here :) Thanks for any advice.

sunnyrjuneja commented 6 years ago

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 hello@fontawesome.com to show demand and explain the benefits.

hirokihokari commented 5 years ago

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 commented 5 years ago

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

scarroll32 commented 5 years ago

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?

supercodepoet commented 5 years ago

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?

sunnyrjuneja commented 5 years ago

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

sunnyrjuneja commented 5 years ago

Also, to answer your question, yes.

miguelpeniche commented 5 years ago

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.

ghost commented 5 years ago

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. 😕

dan commented 4 years ago

Has anyone determined how to do what hirokihokari suggested?

hirokihokari commented 4 years ago

@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.

dan commented 4 years ago

@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 commented 4 years ago

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

VinylVault commented 4 years ago

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

dan commented 4 years ago

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

jessedoyle commented 4 years ago

@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?

SaimonL commented 4 years ago

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.

MrHubble commented 2 years ago

@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