{"id":2069,"url":"https://github.com/PrideChung/FontAwesomeKit","last_synced_at":"2025-08-02T23:31:20.181Z","repository":{"id":45514540,"uuid":"8239165","full_name":"PrideChung/FontAwesomeKit","owner":"PrideChung","description":"Icon font library for iOS. Currently supports Font-Awesome, Foundation icons, Zocial, and ionicons.","archived":false,"fork":false,"pushed_at":"2021-01-27T07:36:17.000Z","size":1746,"stargazers_count":2810,"open_issues_count":55,"forks_count":307,"subscribers_count":96,"default_branch":"master","last_synced_at":"2025-07-29T19:43:59.800Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PrideChung.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-16T17:44:05.000Z","updated_at":"2025-07-04T08:25:53.000Z","dependencies_parsed_at":"2022-09-01T22:11:13.720Z","dependency_job_id":null,"html_url":"https://github.com/PrideChung/FontAwesomeKit","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/PrideChung/FontAwesomeKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrideChung%2FFontAwesomeKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrideChung%2FFontAwesomeKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrideChung%2FFontAwesomeKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrideChung%2FFontAwesomeKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PrideChung","download_url":"https://codeload.github.com/PrideChung/FontAwesomeKit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrideChung%2FFontAwesomeKit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268378240,"owners_count":24240892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:16:02.715Z","updated_at":"2025-08-02T23:31:19.586Z","avatar_url":"https://github.com/PrideChung.png","language":"Objective-C","funding_links":[],"categories":["Text","Instructions: Let's play with a few CocoaPods","Why use icon fonts?","Objective-C","Testing","Objective-C  Stars 1000以内排名整理","Iconic fonts"],"sub_categories":["Font","Setup","Other free courses","Usage"],"readme":"FontAwesomeKit ![Cocoapods Version](https://img.shields.io/cocoapods/v/FontAwesomeKit.svg?style=flat) ![Platform](https://img.shields.io/cocoapods/p/FontAwesomeKit.svg?style=flat) ![License](https://img.shields.io/cocoapods/l/FontAwesomeKit.svg?style=flat) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n==============\nIcon font library for iOS. Currently supports Font-Awesome, Foundation icons, Zocial, and ionicons.\n\n## Version 2.2 Notable Changes\n### Not Just Awesome. New Icon Fonts Added\n\nCurrently FontAwesomeKit supports **6** different icon fonts.\n\n- [FontAwesome 4.7](http://fontawesome.io) Our old friend, contains **675** icons\n- [Foundation icons](http://zurb.com/playground/foundation-icon-fonts-3) Contains **283** icons.\n- [Zocial](http://zocial.smcllns.com/) Contains **99** social icons.\n- [ionicons 2.0.0](http://ionicons.com/) Contains **733** icons, lots of iOS 7 style outlined icons.\n- [Octicons 2.4.1](https://octicons.github.com/) Contains **206** icons, built with love by [Github](https://github.com/).\n- [Material 2.0.0](https://google.github.io/material-design-icons/) Contains **743** icons, built by Google for Material design.\n\n### API Reforged, Take Advantage of NSAttributedString\nThanks to `NSAttributedString` the API is more clean and object oriented. All hail `NSAttributedString`!\n\n### Notes on FontAwesome\nPlease notice that FontAwesome has renamed lots of it's icons in the recent 4.0 release, make sure to change you code accordingly if you're using FontAwesomeKit 2.1 version.\n\n## Installation\n### Requirements\n- Xcode 5\n- iOS 6.0 +\n- tvOS 9.0\n- ARC enabled\n- CoreText framework\n\n### Install with CocoaPods (Strongly Recommended)\nFontAwesomeKit now supports sub spec, only get the fonts you need.\n\nAdd `pod 'FontAwesomeKit', '~\u003e 2.2.0'` to Podfile to install all icon fonts.\n\nOr select icon fonts with:  \n\n`pod 'FontAwesomeKit/FontAwesome'`  \n`pod 'FontAwesomeKit/FoundationIcons'`  \n`pod 'FontAwesomeKit/Zocial'`  \n`pod 'FontAwesomeKit/IonIcons'`\n`pod 'FontAwesomeKit/Octicons'`\n`pod 'FontAwesomeKit/Material'`\n\nRun `pod install` or `pod update` to install selected icon fonts.\n\n#### Importing Headers\n\n`#import FontAwesomeKit/FontAwesomeKit.h` If you installed all available icon fonts.\n\nOr import icon fonts you installed with sub specs\n\n`#import FontAwesomeKit/FAKFontAwesome.h`  \n`#import FontAwesomeKit/FAKFoundationIcons.h`  \n`#import FontAwesomeKit/FAKZocial.h`  \n`#import FontAwesomeKit/FAKIonIcons.h`\n`#import FontAwesomeKit/FAKOcticons.h`\n`#import FontAwesomeKit/FAKMaterialIcons.h`\n\n#####*important:*\nIf you deleted a sub spec in Podfile, please delete Xcode's derived data in organizer(command+shift+2 to bring up). Otherwise Xcode will keep copying font files those supposed to be deleted to the app bundle.\n\n### Install with Carthage\nAdd `github \"PrideChung/FontAwesomeKit\"` to Cartfile to install all icon fonts.\n\n### Install Manually\n\nDownload source code, then drag the folder `FontAwesomeKit` into your project, add CoreText framework to you project.\n\n##Example Usage\n\n### Creating Icons\n```objective-c\nFAKFontAwesome *starIcon = [FAKFontAwesome starIconWithSize:15];\nFAKFoundationIcons *bookmarkIcon = [FAKFoundationIcons bookmarkIconWithSize:15];\nFAKZocial *twitterIcon = [FAKZocial twitterIconWithSize:15];  \nFAKIonIcons *mailIcon = [FAKIonIcons ios7EmailIconWithSize:48];\nFAKOcticons *repoIcon = [FAKOcticons repoIconWithSize:48];\nFAKMaterialIcons *androidIcon = [FAKMaterialIcons androidIconWithSize:48];\n\n```\n\n```swift\nlet starIcon = FAKFontAwesome.starIcon(withSize: 15)\nlet bookmarkIcon = FAKFoundationIcons.bookmarkIcon(withSize: 15)\nlet twitterIcon = FAKZocial.twitterIcon(withSize: 15)\nlet mailIcon = FAKIonIcons.ios7EmailIcon(withSize: 48)\nlet repoIcon = FAKOcticons.repoIcon(withSize: 48)\nlet androidIcon = FAKMaterialIcons.androidIcon(withSize: 48)\n\n```\nNow you can use these class methods and pass in the font size instead of finding an icon with constants. Corresponding icon fonts will automatically setup for you.\n\n#### Creating icons using identifiers\nIt is now possible to use identifiers to create icons. Check each documentation to get the appropriate identifier. Also, make sure you use an existing identifier, else the method will return nil and an error will be set.\n\n```objective-c\nNSError *error;\nFAKFontAwesome *starIcon = [FAKFontAwesome  iconWithIdentifier:@\"fa-star\" size:15 error:error];\nFAKFoundationIcons *bookmarkIcon = [FAKFoundationIcons iconWithIdentifier:@\"fi-bookmark\" size:15 error:error];\nFAKZocial *twitterIcon = [FAKZocial iconWithIdentifier:@\"zocial.twitter\" size:15 error:error];\nFAKIonIcons *mailIcon = [FAKIonIcons iconWithIdentifier:@\"ion-ios-email\" size:48 error:error];\n```\n```swift\nlet starIcon: FAKFontAwesome?\ndo {\n  starIcon = try FAKFontAwesome.init(identifier: \"er\", size: 15)\n} catch let error as NSError {\n  print(error.localizedDescription)\n}\n```\n\n### Setting Attributes for An Icon\n```objective-c\n[starIcon addAttribute:NSForegroundColorAttributeName value:[UIColor\nwhiteColor]];\n```\n```swift\nstarIcon.addAttribute(NSForegroundColorAttributeName, UIColor.white)\n```\n`NSAttributedString` did all the magics behind the scene. So you can set those attributes supported by `NSAttributedString` to an icon. For all available attributes, see [NSAttributedString UIKit Additions Reference](https://developer.apple.com/library/ios/documentation/UIKit/Reference/NSAttributedString_UIKit_Additions/Reference/Reference.html#//apple_ref/doc/uid/TP40011688-CH1-SW16)\n\n#####*important:*\nSome attributes apparently makes no sense for icon fonts, like `NSLigatureAttributeName` and `NSKernAttributeName`. You should not use these attributes, otherwise you app might crash. And you should not set the value of `NSFontAttributeName`, if you want to change the size of an icon, set it's `iconFontSize` property instead.\n\n### Other Methods for Setting or Getting Attributes\nThese methods in fact are just shorthand versions for the standard `NSAttributedString` API, should be pretty straightforward.\n\n`[starIcon setAttributes:attributes];` `starIcon.setAttributes(attributes)`\n*Sets attributes with a dictionary, will override current attribute if there're different values for a same key.*\n\n\n`[starIcon removeAttribute:NSForegroundColorAttributeName];` `starIcon.removeAttribute(NSForegroundColorAttributeName)`\n*Removes an attribute by name.*\n\n\n`[starIcon attributes];` `starIcon.attributes()`\n*Returns an dictionary contains the attribute values for the icon.*\n\n\n`[starIcon attribute:NSForegroundColorAttributeName];` `starIcon.attribute(NSForegroundColorAttributeName)`\n*Returns the attribute value for a given key.*\n\n### Get The Attributed String\nAfter you done setting attributes, you can get the attributed string by calling\n`[starIcon attributedString]` `starIcon.attributedString()`.\n\nSo you can use the icon on a label with one line of code:\n\n`self.label.attributedText = [starIcon attributedString];` `self.label.attributedText = starIcon.attributedString()`\n\nYou don't need to set the label's `font` property, it's already been taken care of.\n\n### Drawing The Icon on Image\n\n#### Basic Drawing\nInstead of getting the attributed string, you can draw the icon onto an image like this:\n\n`UIImage *iconImage = [starIcon imageWithSize:CGSizeMake(15, 15)];`\n\n`let iconImage = starIcon.image(with: CGSize(width: 15, height: 15))`\n\nThis will use the attributes you've set to draw that image, you only need to specify a size for the image.\n\n#### Drawing Offset\nBy default the icon is centered horizontally and vertically. I believe that's 99% what you want. However, if it's not centered properly, you can set the `drawingPositionAdjustment` property for the icon, like this:\n\n`starIcon.drawingPositionAdjustment = UIOffsetMake(2, 2);`\n\n#### Background Color\nYou can set the background color for the image like this:\n\n`starIcon.drawingBackgroundColor = [UIColor blackColor];`\n\n`starIcon.drawingBackgroundColor = UIColor.black`\n\nBy default the background is transparent. As the name implies, this property only takes effect while drawing on image. You can specify a gradient color to create a gradient background, check the example project for details.\n\n### Those Controls Doesn't Support Attributed String\n\nSome UI elements doesn't have an attributed string property, using images might be a better idea. Take UIBarButtonItem as an example.\n\n```objc\nFAKFontAwesome *cogIcon = [FAKFontAwesome cogIconWithSize:20];\n[cogIcon addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor]];\nUIImage *leftImage = [cogIcon imageWithSize:CGSizeMake(20, 20)];\ncogIcon.iconFontSize = 15;\nUIImage *leftLandscapeImage = [cogIcon imageWithSize:CGSizeMake(15, 15)];\nself.navigationItem.leftBarButtonItem =\n[[UIBarButtonItem alloc] initWithImage:leftImage\n                   landscapeImagePhone:leftLandscapeImage\n                                 style:UIBarButtonItemStylePlain\n                                target:nil\n                                action:nil];\n```\n\n```swift\nlet cogIcon = FAKFontAwesome.cogIcon(withSize: 20)\ncogIcon?.addAttribute(NSForegroundColorAttributeName, value: UIColor.white)\nlet leftImage = cogIcon?.image(with: CGSize(width: 20, height: 20))\ncogIcon?.iconFontSize = 15\nlet leftLandscapeImage = cogIcon?.image(with: CGSize(width: 15, height: 15))\nself.navigationItem.leftBarButtonItem = UIBarButtonItem(\n  image: leftImage,\n  landscapeImagePhone: leftLandscapeImage,\n  style: .plain,\n  target: nil,\n  action: nil)\n```\nSame idea can be applied to tab bar or segmented control.\n\n### Generating Image with Stacked Icons (Since V2.1.5)\n[Stacked icons is a feature of Font-Awesome](http://fortawesome.github.io/Font-Awesome/examples/#stacked) and now has been ported to FontAwesomeKit. You can generate an image with multiple icons stacked together.\n\n```objc\n[UIImage imageWithStackedIcons:@[[FAKFontAwesome twitterIconWithSize:35], [FAKFontAwesome squareOIconWithSize:70]],\n                     imageSize:CGSizeMake(80, 80)];\n```\n\n```swift\nlet image = UIImage(stackedIcons: [FAKFontAwesome.twitterIcon(withSize: 35), FAKFontAwesome.squareOIcon(withSize: 70)], imageSize: CGSize(width: 80, height: 80))\n```\n\nThe first icon in the array will be draw on the bottom.\n\n### More Examples\nPlease clone the master repo and take a look at the example project, everything is in it, all public methods and properties are documented. Feel free to open an issue if you went into trouble.\n\n## Using Custom Icon Font\nYou can use some web applications like [fontastic.me](https://fontastic.me) to generate your own icon font to reduce font file size. In this case, you need to implement your own `FAKIcon` subclass, here's a complete demo: [PrideChung / FontAwesomeKitCustomFont](https://github.com/PrideChung/FontAwesomeKitCustomFont)\n\n## Known Issues\n\nCheck [Known Issuses](https://github.com/PrideChung/FontAwesomeKit/blob/master/KnownIssues.md) if you ran into strange crashes.\n\n## Changelog\n\nSee [CHANGES.md](https://github.com/PrideChung/FontAwesomeKit/blob/master/CHANGES.md)\n\n## Contributors\n- [Vasilis Akoinoglou](https://github.com/alladinian)\n- [Isak Sky](https://github.com/isaksky)\n- [Dominik Grygiel](https://github.com/dominikgrygiel)\n- [Alex Shepard](https://github.com/PrideChung/FontAwesomeKit/pull/12)\n\n\n## License\nFontAwesomeKit is available under the MIT license. See the LICENSE file for more information. Attribution isn't required but is much appreciated.\n\n**Please notice that each icon font has it's own license agreement.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPrideChung%2FFontAwesomeKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPrideChung%2FFontAwesomeKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPrideChung%2FFontAwesomeKit/lists"}