カスタム Web フォントを Android の react-native で動作させるのに苦労しています。
ここhttps://medium.com/@gattermeier/custom-fonts-in-react-native-for-android-b8a331a7d2a7#.w6aok6lpwの指示に従いましたが、成功しませんでした。
いくつかの異なるフォントで試してみましたが、まだ満足できません。
nbフォントファイルの名前を変更したり、ダッシュをアンダースコアに置き換えたり、すべて小文字にしたりしましたが、まだ成功しません。
どんな助けでも大歓迎です。これは私のコードです:
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
} from 'react-native';
class MyBeltingApp extends Component {
render() {
return (
<View>
<Text style={styles.welcome}>
Straigtline
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
welcome: {
fontFamily: 'GT-Walsheim-Bold',
fontSize: 20,
textAlign: 'center',
margin: 10,
},
});
AppRegistry.registerComponent('MyBeltingApp', () => MyBeltingApp);