In React Native, I define font family for all text with Rubik font but for some devices (SAMSUNG & OPPO), the font looks like overwrite with a custom device font because that brand can choose a custom font for their device.
I don't know why sometimes some text looks like overwrite with custom device font & some text still uses the Rubik font.
Environment:
Packages:
Target Platform: Android
Any ideas on how to make a device font can't overwrite the set font family font?
In your package.json add the key
{
.
.
.
sideEffects:false,
.
.
.
}
In IOS, if you use just the fontFamily:"Rubik", the app automatically identifies the style based on fontStyle like Regualr/Italic/Bold etc.
But in android, sometimes you have to use the exact fontFamily like fontFamily:"Rubik-SemiBold", fontFamily:"Rubik-Regular".
It should resolve your issue.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.