-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Pro icon packs #4
Comments
It is currently not possible because of license. Icons are served from public API, there is no way to check who has and who doesn't have FontAwesome Pro license, so only free icon sets are available. Iconify API is where all visitors get icons from. Iconify script checks page to see what icons are there, then connects to API to retrieve those icons, then renders icons. There is option of hosting your own Iconify API. I wrote a tutorial here: https://iconify.design/docs/api-hosting/ So you can use that to host FontAwesome Pro icons. If you are interested in using custom API to host FontAwesome Pro icons, I can help. It requires writing short script to convert FontAwesome Pro icons to Iconify JSON format. Using Iconify with FontAwesome Pro is also part of my todo list for new documentation. |
Thanks for the quick answer! I'll take a look at the documentation and try to set it up first, before loading pro icons. |
If you host your own API that has access to the Pro icons, wouldn't it allow any other sites to use your API as well to access them? Unless maybe you do something like making your site pass a key to the client and API. The API can then whitelist this key and the client can pass the key to the API to get access. |
Yes, it would allow anyone to access icons. But its not any different from hosting FA Pro font files on your server. All other person needs to see is source code of page. For Iconify it is to get your custom Iconify API link, for font its to get link to css file. So its the same. |
That's a good point, didn't think of that. 😅 |
Thanks. |
@cyberalien I've set up a local PHP api, imported FontAwesome Pro Light icons with prefix |
My guess is something is wrong with json file. API hosting script is strict, to avoid possible errors it verifies that prefix in json file matches file name. So make sure prefix is set in json file like this:
|
This is what
|
That's correct content. PHP API caches data to serve icons faster, so next guess is cache needs to be purged. Delete all php files in directory "cache". |
If something else is wrong, this is my version of script for importing FontAwesome Pro. Create NPM project:
Create index.js:
Run these commands:
This code assumes you have access to FontAwesome Pro repository. If you don't, unpack zip file with FontAwesome Pro somewhere, change path for srcDir to directory "svgs" of archive. It will create files in directory "output". |
Thanks for the script and assisting me! I got it working when I cleared the .php files in the cache directory. I'm actually running into another problem when setting the correct API url:
It still requests |
If its in footer, DOM has loaded by then so Iconify starts working immediately. Try this instead:
|
Oh, I see problem. Its defaultAPI, not API. Doh. Bug in documentation! 'API' config is for specific prefixes, so script would access different servers for different prefixes. Setting to change for all prefixes is defaultAPI.
or
|
With
I've debugged the error and the following variable
Changing the This does not happen when I insert the script in the header. My icons load correctly in this situation. |
I've opened a PR #5 to fix the previous problem. :) |
Thanks a lot for noticing and fixing! Published version 1.0.2 with your fix. |
Thank you for merging the PR! I'm going to close this issue because we resolved all of the stuff I asked you about. |
Hey there!
Is it or will it be possible to use pro packs (specifically Font Awesome)?
I've got a pro license so I would like to use all available icons.
Thanks!
The text was updated successfully, but these errors were encountered: