-
Notifications
You must be signed in to change notification settings - Fork 171
Open
Labels
Description
I'm trying to Apply a custom font for Android iOS and it's working perfectly in Android but not in iOS. I have font files in the Xcode project inside the Resources folder and also exist in the Copy Bundle Resources. Please correct me where I'm making a mistake or is it a library bug?
const fontUrl = Platform.select({
ios: 'Raleway-Regular.ttf',
android: 'file:///android_asset/fonts/Raleway-Regular.ttf',
});
export const fontCss = @font-face { font-family: 'Raleway-Regular'; src: url('${fontUrl}') format('truetype'); } body { font-family: 'Raleway-Regular', sans-serif; font-size: 14px; font-weight: 100 };
<AutoHeightWebView
style={{ width: Dimensions.get('window').width - 40, marginBottom: 5, alignSelf: 'center' }}
source={{ html: this.props.item.description }}
originWhitelist={["https://*", "http://*", "file://*", "sms://*", "tel://*", "telprompt://*"]}
customStyle={fontCss}
scrollEnabled={false}
javaScriptEnabled={true} />