rnn
rnn

Reputation: 2563

fontWeight doesnt work when using fontFamily in react native

I added Rubik-regular which is customFont to my folder :

const customFonts = {
  RubikRegular: require('./assets/fonts/Rubik-Regular.ttf'),
};

problem is that, if i use font like this :

               <Text style={{fontFamily: 'RubikRegular'}}>6453 </Text>

every this is fine. However, when i want to give fontWeight my text:

<Text style={{fontFamily: 'RubikRegular', fontWeight: 'bold'}}>6453 </Text>

fontWeight doesnt work. if i remove fontFamily then it works. what is the problem here i didnt understand

Upvotes: 0

Views: 344

Answers (1)

DinhNguyen
DinhNguyen

Reputation: 945

You add Rubik-regular font, it means you only add regular (400) weight of Rubik font.

If you want to use fontWeight: 'bold', you have to add Rubik-bold font

Upvotes: 1

Related Questions