-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Documentation on how to use FontAwesome pro Icon #232
Comments
So far, here are some steps that made me get a little further 1.) add the pro *.otf files to your project. 2.) add the following list of font files to your info.plist file as Key UIAppFonts:
3.) in your code, before using FontAwesome.swift the first time, call: Thats it. Try to get the icon "fa-camera" with regular style, which is located in the pro version. Looks fine on my side. I did not succeed to get all icons to work. E.g. fa-abacus is not showing up. Am I missing something in here? |
Hi all, got pro fonts working, except... lots of icons are missing in the Enum (eg repeat). Seems this file is auto generated. Trying to regenerate didn't work: error. Please help. Is there a way to regenerate this file on xcode build? |
I figured it out: remove the path: String line in the codegen.swift file (line 20) and it works. Simply use the newly generated FontAwesome enum in your project. |
@vjoomens Hi! I'm stuck on the same problem you had. How are you running the codegen file to regenerate the enum? The file isn't there when installing as a pod. Thanks! |
@mralexhay check my fork of this project (https://github.com/vjoomens/FontAwesome.swift). It's fully compatible with FA pro. |
@vjoomens amazing, this worked for me, thanks. The only problem I haven't been able to sort is that using the Duotone style throws an error (despite the OTF being stored next to the others and being listed in the Info plist) but the rest work perfectly. |
To implement FA Pro support, follow the instructions from @pgrundner. To get all FA Pro icons, you need to hack a bit by following this: #230 (comment). |
Alright, I've followed the steps listed here and here, but I guess I've done something wrong.
Maybe you guys can help me catch my mistake. I've added the Pro otf files to the project. The otf files are added to the app target. I've set I added the following to my info.plist under the <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<string>Font Awesome 5 Brands-Regular-400.otf</string>
<string>Font Awesome 5 Pro-Light-300.otf</string>
<string>Font Awesome 5 Pro-Regular-400.otf</string>
<string>Font Awesome 5 Pro-Solid-900.otf</string>
</array>
</plist> It seems like the file path for my new files is incorrect. Any ideas? |
@austintt It would help troubleshooting if you can catch the value of A potential cause for your crash could be that even though duotone rendering is not support, you might have to add all the font file nevertheless:
|
@ghowen, thanks for the suggestion! I moved some stuff around and got a little more detail with the following error from This happens with the first call in my app to FontAwesome, requesting a light styled icon. Placing a breakpoint in Here's the full error:
|
@austintt When you added the font files to the project, did you check the "Copy if needed" option? Also make sure that the all font files have the correct target membership. You can check this in the File Inspector when you click on the font files in your project. My current guess is that in your case the font files do not have a target membership. |
@ghowen Did you ever find a solution to that unexpected nil error? Mine has started doing it and I haven't been able to find the answer yet. Thanks. |
@mralexhay You should probably check with @austintt if #232 (comment) did the trick for him. My bet is still that the fonts were not added to the target of the app. |
My personal recommendation, and how I prefer to do it, is to use the FontBlaster library instead. Make sure the first line in Also ensure that all of the fonts appear in Xcode, and you have added them to the |
@ghowen no dice, I had checked to make sure everything was a part of the correct target and copied to the app, everything was as good. For now, I'm just using the free fonts while I focus on other parts of my project. I'll try adding the Pro fonts again later. Thank you for the help though! |
Would it be possible to offer an example of how to use this library with FontAwesome pro icons
The text was updated successfully, but these errors were encountered: