Roboto Android/iOS:
Roboto - Android. Roboto iOS RRikesh, fontFamily Android:
import {
Platform,
StyleSheet,
} from 'react-native'
const stylesByPlatform = Platform.select({
ios: { fontFamily: 'Roboto' },
android: { },
})
export default StyleSheet.create({
text: {
...stylesByPlatform,
color: '#000000',
},
})
Setup
Setup iOS Roboto fontFamily:
- Roboto Google Fonts
./assets/fonts/Robotopackage.json:
{
...
"rnpm": {
"assets": [
"./assets/fonts"
]
}
}
: react-native link ( ttf iOS Android)
- Roboto,
android/app/src/main/assets/fonts - 🎉.
I really don't know why this type of content is not in the official docs. :(
source
share