Skip to content
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

Feature/gradle font sync #23869

Closed
wants to merge 2 commits into from

Conversation

punksta
Copy link

@punksta punksta commented Mar 12, 2019

Summary

react-native-community/discussions-and-proposals#89

Changelog

[Android] [Changed] - added fonts linking in build time.

Test Plan

  1. add some fonts in ./assets/fonts
  2. build android apk gradlew assembleDebug
  3. find fonts in apk(you can unzip it or use android studio apk previewer)
    image

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 12, 2019
@dulmandakh
Copy link
Contributor

dulmandakh commented Mar 13, 2019

here is my PR to land downloadable fonts support #23865. I think that RN might deprecate assets fonts support in the future.

@punksta
Copy link
Author

punksta commented Mar 13, 2019

@dulmandakh I think it's good alternative, but not replacement.

@dulmandakh
Copy link
Contributor

@punksta why not replace asset fonts?

@punksta
Copy link
Author

punksta commented Mar 13, 2019

@dulmandakh
About downloadable fonts: I think we will always need ability to bundle fonts in app. First of all it's easy and doesn't require internet connection and handling "certs". So this can't replace fonts bundling.

About fonts-in-xml I just don't see enough reasons of using that in react-native now. RN is not using native xml layouts so it's so important from where to load font file (asset or resource).
The only reasons I can find are:

  • android resource system (for example different fonts in different system languages or screen sizes)
  • supporting recent android standards.

maybe if you write motivation of pull request it would be more clear.

@dulmandakh
Copy link
Contributor

You can use fonts from res/font folder or custom font family defined in xml resource. Even you can ask to download files from the Internet to reduce APK size. But also you can use other font weights than normal and bold, like medium.

I should've added more summary to the PR, and will update it soon.

@cpojer
Copy link
Contributor

cpojer commented Mar 15, 2019

Closing because of @dulmandakh's PR.

@cpojer cpojer closed this Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants