Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font Awesome Pro #146

Open
miguelpeniche opened this issue Feb 13, 2018 · 19 comments
Open

Font Awesome Pro #146

miguelpeniche opened this issue Feb 13, 2018 · 19 comments

Comments

@miguelpeniche
Copy link

miguelpeniche commented Feb 13, 2018

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

@themilkman
Copy link

Same here :) Thanks for any advice.

@sunnyrjuneja
Copy link

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.

FortAwesome/Font-Awesome#12596 (comment)

Not sure if this is coming folks. I guess email hello@fontawesome.com to show demand and explain the benefits.

@hirokihokari
Copy link

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
Copy link

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

@scarroll32
Copy link

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
Copy link
Member

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
Copy link

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

@sunnyrjuneja
Copy link

Also, to answer your question, yes.

@miguelpeniche
Copy link
Author

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
Copy link

ghost commented Jan 30, 2019

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
Copy link

dan commented Jul 27, 2019

Has anyone determined how to do what hirokihokari suggested?

@hirokihokari
Copy link

@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
Copy link

dan commented Jul 29, 2019

@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
Copy link

dan commented Aug 1, 2019

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

@VinylVault
Copy link

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

@dan
Copy link

dan commented Aug 9, 2019

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

@jessedoyle
Copy link

@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 pushed a commit to amaabca/ama_styles that referenced this issue Sep 5, 2019
* We are looking to use pro-only FontAwesome 5 icons in an
  upcoming feature. We have a perpetual enterprise license
  for FontAwesome Pro, but we are forbidden from distributing
  the webfont files to "non-creators" in the license.
* Uploading the webfont files to this open-source package
  is considered a breach of the pro license (according to
  fontawesome support), so we need to create conditions
  to "enable" the pro icon set specifically for our
  organization's use.
* Symlink in the pro fontawesome files into
  'vendor/assets/fonts/font-awesome` when the configuration
  value of `font_awesome_pro_source_path` is provided.
* Because the files are symlinked into the vendored asset
  directory, they override the free files provided by
  the `font-awesome-sass` gem [1] in the asset pipeline.
* The `font-awesome-sass` gem does not provide unicode
  mappings for the pro-only icons. If we wish to use
  them, we need to define the unicode mapping in
  the `font_awesome_pro.scss` file.

[1]: FortAwesome/font-awesome-sass#146 (comment)
SEE: https://dev.azure.com/AMA-Ent/AMA-Ent/_workitems/edit/2646
jessedoyle pushed a commit to amaabca/ama_styles that referenced this issue Sep 5, 2019
* We are looking to use pro-only FontAwesome 5 icons in an
  upcoming feature. We have a perpetual enterprise license
  for FontAwesome Pro, but we are forbidden from distributing
  the webfont files to "non-creators" in the license.
* Uploading the webfont files to this open-source package
  is considered a breach of the pro license (according to
  fontawesome support), so we need to create conditions
  to "enable" the pro icon set specifically for our
  organization's use.
* Symlink in the pro fontawesome files into
  'vendor/assets/fonts/font-awesome` when the configuration
  value of `font_awesome_pro_source_path` is provided.
* Because the files are symlinked into the vendored asset
  directory, they override the free files provided by
  the `font-awesome-sass` gem [1] in the asset pipeline.
* The `font-awesome-sass` gem does not provide unicode
  mappings for the pro-only icons. If we wish to use
  them, we need to define the unicode mapping in
  the `font_awesome_pro.scss` file.

[1]: FortAwesome/font-awesome-sass#146 (comment)
SEE: https://dev.azure.com/AMA-Ent/AMA-Ent/_workitems/edit/2646
jessedoyle pushed a commit to amaabca/ama_styles that referenced this issue Sep 5, 2019
* We are looking to use pro-only FontAwesome 5 icons in an
  upcoming feature. We have a perpetual enterprise license
  for FontAwesome Pro, but we are forbidden from distributing
  the webfont files to "non-creators" in the license.
* Uploading the webfont files to this open-source package
  is considered a breach of the pro license (according to
  fontawesome support), so we need to create conditions
  to "enable" the pro icon set specifically for our
  organization's use.
* Symlink in the pro fontawesome files into
  'vendor/assets/fonts/font-awesome` when the configuration
  value of `font_awesome_pro_source_path` is provided.
* Because the files are symlinked into the vendored asset
  directory, they override the free files provided by
  the `font-awesome-sass` gem [1] in the asset pipeline.
* The `font-awesome-sass` gem does not provide unicode
  mappings for the pro-only icons. If we wish to use
  them, we need to define the unicode mapping in
  the `font_awesome_pro.scss` file.

[1]: FortAwesome/font-awesome-sass#146 (comment)
SEE: https://dev.azure.com/AMA-Ent/AMA-Ent/_workitems/edit/2646
jessedoyle pushed a commit to amaabca/ama_styles that referenced this issue Sep 5, 2019
* We are looking to use pro-only FontAwesome 5 icons in an
  upcoming feature. We have a perpetual enterprise license
  for FontAwesome Pro, but we are forbidden from distributing
  the webfont files to "non-creators" in the license.
* Uploading the webfont files to this open-source package
  is considered a breach of the pro license (according to
  fontawesome support), so we need to create conditions
  to "enable" the pro icon set specifically for our
  organization's use.
* Symlink in the pro fontawesome files into
  'vendor/assets/fonts/font-awesome` when the configuration
  value of `font_awesome_pro_source_path` is provided.
* Because the files are symlinked into the vendored asset
  directory, they override the free files provided by
  the `font-awesome-sass` gem [1] in the asset pipeline.
* The `font-awesome-sass` gem does not provide unicode
  mappings for the pro-only icons. If we wish to use
  them, we need to define the unicode mapping in
  the `font_awesome_pro.scss` file.

[1]: FortAwesome/font-awesome-sass#146 (comment)
SEE: https://dev.azure.com/AMA-Ent/AMA-Ent/_workitems/edit/2646
jessedoyle pushed a commit to amaabca/ama_styles that referenced this issue Sep 5, 2019
* We are looking to use pro-only FontAwesome 5 icons in an
  upcoming feature. We have a perpetual enterprise license
  for FontAwesome Pro, but we are forbidden from distributing
  the webfont files to "non-creators" in the license.
* Uploading the webfont files to this open-source package
  is considered a breach of the pro license (according to
  fontawesome support), so we need to create conditions
  to "enable" the pro icon set specifically for our
  organization's use.
* Symlink in the pro fontawesome files into
  'vendor/assets/fonts/font-awesome` when the configuration
  value of `font_awesome_pro_source_path` is provided.
* Because the files are symlinked into the vendored asset
  directory, they override the free files provided by
  the `font-awesome-sass` gem [1] in the asset pipeline.
* The `font-awesome-sass` gem does not provide unicode
  mappings for the pro-only icons. If we wish to use
  them, we need to define the unicode mapping in
  the `font_awesome_pro.scss` file.

[1]: FortAwesome/font-awesome-sass#146 (comment)
SEE: https://dev.azure.com/AMA-Ent/AMA-Ent/_workitems/edit/2646
jessedoyle pushed a commit to amaabca/ama_styles that referenced this issue Sep 5, 2019
* We are looking to use pro-only FontAwesome 5 icons in an
  upcoming feature. We have a perpetual enterprise license
  for FontAwesome Pro, but we are forbidden from distributing
  the webfont files to "non-creators" in the license.
* Uploading the webfont files to this open-source package
  is considered a breach of the pro license (according to
  fontawesome support), so we need to create conditions
  to "enable" the pro icon set specifically for our
  organization's use.
* Symlink in the pro fontawesome files into
  'vendor/assets/fonts/font-awesome` when the configuration
  value of `font_awesome_pro_source_path` is provided.
* Because the files are symlinked into the vendored asset
  directory, they override the free files provided by
  the `font-awesome-sass` gem [1] in the asset pipeline.
* The `font-awesome-sass` gem does not provide unicode
  mappings for the pro-only icons. If we wish to use
  them, we need to define the unicode mapping in
  the `font_awesome_pro.scss` file.

[1]: FortAwesome/font-awesome-sass#146 (comment)
SEE: https://dev.azure.com/AMA-Ent/AMA-Ent/_workitems/edit/2646
@SaimonL
Copy link

SaimonL commented Oct 15, 2019

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
Copy link

MrHubble commented Jul 8, 2021

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests