Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font Family Issue #62

Open
AunMSheikh opened this issue Jun 21, 2017 · 5 comments
Open

Font Family Issue #62

AunMSheikh opened this issue Jun 21, 2017 · 5 comments

Comments

@AunMSheikh
Copy link

AunMSheikh commented Jun 21, 2017

I cannot seem to change the font family property of the button text here is what i have:

<Button onPress={() => this.validateUser()} style={styles.btnSignIn} containerStyle={styles.btnContainerSignIn}>SIGN IN</Button>

The styling is as follows:
btnContainerSignIn: { paddingTop: 12, paddingBottom: 12, marginLeft: -5, marginRight: -5, backgroundColor: '#386376', borderRadius: 3, }, btnSignIn:{ color: '#fff', fontFamily: 'Arimo', },

The font family is Arimo and it has been imported properly and seems to be working everywhere else except the button. Anyone know a way around this?

@KriYor
Copy link

KriYor commented Jun 30, 2017

Same problem

@haniotis
Copy link

Same

@udhay1415
Copy link

Hey, this is an issue with the react-native itself. When the font-weight is bold it automatically assigns the default font-family to the button text. So try making the fontWeight: '400'.

Solution:
fontWeight: '400',
fontFamily: 'Arimo'

@byteab
Copy link

byteab commented Jan 4, 2020

@udhay1415 it doesn't have any style property.
how can I add fontWeight

@maxueda
Copy link

maxueda commented Dec 9, 2020

@udhay1415 it doesn't have any style property.
how can I add fontWeight

I don't think you can. What you can actually do is to create your own button buttons via TouchableOpacity, like this:

https://blog.logrocket.com/creating-custom-buttons-in-react-native/

Follow the instructions from the link above. Then, you can have something like this:

const styles = StyleSheet.create({
// ...
appButtonContainer: {
elevation: 8,
backgroundColor: '#FF29A3',
borderRadius: 12,
paddingVertical: 20,
paddingHorizontal: 11
},
appButtonText: {
fontSize: 33,
fontFamily: 'Roboto',
color: '#fff',
fontWeight: 'bold',
alignSelf: 'center',
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants