{"id":2065,"url":"https://github.com/alexdrone/ios-fontawesome","last_synced_at":"2025-04-08T11:11:58.825Z","repository":{"id":6148189,"uuid":"7377298","full_name":"alexdrone/ios-fontawesome","owner":"alexdrone","description":"NSString+FontAwesome","archived":false,"fork":false,"pushed_at":"2017-01-24T01:01:06.000Z","size":899,"stargazers_count":1744,"open_issues_count":34,"forks_count":254,"subscribers_count":91,"default_branch":"master","last_synced_at":"2024-05-23T04:15:02.112Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexdrone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-30T14:55:43.000Z","updated_at":"2024-03-13T10:05:24.000Z","dependencies_parsed_at":"2022-09-14T19:12:22.232Z","dependency_job_id":null,"html_url":"https://github.com/alexdrone/ios-fontawesome","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdrone%2Fios-fontawesome","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdrone%2Fios-fontawesome/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdrone%2Fios-fontawesome/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdrone%2Fios-fontawesome/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexdrone","download_url":"https://codeload.github.com/alexdrone/ios-fontawesome/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247829511,"owners_count":21002997,"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","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.612Z","updated_at":"2025-04-08T11:11:58.799Z","avatar_url":"https://github.com/alexdrone.png","language":"Objective-C","funding_links":[],"categories":["Text","Objective-C","Testing","Objective-C  Stars 1000以内排名整理","etc"],"sub_categories":["Font","Other free courses"],"readme":"FontAwesome+iOS\n===================\n\nFont awesome is an iconic font. Read more about it on http://fortawesome.github.com/Font-Awesome/\n\nThis category brings this great iconic font on iOS.\n\nUsage\n--------------------\n\nFirst, make sure you have `FontAwesome.ttf` bundled in your project and that `UIAppFonts` key in the project's plist file contains a String item named `FontAwesome.ttf` \nThen add the `NSString+FontAwesome` category to the project.\n\n\tUILabel *label = [...]\n\tlabel.font = [UIFont fontWithName:kFontAwesomeFamilyName size:20];\n\t\nYou can now use enums for all the different iconic characters\n\n\t\n\tlabel.text = [NSString fontAwesomeIconStringForEnum:FAGithub];\nor you can reference them by using the class identifiers listed here http://fortawesome.github.io/Font-Awesome/icons\n\n\t\n\tlabel.text = [NSString fontAwesomeIconStringForIconIdentifier:@\"fa-github\"];\nor you can add the `UIImage+FontAwesome` category to generate icon image directly\n\n\tUIImage *github = [UIImage imageWithIcon:@\"fa-github\" backgroundColor:[UIColor purpleColor] iconColor:[UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:255] iconScale:2.f fontSize:20];\nthen you will get an icon like this\n\n![image](Resources/fontawesome-github.jpg)\n\nThat's all.  \nHave a look at the small demo project for further information.\n\nFAImageView\n--------------------\n\nFAImageView is now extended and contains a new property called `defaultView` that is shown when the image is set to nil.\nIt is possible to use one the font-awesome icon as a default placeholder for an image view.\n\n\tFAImageView *imageView = [[FAImageView alloc] initWithFrame:CGRectMake(0.f, 0.f, 100.f, 100.f)];\n    imageView.image = nil;\n    [imageView setDefaultIconIdentifier:@\"fa-github\"];\n\n\nTroubleshooting\n--------------------\n\n### Some icons are not available on some devices\n\nKeep in mind that if you have installed the FontAwesome font in your iOS system (with [InstaFont](https://itunes.apple.com/us/app/instafont-install-any-new/id1020299046) for example), the embedded font in your App will not be used! So if your system FontAwesome font is v4.2, you will never be able to display icons from v4.3 and v4.4 for example from the embedded font.\n\nTwo solutions :\n\n1. Remove the font profile from your iOS device\n2. Rename the Postscript name of file `FontAwesome.ttf` with a tool like [ttx](https://github.com/behdad/fonttools/) for example and use the new name in `NSString+FontAwesome.h`\n\nHere is the step by step for second solution :\n\n- Install fonttools\n  ```\n  git clone https://github.com/behdad/fonttools.git ;\n  cd fonttools/\n  sudo python setup.py install\n  ```\n\n- Convert the `FontAwesome.ttf` file to `ttx` format\n  ```\n  cd your_app/Pods/FontAwesome+iOS/Resources/\n  ttx FontAwesome.ttf\n  ```\n\n- Replace all occurence of `FontAwesome` with `FontAwesome440` for example in `ttx` file and save\n\n- Convert back `ttx` font to `ttf`\n  ```\n  ttx FontAwesome.ttx\n  mv FontAwesome.ttf FontAwesome.ttf.orig\n  mv FontAwesome#1.ttf FontAwesome.ttf\n  ```\n\n- In file `NSString+FontAwesome.h`, change font Postscript name :\n  ```\n  static NSString *const kFontAwesomeFamilyName = @\"FontAwesome440\";\n  ```\n\n- Build, run and dance\n\n\nLicense\n-------------------\n\nThis project uses the FontAwesome fix made by Pit Garbe that you can find at https://github.com/leberwurstsaft/FontAwesome-for-iOS Version 2.0 of the Font Awesome font, CSS, and LESS files are licensed under CC BY 3.0: http://creativecommons.org/licenses/by/3.0/ A mention of 'Font Awesome - http://fortawesome.github.com/Font-Awesome' in human-readable source code is considered acceptable attribution (most common on the web). If human readable source code is not available to the end user, a mention in an 'About' or 'Credits' screen is considered acceptable (most common in desktop or mobile software)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdrone%2Fios-fontawesome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexdrone%2Fios-fontawesome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdrone%2Fios-fontawesome/lists"}