alexdrone / ios-fontawesome

NSString+FontAwesome
1.74k stars 256 forks source link

Font Awesome 3.1.1 icons #13

Closed wilg closed 11 years ago

JohnWickham commented 11 years ago

Or give instructions for doing this ourselves, I'll save you the trouble.

trivektor commented 11 years ago

+1 for the 3.1.1 icons request

codyhazelwood commented 11 years ago

For now, if you want to use icons from FontAwesome 3.1.1, here's how you can do it:

Go here: https://github.com/leberwurstsaft/FontAwesome-for-iOS, and download the "fixed" FontAwesome.ttf and add it to your project.

Now, in places in your code that look like this:

button.titleLabel.font = [UIFont fontWithName:kFontAwesomeFamilyName size:20];
[button setTitle:[NSString fontAwesomeIconStringForEnum:FAIconLink] forState:UIControlStateNormal];

Change them to this:

button.titleLabel.font = [UIFont fontWithName:kFontAwesomeFamilyName size:20];
[button setTitle:[NSString stringWithUTF8String:"\uF127"] forState:UIControlStateNormal];

Replace F127 with the Unicode character code for the new icon you want to use. You can find those codes here: http://fortawesome.github.io/Font-Awesome/icons/#new. Click the icon you want, and the code will be listed right beside it.

Note: you only have to use the Unicode character code for new icons. The old icons will still work the same.

I'll try to add support for 3.1.1 icons and submit a pull request. It may be a little while before I can get to it.