I have used to 'chalet' fonts in react-native app. This font doesn't work in 'iOS build', but it works fine in Android build. I have tried with other fonts , but it's works fine in both the builds iOS and android.
Can you please check this link for Font-family .ttf files.
If you guys found any solution, please help me !!
Usually font name is different for iOS and android,
Please follow below link to know the name of font for iOS,
https://medium.com/react-native-training/adding-custom-fonts-to-react-native-b266b41bff7f
and apply font according to platform name
Related
I am using Noto Serif Medium font. Everything works as it should, when I launch the app with a fresh start.
The issue happens when I background the app and open anything that has not been rendered yet.
The classic "Unrecognised font family" error appears.
This error happens on iOS emulator and iOS physical devices.
I have checked targets, resources and Info.plist file in Xcode. Everything is there. Still this error happens.
I suspect that there could be an issue with the .ttf file itself, as you're not able to get this font from Google Fonts directly, even though it is a free to use font.
Is there anyone that can provide a lead to a solution?
This one was a dozzie.
Turns out, that it shouldn't have been working in a first place. It was a classical iOS font name issue. I don't know why it was working when the app wasn't backgrounded, but hey atleast the problem is solved.
Just use the PostScript name, not the real name tag in iOS fontbook.
I am using native-base library in react native. I have done following steps to change font but it does not work:
I pasted myfont.ttf in this directory:
node_modules/native-base/Fonts
I went to the following directory:
node_modules/native-base/src/theme/variables/...
and changed all font families into myFont.ttf in all three files (commonColor.js, material.js and platform.js)
Please help me in this issue.
You have to first eject NativeBase's theme, you can do that by
following the docs
here.
Then, add font to Android and iOS respectively, this
article
shows a good guide on how to do that.
Lastly, you can update the theme with your custom font on ./native-base-theme/variables/<theme-you-use>.js, also describe on the same docs above
I followed this tutorial: https://medium.com/#gattermeier/custom-fonts-in-react-native-for-android-b8a331a7d2a7#.aw559w53u
My font is located here: android/app/src/main/assets/fonts
And it's lowercase: 04b03.ttf
But it doesn't work, why ?
SOLVED:
I followed this tutorial too: https://blog.bam.tech/developper-news/add-a-custom-font-to-your-react-native-app
Then I deleted and then I rebuild the app
Got a font problem on iOS8 SDK in Xcode6.
Custom fonts are not working for UILabel's in Attributed text mode.
For all other UILabel's in Plain Text mode fonts are working.
When I'm building with iOS7 SDK everything working just fine.
(I'm setting fonts in storyboard, moarfonts not active, have been using moarfonts in before)
Thanks!
This problem is perhaps caused by bugs in XCode6 beta version.
Try to run your project in XCode5, but using iOS 8 SDK.
How can I know "Helvetica Neue Lt Std" font is installed in my ipad 7.1 simulator. If it is not installed , how can i install it?
use this code and see console while debug you will get all the font family which is there in your ipad
NSLog(#"%#",[UIFont fontNamesForFamilyName:#"Helvetica LT"]);
if font is not there then you add font name in your plist file like displayed in attached screenshot and add font in your projects resource Directory
You can not install custom front to iOS device or simulator. Please correct me if I am wrong.
But you can use custom fonts in your app.