entria / react-native-fontawesome

React Native Font Awesome Icons
MIT License
176 stars 34 forks source link

iOS Font names are incorrect in 6.0.0 package #47

Closed KalebMatthews closed 5 years ago

KalebMatthews commented 5 years ago

The font names are incorrect in the 6.0.0 package. The following should be renamed for iOS only.

fa_brands_400 -> FontAwesome5BrandsRegular fa_regular_400 -> FontAwesome5FreeRegular fa_solid_900 -> FontAwesome5FreeSolid

const IconTypes = {
  FAR: Platform.OS == 'ios' ? 'FontAwesome5FreeRegular' :'fa_regular_400',
  FAS: Platform.OS == 'ios' ? 'FontAwesome5FreeSolid' : 'fa_solid_900',
  FAB: Platform.OS == 'ios' ? 'FontAwesome5BrandsRegular' :'fa_brands_400'
}

Unless you use a font editor there is no way to change the name of the fonts in the .ttf this needs to be fixed on the .js level for convenient use.

KalebMatthews commented 5 years ago

If you need to use this package now and this fix is not out yet simple pass in the corrected names into the type prop for the FontAwesome component instead of the IconTypes constants.

<FontAwesome type={Platform.OS == 'ios' ? 'FontAwesome5FreeSolid' : 'fa_solid_900'}>
    {Icons.grinBeam}
</FontAwesome>

Hope this helps anyone who is running into this.

jgcmarins commented 5 years ago

done https://github.com/entria/react-native-fontawesome/pull/48