Skip to content

Conversation

@dyesseyumba
Copy link
Contributor

According to the documentation of react-native-vector-icons docs only FontAwesome, MaterialIcons and Octicons will be installed and used.

But if we launch the command react-native link, all react-native-vector-icons fonts will be installed even in ios. I think it is caused by the rnpm configuration in react-native-vector-icons library.

@chinesedfan
Copy link
Member

@dyesseyumba Thanks for your PR. Don't worry. I think I have found a way to solve the back problem. I will tidy my codes and send a PR tonight.

cc @machour @housseindjirdeh.

Copy link
Member

@machour machour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dyesseyumba and thank you for tackling this one.

As you said it: running react-native link will embed all TTFs anyways.

Therefore, we need to change our yarn run link script defined in package.json (line 17) to not simply run react-native link, but to name the libraries to be linked instead.

Here are the libraries that needs linking as of now:

  • react-native-code-push
  • react-native-config
  • react-native-cookies
  • react-native-device-info
  • react-native-i18n
  • react-native-photo-view
  • react-native-safari-view
  • react-native-search-bar

So I guess the new link script will look like this:
"link": "react-native link react-native-code-push && react-native link react-native-config && ....."

Once this is done, calling yarn run link won't try to link react-native-vector-icons anymore, and everything should work as intended (as long as someone doesn't directly use react-native link of course)

Could you change our link script and see how it goes? (this should also fix the same issue for #475)

Thanks a million!

// Name of the font files you want to copy
iconFontNames: [
'FontAwesome.ttf',
'MaterialIcons.ttf',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we're using MaterialIcons

@machour
Copy link
Member

machour commented Oct 19, 2017

@chinesedfan look like our comments collided :D

@dyesseyumba
Copy link
Contributor Author

I applied the changes. In scripts, the "link" line has more than 300 characters but it works.

@machour
Copy link
Member

machour commented Oct 19, 2017

@dyesseyumba Seems like @chinesedfan found a way better idea than mine, check #513

Copy link
Member

@chinesedfan chinesedfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dyesseyumba Thanks for your work! Please hold for a while until we reach an agreement.

package.json Outdated
"clean": "rm -rf node_modules",
"clean:android": "cd android && ./gradlew clean && cd -",
"link": "react-native link",
"link": "react-native link react-native-code-push && react-native link react-native-config && react-native link react-native-cookies && react-native link react-native-device-info && react-native link react-native-i18n && react-native link react-native-photo-view && react-native link react-native-safari-view && react-native link react-native-search-bar",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dyesseyumba If #513 works, please revert.

// Name of the font files you want to copy
iconFontNames: [
'FontAwesome.ttf',
'Octicons.ttf']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@machour The font material is required, because RNE use it as default values. I used to remove it, but got a crash in iOS simulator.

If we really do not want it, maybe another PR is required to set all icon type as octicon or something explicitly.

@chinesedfan
Copy link
Member

@dyesseyumba #513 has been merged. So you can just revert the second commit.

Would you mind to resolve those conflict in contributors files? Then I think we can merge this one and close #402.

@dyesseyumba
Copy link
Contributor Author

@chinesedfan All conflicts has been resolved.

@chinesedfan
Copy link
Member

@dyesseyumba Good. But package.json should not be modified, please check again.

@machour
Copy link
Member

machour commented Oct 21, 2017

I'm sorry @dyesseyumba, but I don't know what went wrong with your PR and the way you merged commits.
All in all, is this the only needed commit? fe8be54

@dyesseyumba
Copy link
Contributor Author

Yes @machour, is the only needed commit. To resolve the last conflict, I rebased the master branch in my local forked branch.

@machour
Copy link
Member

machour commented Oct 21, 2017

Thank you so much @dyesseyumba, that made the PR readable again.
Testing it now!

@machour
Copy link
Member

machour commented Oct 21, 2017

Works perfectly, after building Android we get only the 3 mentioned TTF bundled:

🍺  ~/git-point/android (master)*$ find . -name '*.ttf'
./app/build/intermediates/assets/debug/fonts/FontAwesome.ttf
./app/build/intermediates/assets/debug/fonts/MaterialIcons.ttf
./app/build/intermediates/assets/debug/fonts/Menlo.ttf
./app/build/intermediates/assets/debug/fonts/Nunito-Bold.ttf
./app/build/intermediates/assets/debug/fonts/Nunito-Italic.ttf
./app/build/intermediates/assets/debug/fonts/Nunito-Light.ttf
./app/build/intermediates/assets/debug/fonts/Nunito-Regular.ttf
./app/build/intermediates/assets/debug/fonts/Nunito-SemiBold.ttf
./app/build/intermediates/assets/debug/fonts/Octicons.ttf
./app/src/main/assets/fonts/Menlo.ttf
./app/src/main/assets/fonts/Nunito-Bold.ttf
./app/src/main/assets/fonts/Nunito-Italic.ttf
./app/src/main/assets/fonts/Nunito-Light.ttf
./app/src/main/assets/fonts/Nunito-Regular.ttf
./app/src/main/assets/fonts/Nunito-SemiBold.ttf

🎉

@machour machour merged commit d512505 into gitpoint:master Oct 21, 2017
@dyesseyumba dyesseyumba deleted the refactor_fonts branch October 21, 2017 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants