-
Notifications
You must be signed in to change notification settings - Fork 246
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
Flutter Font Awesome Kit - Adding Custom Svgs #245
Comments
Also, the custom-icons.ttf contains 2 of the 61 custom icons. So 59 are missing from that file. None of the custom icons are in the icons.json file so all 61 custom icons are missing from that file. In addition, this is on a pro account. Any help would be greatly appreciated. |
Had the same issue, found a good guide here converting the svg to a font and then using the standard Icon class to display it. |
I took the suggestion to utilize FlutterIcon.com for the files. I was able to get a ttf file that shows all the custom icons created. I also have the dart file. Added both of them to the application along with a pub spec reference to the icons. When running the app, the icons don't render properly. Web all render with 6 bars instead of the icon. Inspecting the ttf file shows the proper icons. I did flutter clean. Also, verified that the pub spec file has uses-material-design set to true. Wrapped with both Icon and FaIcon and both have same render result. Attempted running it in both debug and release mode and same result. Any additional ideas? Below is a screenshot. I can target the size and color. The default icon shows as black. In Chrome, it shows as this. In mobile, it shows as this. So it doesn't render properly in both web and mobile. |
I've been able to resolve the issue. Thank you for your assistance. The final key of the puzzle for the FlutterIcon.com process is updating the dart file. The file has a _kFontPkg optional property set to null. This needed to be updated with the package name inside the project. |
We have the same problem, we have a kit with some custom icons. The custom icons ttf contains all custom icons, but the icons.json does not, neither does the generator add the custom Icons as constants to the FlutterFontAwesome class. Adding custom icons support should be pretty easy, the only problem is, that the icons are not listed in the icons.json, so the ttf has to be parsed to get the list of available icons and their codepoints. If FontAwesome would add the custom icons to the icons.json with style custom when they create the kit zip File on the website, we just need to add the custom-icons.ttf to the pubspec.yaml, add a new IconData Class (IconDataCustom) to icon_data.dart referencing the custom font and add all Icons (except the font-awesome Icon) as a const to the FlutterFontAwesome class. |
I was surprised that this wasn't handled in the kit zip file and the icons.json. Further surprising was that the documentation failed to address custom icons while at the same time the kit was advertised/marketed to be able to do this exact functionality. I agree that it should be easy for FontAwesome to address it, as well as updating their documentation. Fortunately, we were able to find a work around even though it added additional manual steps and will be somewhat cumbersome to maintain with update. |
I also ran into this issue and used the workaround outlined here. FYI: I contacted FontAwesome about the icons missing from icons.json and their support folk said it is a known bug when you have auto-subsetting enabled and is being tracked. They claim that if you use custom subsetting the custom icons will be properly included, but since that requires you to know and manually select all icons you want to use in the kit, that isn't super convenient - the workaround outlined above seems better. |
Having problems loading custom svgs from downloaded kit and not finding documentation for adding to Flutter that addresses specifically the custom svgs.
When I look at the kit files, the icons.json does not contain the custom svgs. I can find the custom svgs under svgs/custom-icons. There is also a js/custom-icons.js file. I attempted to create a new directory and copy the custom svgs into the directory.
font_awesome_flutter
lib
custom_icons
fonts
Unclear what files need to be copied to the project from the kit, what directories to create, and what scripts to run to get the custom svgs to show up. Also, don't know how to reference the custom svgs once they are added. Normal icons are referenced by "FontAwesomeIcons.xxx".
Can you provide some guidance?
Thank you.
The text was updated successfully, but these errors were encountered: