Giter VIP home page Giter VIP logo

fontawesomekit's People

Contributors

alexshepard avatar alladinian avatar corymsmith avatar dominikgrygiel avatar elfsundae avatar gscalzo avatar igrandav avatar isaksky avatar jbender avatar n-studio avatar pridechung avatar remydcf avatar rrossinvicara avatar skyline75489 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fontawesomekit's Issues

'Font file doesn't exist' error

I'm getting a weird error - looks like the fonts aren't being registered properly? Doing this in my AppDelegate as a workaround as detailed in KnownIssues

#import <FontAwesomeKit/FontAwesomeKit.h>

@implementation IATAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [FAKFontAwesome iconFontWithSize:1];
  [FAKFoundationIcons iconFontWithSize:1];
  [FAKIonIcons iconFontWithSize:1];

  return YES;
}

@end
2014-08-05 18:41:42.958 Visit[74417:60b] *** Assertion failure in +[FAKFontAwesome registerIconFontWithURL:], /Users/jon/code/Visit/Pods/FontAwesomeKit/FontAwesomeKit/FAKIcon.m:14
2014-08-05 18:41:42.962 Visit[74417:60b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Font file doesn't exist'
*** First throw call stack:
(
    0   CoreFoundation                      0x032781e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x02f5a8e5 objc_exception_throw + 44
    2   CoreFoundation                      0x03278048 +[NSException raise:format:arguments:] + 136
    3   Foundation                          0x0115a4de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
    4   Visit                               0x001c1572 +[FAKIcon registerIconFontWithURL:] + 370
    5   Visit                               0x001a3548 __35+[FAKFontAwesome iconFontWithSize:]_block_invoke + 152
    6   libdispatch.dylib                   0x038264d0 _dispatch_client_callout + 14
    7   libdispatch.dylib                   0x03815e12 dispatch_once_f + 184
    8   libdispatch.dylib                   0x03815d55 dispatch_once + 31
    9   Visit                               0x001a333d +[FAKFontAwesome iconFontWithSize:] + 173
    10  Visit                               0x0000371f -[IATAppDelegate application:didFinishLaunchingWithOptions:] + 2543
    11  UIKit                               0x019e514f -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 309
    12  UIKit                               0x019e5aa1 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1810
    13  UIKit                               0x019ea667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
    14  UIKit                               0x019fef92 -[UIApplication handleEvent:withNewEvent:] + 3517
    15  UIKit                               0x019ff555 -[UIApplication sendEvent:] + 85
    16  UIKit                               0x019ec250 _UIApplicationHandleEvent + 683
    17  GraphicsServices                    0x04272f02 _PurpleEventCallback + 776
    18  GraphicsServices                    0x04272a0d PurpleEventCallback + 46
    19  CoreFoundation                      0x031f3ca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
    20  CoreFoundation                      0x031f39db __CFRunLoopDoSource1 + 523
    21  CoreFoundation                      0x0321e68c __CFRunLoopRun + 2156
    22  CoreFoundation                      0x0321d9d3 CFRunLoopRunSpecific + 467
    23  CoreFoundation                      0x0321d7eb CFRunLoopRunInMode + 123
    24  UIKit                               0x019e9d9c -[UIApplication _run] + 840
    25  UIKit                               0x019ebf9b UIApplicationMain + 1225
    26  Visit                               0x00002cfd main + 141
    27  libdyld.dylib                       0x03a5b701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Do You Need Gradient Helpers?

Hi, all

Creator of this repo is asking for advices, again.

For the recently major update, I removed all gradient helpers those were provided in previous versions. For myself, I never use those helpers in any actual project. Creating a nice gradient is a serious design work, I'd rather do it with PhotoShop instead of adjusting gradient parameters and hitting command+R again and again to see how it looks like. The only reason for me to create those helpers is to make the demo screenshot looks cooler.

I like the UNIX philosophy, do one thing and do it well. For FontAwesomeKit, it should focus on providing icons fast and easy. Making gradients programmatically sounds like something NSGradient would do. (If there's NSGradient on iOS).

Besides, you can still make gradient icons or backgrounds by providing a UIColor with pattern image. Check the example project, there's a demo for that. While I making this demo I feel much more easier to create a nice gradient in Pixelmator than in code. If you want to create an icon even complicated than that, you really should create it with image editor.

If most of you really want those helpers, I will create a separated project to provide equal functions, the project will be much more organized and reusable. Just leave a comment and let me know, I don't want to create something no one will actually use, not even myself.

Should I move to iOS7 ?

Hi, I'm the creator of this library.

Since iOS7 is upcoming and so many cool things came out, I've already decided to abandon iOS5&6 support in my next personal project.

The new exciting Text Kit framework provides almost everything FontAwesomeKit provides before except gradient which not encouraged in iOS7's flat design. Compare with NSAttributedString and it's new attributes, FontAwesomeKit is cumbersome and inconsistent.

Currently FontAwesomeKit supports iOS5 and above. You will get a deprecated warning from a string drawing method which deprecated in iOS7 if your app only targeting iOS7. I can fix these warnings with some messy compiler macros, or I can drop iOS5&6 and embrace new Text Kit framework, make a cleaner codebase and API.

When I created this library, I thought nobody would ever use it except myself, so I just put every method under the class FontAwesomeKit in the quick and dirty way. Looks like now I have a chance to start over and I want to make things right.

So my question is do you still need support for iOS5&6? Feel free to drop a line. I will drop iOS5&6 support if it turns out no one cares about this shitty library.

Example project build failed

diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

FAKIconThumbsUp/Down broken?

I can't seem to get FAKIconThumbsUp or FAKIconThumbsUpDown to render correctly within a UIButton. FAKIconThumbsUpAlt and FAKIconThumbsDownAlt work fine (as do other characters). I took at look at the source it and it appears that the character codes are correct, but I still get the unknown character square.

// Works
[self.button setTitle:FAKIconThumbsUpAlt forState:UIControlStateNormal];

// Doesn't work
[self.button setTitle:FAKIconThumbsUp forState:UIControlStateNormal];

Thought I'd post it here in case anyone else was seeing the same behavior. I integrated via Cocoapods and am on tag 1.1.3.

Release build on iPhone crashes

Strange behavior and I cannot figure out what's wrong.. Release build on simulator works well, but on my iPhone it crashes with such message:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
reason: 'NSConcreteMutableAttributedString addAttribute:value:range:: nil value'
*** First throw call stack:
(0x1864eef50 0x1929f81fc 0x1864eee90 0x186fad1fc 0x1000cbe94 0x10008ddb8 0x10008d9ac 0x1894b8670 0x1894b83f4 0x1894bf7a4 0x1894bcd78 0x18952f83c 0x18952c148 0x1895259ec 0x1894b98cc 0x1894b8ad0 0x189525044 0x18c0d7504 0x18c0d7030 0x1864aee90 0x1864aedf0 0x1864ad014 0x1863edc20 0x1895241c8 0x18951efdc 0x100094168 0x192febaa0)
libc++abi.dylib: terminating with uncaught exception of type NSException

New version for CocoaPods to use bundleForClass:

Thanks for this library.

In my project, I'd like to use FontAwesomeKit as a dynamic framework. In a framework, all resources have to be loaded with bundleForClass: instead of mainBundle. This has been fixed in fefd9e5.

Could you please release a new version for CocoaPods that includes this commit (and the latest updates).

Thanks again.

FontAwesome +allIcons mapping

I'm currently playing around with FontAwesomeKit (see here for first impressions) and noticed, that the allIcons - Method returns a mapping of unicode values to icon names in camel case. Wouldn't this mapping make much more sense the other way around?

This way you could lookup icons by their name as given by the Font Awesome project itself and you would be able to support name aliases:

@{
    @"automobile": @"\uf1b9",
    @"car": @"\uf1b9"
};

Martin
p.S.: Do you need help to upgrade to font version 4.1?

Using FAK in nibs/xibs

Is there anyway to use some kind of variation of the icons in xibs as placeholders?

Right now, I have a static image which sort of looks like the FAK icon generated in code. Is there a way around this?

Assertion Failure "UIFont object should not be nil"

This is turning me crazy, I used this library in other projects without any issue, but here I have this one and it won't go away!

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UIFont object should not be nil, check if the font file is added to the application bundle and you're using the correct font name.'

Any ideas? I cleaned multiple times, cleared derived data, restarted....

UIBarButton works for me.

I noticed in the docs you mentioned UIBarButton is not supported, but i was able to use it the following way.

    UIBarButtonItem *closeBtn = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStyleDone target:self action:@selector(cancel)];

    FAKFontAwesome *closeIcon = [FAKFontAwesome closeIconWithSize:18];
    [closeBtn setTitle:[[closeIcon attributedString] string]];
    NSMutableDictionary *closeAttributes = [NSMutableDictionary dictionaryWithDictionary:[closeIcon attributes]];
    [closeAttributes setObject:[UIColor flatBlackColorDark] forKey:NSForegroundColorAttributeName];
    [closeBtn setTitleTextAttributes:closeAttributes forState:UIControlStateNormal];



    [[self navigationItem] setRightBarButtonItems:@[closeBtn] animated:NO];

Backward compatibility?

Hi,

Love your work and this pod. I use it extensively throughout my app. A request: is it possible to maintain some backward compatibility between releases? I totally understand the move to attributed. But when you are renaming icon names, is it possible to leave the old names in place?

icon by name

Is it possible to get an icon by name as a string? Something like [FAIcon iconWithName:(NSString *)name size:(CGFloat)size.

I tried calling the the method by reflection using performSelector on FAKFontAwesome but was not able to succeed. I can probably push through this but figured I would ask if there is an easier way.

Problems with latest version

Currently, the latest version does not compile on XCode 7 because of #42.
The solution was to use :head but the problem is that it doesn't compile anymore because PodSpec file has not been updated properly and some files are not added correctly.

Is it possible to update ASAP, I posted a PR #65 to fix the problems I believe

Icons looks blurry on iPhone 6 & 6 Plus

When converting a FAKIcon to an UIImage (example below), the image looks sharp on iPhone 5S (@2x) but on iPhone 6 Plus it's a bit blurry.

iPhone 5S
fakicon_issue2

iPhone 6 Plus
fakicon_issue

FAKIcon *filterIcon = [FAKIonIcons iosSettingsStrongIconWithSize:22.0];
[filterIcon addAttribute:NSForegroundColorAttributeName value:WHITE_COLOR];
UIImage *filterImage = [filterIcon imageWithSize:CGSizeMake(filterIcon.iconFontSize, filterIcon.iconFontSize)];
UIBarButtonItem *filterItem = [[UIBarButtonItem alloc] initWithImage:filterImage style:UIBarButtonItemStylePlain target:self action:@selector(showFilterMenu)];
self.navigationItem.rightBarButtonItem = filterItem;

library not found for -lFontAwesomeKit

I'm having that error when trying to make an archive.

This is the full error:

Ld /Users/jan/Library/Developer/Xcode/DerivedData/FleetMode-apyrpzkdsacycqdausgqhbgajfcj/Build/Intermediates/ArchiveIntermediates/FleetMode/IntermediateBuildFilesPath/FleetMode.build/QA-iphoneos/FleetMode.build/Objects-normal/arm64/FleetMode normal arm64
    cd /Users/jan/Documents/Projects/iOS/DriveMode/drivemode
    export IPHONEOS_DEPLOYMENT_TARGET=7.1
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -L/Users/jan/Library/Developer/Xcode/DerivedData/FleetMode-apyrpzkdsacycqdausgqhbgajfcj/Build/Intermediates/ArchiveIntermediates/FleetMode/BuildProductsPath/QA-iphoneos -F/Users/jan/Library/Developer/Xcode/DerivedData/FleetMode-apyrpzkdsacycqdausgqhbgajfcj/Build/Intermediates/ArchiveIntermediates/FleetMode/BuildProductsPath/QA-iphoneos -F/Users/jan/Documents/Projects/iOS/DriveMode/drivemode/Frameworks -filelist /Users/jan/Library/Developer/Xcode/DerivedData/FleetMode-apyrpzkdsacycqdausgqhbgajfcj/Build/Intermediates/ArchiveIntermediates/FleetMode/IntermediateBuildFilesPath/FleetMode.build/QA-iphoneos/FleetMode.build/Objects-normal/arm64/FleetMode.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=7.1 -dead_strip -fembed-bitcode -Xlinker -bitcode_hide_symbols -Xlinker -bitcode_symbol_map -Xlinker /Users/jan/Library/Developer/Xcode/DerivedData/FleetMode-apyrpzkdsacycqdausgqhbgajfcj/Build/Intermediates/ArchiveIntermediates/FleetMode/BuildProductsPath/QA-iphoneos -ObjC -lFontAwesomeKit -lMBSwitch -lMSCellAccessory -lPDKeychainBindingsController -lRBBAnimation -lReachability -lSDCAlertView -lSDCAutoLayout -lSVProgressHUD -lSWTableViewCell -llibPhoneNumber-iOS -framework CoreTelephony -framework CoreText -framework QuartzCore -framework Security -framework SystemConfiguration -framework UIKit -fobjc-arc -fobjc-link-runtime -framework MessageUI -framework AVFoundation -framework CoreLocation -framework CoreTelephony -framework CoreGraphics -framework UIKit -framework Foundation -lPods -Xlinker -dependency_info -Xlinker /Users/jan/Library/Developer/Xcode/DerivedData/FleetMode-apyrpzkdsacycqdausgqhbgajfcj/Build/Intermediates/ArchiveIntermediates/FleetMode/IntermediateBuildFilesPath/FleetMode.build/QA-iphoneos/FleetMode.build/Objects-normal/arm64/FleetMode_dependency_info.dat -o /Users/jan/Library/Developer/Xcode/DerivedData/FleetMode-apyrpzkdsacycqdausgqhbgajfcj/Build/Intermediates/ArchiveIntermediates/FleetMode/IntermediateBuildFilesPath/FleetMode.build/QA-iphoneos/FleetMode.build/Objects-normal/arm64/FleetMode

ld: library not found for -lFontAwesomeKit
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What's strange is that I can compile for the simulator.

Crash when dismissing modal ViewController

Hello,

When I use a UITextView with email link detection, touch the link (to compose an email via the default composer), then dismiss or send the email, my app crashes. I am using the following to display the FAKFontAwesome icon that is next to the UITextView:

// Icon
FAKFontAwesome *emailIcon = [FAKFontAwesome envelopeIconWithSize:20];
self.emailIconImageView.image = [emailIcon imageWithSize:CGSizeMake(20, 20)];

The code above is called from viewDidLoad, so it isn't getting refreshed on viewDid/WillAppear

When I enable Zombie objects, the crash does not occur. It crashes without exception on the Main loop. The last call in the callstack is:

TComponentFont::GetUnderlineThickness(CGAffineTransform const&) const + 16

I have no idea how to fix this bug, and it seems related to your library, as I don't get the crash when I comment out the FontAwesome image. I will keep debugging and trying to find the reason this occurs, but maybe I am doing something obviously wrong?

registerIconFontWithURL without SIM card inserted will hang app

It seems an bug from iOS, the app hangs when call CGFontCreateWithDataProvider

The issue reproduced on iOS 7.1.2(iPhone 4S), and the bug reported here https://alpha.app.net/jaredsinclair/post/18555292

There is a workaround, call [UIFont familyNames] before call CGFontCreateWithDataProvider

But the issue does not happened on every app, another app (also developed by me) using FontAwesomeKit is working fine (using the same code for init font, [FAKFontAwesome spoonIconWithSize:28] will cause the problem).

Is there any debug log is helpful for your guys?

Can FontAwesomeKit be used with Custom Font?

I don't want so many fonts libs in my project, nor a big TTF file for each lib. I am using fontastic to create custom font and use only the symbols that i need + my own. Can I create a FAKIcon class and remove all others. If yes, what's the ideal way to do that?

Who is using this?

If you know some apps using that please also put the links to app so that it's more convincing to other developers. Thanks!

Runtime errors when using with swift

However, I'm still getting runtime errors with FontAwesomeKit. The following crashes on the first line. I posted my setup information in #46

let playIcon = FAKFontAwesome.playIconWithSize(15)
print(playIcon.attributedString())
self.btnPlay.titleLabel?.attributedText = playIcon.attributedString()

Is this something that can be easily addressed? I need to get my app running in the simulator again, I'll post the error message soon.

how to integrated with swift?

i install with cocoapod & imported in bridge header

#import <FontAwesomeKit/FAKFontAwesome.h>

but i still got

Use of unresolved identifier 'FAKFontAwesome'

Xcode 5 Compilation Error

Was hoping you could help me track down this compiler issue.

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_FAKFontAwesome", referenced from:
      objc-class-ref in RemoteVideoPlaybackController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I added pod 'FontAwesomeKit', '~> 2.1.0' to my Podfile; ran pod install.

Then I added the following code to one of my controllers

#import <FontAwesomeKit.h>

...

FAKFontAwesome *cogIcon = [FAKFontAwesome cogIconWithSize:20];
[cogIcon addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor]];
UIImage *leftImage = [cogIcon imageWithSize:CGSizeMake(20, 20)];
self.playPauseBtn.imageView.image = leftImage;

The application had been compiling just fine until I added these snippets. If I where to remove the code from my controller the application compiles and runs again.

Not sure if there are anymore project settings I should be configuring that I may have missed. Any pointers are appreciated.

Compilation errors on xcode 4.3.3

I am trying to run the example project using iphone5 simulator and I ran into the following compilation errors:

FontAwesomeKitExample Group
/Users/andre/Demo/FontAwesomeKit/FontAwesomeKitExample/FontAwesomeKitExample/AppDelegate.m
Property 'window' requires method 'window' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
Property 'window' requires method 'setWindow:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
/Users/andre/Demo/FontAwesomeKit/FontAwesomeKitExample/FontAwesomeKitExample/KitchenSinkViewController.m
Unexpected '@' in program
Unexpected '@' in program
Unexpected '@' in program
Unexpected '@' in program
Unexpected '@' in program
Unexpected '@' in program
Unexpected '@' in program
Unexpected '@' in program
Unexpected '@' in program
Unexpected '@' in program
Unexpected '@' in program
Unexpected '@' in program
Property 'imageView' requires method 'imageView' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
Property 'imageView' requires method 'setImageView:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
Property 'gradientImageView' requires method 'gradientImageView' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
Property 'gradientImageView' requires method 'setGradientImageView:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
Property 'toolbar' requires method 'toolbar' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
Property 'toolbar' requires method 'setToolbar:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
Property 'facebookLabel' requires method 'facebookLabel' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
Property 'facebookLabel' requires method 'setFacebookLabel:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
Property 'starLabel' requires method 'starLabel' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
Property 'starLabel' requires method 'setStarLabel:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
Property 'twitterButton' requires method 'twitterButton' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
Property 'twitterButton' requires method 'setTwitterButton:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
Property 'okLabel' requires method 'okLabel' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
Property 'okLabel' requires method 'setOkLabel:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
/Users/andre/Demo/FontAwesomeKit/FontAwesomeKitExample/FontAwesomeKitExample/IconsTableViewController.m
Use of undeclared identifier '_icons'
Use of undeclared identifier '_icons'
Use of undeclared identifier '_icons'
Use of undeclared identifier '_iconKeys'
Use of undeclared identifier '_iconKeys'
Use of undeclared identifier '_iconKeys'
Subscript requires size of interface 'NSArray', which is not constant in non-fragile ABI
Array subscript is not an integer
Property 'icons' requires method 'setIcons:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
Property 'iconKeys' requires method 'setIconKeys:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
/Users/andre/Demo/FontAwesomeKit/FontAwesomeKit/FontAwesomeKit.m

FontAwesome font deallocated, causing crash

I'm having an issue where I believe FontAwesomeKit is causing my app to crash. When I am presenting views that contain FontAwesome icons created using FontAwesomeKit, the app can crash with an EXC_BAD_ACCESS exception. There are particular situations which are guaranteed to cause a crash, and I've given a pretty complete description here. Additionally, when Guard Malloc is enabled, the app will crash on every view that contains a FontAwesome icon.

We've recently found that removing FontAwesomeKit from our project entirely will result in our app no longer crashing in the problematic views. It seems like when iOS is trying to determine the height of a FontAwesome attributed string icon, the FontAwesome font is deallocated when CoreText tries to access it (there's a stack trace at the above link that may help illustrate what is going on here a bit better).

Not sure if it makes a difference, but we are including FontAwesomeKit in our project through Cocoapods.

[Question] Aligning icons with the rest of an attributed string

As seen in the attached image, I am trying to use FontAwesomeKit to display icons aligned with text on a button. For simplicity, I'd love to be able to do this with an attributed string rather than an image and string.

But I can't seem to figure out how to get the icons to vertically center-align with the text. I've tried a few different things, but they all seem to affect either nothing or the entire icon + text.

img_1058

My code follows…

FAKIcon *icon = [FAKIonIcons socialFacebookIconWithSize:20.f];
NSString *trailingTitle = NSLocalizedString(@"  Facebook", nil);
UIFont *font = [AppStyle avenirLightFontOfSize:16.f];

[icon addAttribute:NSForegroundColorAttributeName value:foregroundColor];
NSMutableAttributedString *buttonTitle = [icon.attributedString mutableCopy];
[buttonTitle appendAttributedString:[[NSAttributedString alloc] initWithString:trailingTitle
    attributes:@{
        NSForegroundColorAttributeName: foregroundColor,
        NSFontAttributeName: font,
    }]
];
[self.facebookButton setAttributedTitle:[buttonTitle copy] forState:UIControlStateNormal];

I suspect I am missing some NSAttributedString feature; any helpful pointers would be appreciated.

newspaper-o icon bug

Hi, I have a problem with the newspaper-o icon.
I'm using it in the TabBarController, I create an UIImage with that icon but the icon doesn't appear.
The same code works with other icons, infact i have 5 Tabs and i have 4 working icons.
Well, it worked once or twice at the beginning, but after few build-and-run the "newspaper-o" tab's icon disappeared forever. I experienced the same behaviour on the simulator and on my iphone 4s.
I deleted the otf files and downloaded them again, nothing changed.
Any ideas would be appreciated.
Agostino

Shadows on icons

I tried added shadow on my UIButton's NSAttributedString and it gets clipped no matter what I try. I looked through the issues and repo and it looks like there used to be shadow support via an attribute. I can't find this in the current codebase. Is there any way to do shadows on NSAttributedString font icons?

I was using standard NSAttributedString NSShadow stuff, by the way.

Assertion failure when using fonts

I try to use this library in Swift project. But getting this error

*** Assertion failure in +[FAKFontAwesome registerIconFontWithURL:], /path/to/project/Pods/FontAwesomeKit/FontAwesomeKit/FAKIcon.m:14

Any clue?

UIBarButtonItem always blue

trying to change the color of the UIImage that gets added to UIBarButtonItem, trying to figure out how. even the example app shows up as Blue in there. so not sure if this is a bug or just something I'm not doing. (XCode 5 and iOS 7.1

Unable to correctly size a label (icon clipped)

I'm having trouble grabbing the correct size for a label containing an icon font. I've tried several methods to obtain the correct size, but all result in a clipped icon.

Setup:

UILabel *label = [[UILabel alloc] init];
label.opaque = YES;
label.clipsToBounds = NO;
label.numberOfLines = 1;          
label.attributedText = [[FAKFontAwesome ellipsisVIconWithSize:14.0] attributedString];
[label sizeToFit];

Have tried the following suggestions to no avail:

label.size = [label.attributedText boundingRectWithSize:CGSizeMake(300.f, CGFLOAT_MAX)
  options:(NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading)
  context:nil].size;

As well as:

CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString((__bridge CFAttributedStringRef)label.attributedText);
CGSize targetSize = CGSizeMake(320, CGFLOAT_MAX);
CGSize fitSize = CTFramesetterSuggestFrameSizeWithConstraints(framesetter, CFRangeMake(0, [label.attributedText length]), NULL, targetSize, NULL);
CFRelease(framesetter);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.