Add platform specific handling of font files#37
Open
noinfo wants to merge 1 commit intoentria:masterfrom
Open
Conversation
sibelius
reviewed
Jun 7, 2018
| } | ||
| } | ||
|
|
||
| const fontFamily = Platform.OS === 'ios' ? 'FontAwesome' : 'fontawesome-webfont'; |
Member
There was a problem hiding this comment.
can't we have the same FontAwesome name in both ios and android?
Author
There was a problem hiding this comment.
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.
Member
|
Can we make the user pass this as a prop instead? Having the default as the old value? |
Author
|
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...
|
Member
|
check if this helps #61 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes webfonts work in iOS and Android besides having to use different names in 'CSS' style.