-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Custom fonts won't load on tvOS apps - Unrecognized font family #18025
Comments
I have a custom font on tvOS, I remember running in some issues but finally made it work.
|
Overall, the solution posted by @psegalen is correct (and thank you for pointing me in the right direction). It was the second issue listed that was causing the problem (tvOS target using the correct info.plist file). For reference to those who also have this issue, it turns out that the react native system does not make the -tvOS and -tvOSTests folders from the ios/ directory appear in XCode. However, it does create these folders and assigns the tvOS targets to use the Info.plist files in these directories. This was quite confusing as I kept checking the standard folder Info.plist as applying to both targets. This does not change the "build setting" in XCode, however. It just results in the file being added to the "copy resources" section of the "build phases" section in XCode. To fix, you need to create groups matching the names of your -tvOS Targets. These folders already exist on the file system, but not in the XCode workspace: I created two "groups without folders" matching the ones from the file system that were not showing. Note: if you create folders it will fail due to name collisions. Then I dragged the Info.plist files from the file system to the new groups in the XCode workspace and assigned them to the correct targets. Now the Info.plist files for the tvOS targets can be properly edited and maintained through the XCode interface. So, I'm up and running. However, I'm not sure if it's appropriate to close the issue as this is actually a workaround. It seems to me that this issue and the react-native link function should properly handle tvOS targets. I'll try and fix it in the react-native code, but that may be out of my wheelhouse. Let me know if others think this should be closed due to a workaround being found. |
Did you test with a version of react-native that has the fix in PR #17231 ? |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment:
OS: macOS High Sierra 10.13.2
Node: 8.9.4
Yarn: Not Found
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: Not Found
Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.53.2 => 0.53.2
Steps to Reproduce
resources/fonts
(I used BioRhymeExpanded-Regular.ttf in this example - available at https://fonts.google.com/specimen/BioRhyme+Expandedreact-native link
Expected Behavior
We should see the "Welcome to React Native" heading rendered using the new font in both iOS and tvOS apps.
Actual Behavior
We get
Unrecognized font family 'BioRhymeExpanded-Regular'
when running tvOS (on either AppleTV 4k or AppleTV 4k at 1080p). iOS apps display the correct/expected output.Working iOS
Busted tvOS
Essentially, tvOS apps are not loading custom fonts. Additionally, noticed that font files did not have tvOS targets, but correcting this had no effect (even after clean, shutdown and restart of packager, and rebuild).
Reproducible Demo
https://gist.github.com/natestone/69b04c8725ef39893c3c5d1a7ca9f7f7
The text was updated successfully, but these errors were encountered: