entria / react-native-fontawesome

React Native Font Awesome Icons
MIT License
176 stars 34 forks source link

Fonts not working, showing box with cross or Chinese characters #59

Closed devWaleed closed 5 years ago

devWaleed commented 5 years ago

Fonts are either showing as a box with cross or some Chinese characters.

I have put my .ttf files in assets/fonts folder and run react-native link command.

vkachan commented 5 years ago

I have the same issue unfortunately.

bmcn99 commented 5 years ago

Same here, I am using a different custom font as well so I don't believe that part of it is done incorrectly. I am using "version": "6.0.1" and am invoking it with

{Icons.exclamationTriangle} including the imports at the top. EDIT: I'm not sure what got it working but I currently have `{Icons.exclamationTriangle}` and it is working. I had included type={IconTypes.FAR} at some point trying to get it working and kept it in for a little while, once removed it worked. I have the following .ttf files in my fonts folder. fa_brands_400 (these originally had hyphens but I changed them to _'s to match what was in the source code) fa_regular_400 fa_solid_900 Font Awesome 5 Brands-Regular-400 Font Awesome 5 Free-Regular-400 Font Awesome 5 Free-Solid-900 FontAwesome (The one I started with) I gotta move on with my project, but hopefully that helps someone else.
palashjhabak commented 5 years ago

@devWaleed were you able to get it working ?

vkachan commented 5 years ago

@bmcn99 thanks, I got it working after change hyphens to underscores in the file names

leandrosimoes commented 5 years ago

I open a PR with that solves the hyphens problem, allowing to use the original files with hyphens. https://github.com/entria/react-native-fontawesome/pull/61

In this PR has a working sample project to so you can see how to use properly, because there are some breaking changes on it.

leandrosimoes commented 5 years ago

A new version was released, please, check if in the new version this problem was fixed and feel free to reopen this issue if wasn't.

PS: REMEBER TO SEE THE NEW DOCUMENTATION BECAUSE THERE ARE SOME BREAKING CHANGES

King2231 commented 5 years ago

i am using the 7.0.0 version and i am still getting a box with cross.. i tried with parseiconname too but it shows error saying parseIconName is not a function...