-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add platform specific handling of font files #37
base: master
Are you sure you want to change the base?
Conversation
@@ -23,9 +23,10 @@ class Icon extends Component { | |||
} | |||
} | |||
|
|||
const fontFamily = Platform.OS === 'ios' ? 'FontAwesome' : 'fontawesome-webfont'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we have the same FontAwesome name in both ios and android?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does not seem to work since iOS uses the Font Name and Android uses the filenames. The pull requests amends this so that you can simply copy the files from the FontAwesome4.7.0 Zip. Even renaming does not work for Android as font names should be all lowercase.
I don't know if that is a recent change, but otherwise it won't work for my react native 0.55.4 projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense
Can we make the user pass this as a prop instead? Having the default as the old value? |
Of course it’s technically possible but isn’t it rather clunky and unwieldy?
I mean the user would have to manually use a Platform.select whenever he uses an icon. That would make the whole thing go from easy and simple to use to quite cumbersome - it’s not even like the user could use it as is if he wants to support Android with his app he’ll have to set the prop on every single use - and with a platform.select and both possible values. Furthermore the user has to be taught which values he has to input. At that point it’s easier to just roll your own icon component...
|
check if this helps #61 |
Makes webfonts work in iOS and Android besides having to use different names in 'CSS' style.