Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Icon.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import { Text, StyleSheet } from 'react-native';
import { Platform, Text, StyleSheet } from 'react-native';

import Icons from './FontAwesomeIcons';

Expand All @@ -23,9 +23,10 @@ class Icon extends Component {
}
}

const fontFamily = Platform.OS === 'ios' ? 'FontAwesome' : 'fontawesome-webfont';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we have the same FontAwesome name in both ios and android?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That does not seem to work since iOS uses the Font Name and Android uses the filenames. The pull requests amends this so that you can simply copy the files from the FontAwesome4.7.0 Zip. Even renaming does not work for Android as font names should be all lowercase.

I don't know if that is a recent change, but otherwise it won't work for my react native 0.55.4 projects.

const styles = StyleSheet.create({
icon: {
fontFamily: 'FontAwesome',
fontFamily: fontFamily,
backgroundColor: 'transparent',
},
});
Expand Down