Giter Club home page Giter Club logo

fontawesomeiconfactory's Introduction

FontAwesomeIconFactory

A factory for turning Font Awesome icons into images for user interface controls. Works for iOS and OS X.

Font Awesome was created by Dave Gandy. http://fortawesome.github.com/Font-Awesome

FontAwesomeIconFactory was created by Nikolaj Schumacher.

OS X ≥ 10.7 iOS ≥ 6.0 CocoaPods compatible Carthage compatible

Build Status

screenshot Interface Builder screenshot OS X screenshot iOS

Setup

CocoaPods

Add the following to your Podfile:

pod 'FontAwesomeIconFactory'

Then run pod install as usual.

Changes

3.0

  • Updates Font Awesome to version 4.2.0 for new and changed icons.
  • Full annotations for better Swift names
  • Fixes bar button icon default rendering mode

2.1.0

  • Fixes a naming regression in the Swift version of the enum.

2.1

  • Updates Font Awesome to version 4.2.0 for new and changed icons.
  • Fixed for usage with Xcode 7.

2.0.2

  • FontAwesome is now a proper framework and supports Carthage.

2.0.1

2.0

  • Updates Font Awesome to version 4.3.0 for new and changed icons.
  • Annotated for nicer use in Swift.
  • Support for adding icons to iOS controls in Interface Builder.

1.4

  • Updates Font Awesome to version 4.2.0 for new and changed icons.

1.3

  • Updates Font Awesome to version 4.0.3 for new and changed icons.
  • On iOS 7 renderingMode is now adjusted automatically when setting a color.

1.2.1

  • Updates Font Awesome to version 3.2.1.
  • Butter support for iOS 7 by allowing to override renderingMode.

1.2

  • Updates Font Awesome to version 3.2 for new and changed icons.
  • The images now actually have the exact height (and width if square is set) specified in the size property. Get the old behavior (where the image is only as high as needed) by setting padded to NO. The predefined factories have been adjusted in size.

1.1

  • Updates Font Awesome to version 3.1.1 for 54 new icons.

1.0.1

  • Removes the need to modify the Info.plist.

fontawesomeiconfactory's People

Contributors

badjeff avatar nschum 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

fontawesomeiconfactory's Issues

tabBarItemIconFactory.colors does't work on iOS7

I tried to set the icon color to white (for nav-bar item), it works on iOS6, but doesn't work on iOS7

NIKFontAwesomeIconFactory* f = [NIKFontAwesomeIconFactory tabBarItemIconFactory];
f.colors = @[[UIColor whiteColor]];
c.createImageForIcon ...

"invalid context 0x0" and images are not displayed

Are you sure a valid graphic context is present when a nib/xib is loaded? I'm getting a lot of these errors, and the image isn't displayed:

<Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextScaleCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextSetFillColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextDrawPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextScaleCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextSetFillColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextDrawPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextScaleCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextSetFillColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextDrawPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextScaleCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextSetFillColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextDrawPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextScaleCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextSetFillColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextDrawPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextScaleCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextSetFillColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextDrawPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

Note that I'm using the simulator, but I still think it should work. This happens on both iOS 9 and iOS 8 simulators. I'm setting a UIImageView to be a NIKFontAwesomeImageView in IB.

How to use FontAwesomeIconFactory with other class?

I wonder to know how to use FontAwesomeIconFactory and other library/class at the same time. For example, I need to create a button and I set a button effect class in its custom class in storyboard. However, I also need to use FontAwesomeIconFactory to generate the image for this button. How can I do that? I have tried to use NIKFontAwesomeImageView to create the image and than assign to the button.image but it failed. Thank you.

pod install error

[!] Invalid `Podfile` file: [!] Unsupported options `{:exclusive=>true}` for target `FontAwesomeIconFactoryTests`..

 #  from /Users/yuanfengfeng/Downloads/FontAwesomeIconFactory/Podfile:4
 #  -------------------------------------------
 #  
 >  target 'FontAwesomeIconFactoryTests', :exclusive => true do
 #    platform :ios, "6.0"
 #  -------------------------------------------

[!] xcodeproj was renamed to `project`. Please use that from now on.

saw this when I tried : pod install

Symbol not found pre iOS 9

The library works fine on iOS 9, but crashes at startup on iOS 8 with the following error:

dyld: Symbol not found: _NSDictionary0
Referenced from: /xxx/FontAwesomeIconFactory.framework/FontAwesomeIconFactory (which was built for iOS 9.0)

Any thoughs on this?

'NIKFontAwesomeIconTypes.h' file not found

I try to use FontAwesomeIconFactory in my project using CocoaPods.

But it fails with the following error message:
/Pods/Headers/Public/FontAwesomeIconFactory/NIKFontAwesomeIconTraits.h:1:9:'NIKFontAwesomeIconTypes.h' file not found

The file 'NIKFontAwesomeIconTypes.h' is not included in Pods/Headers/Public/FontAwesomeIconFactory

Other components can be used successfully from CocoaPods in the same app.

size attribute not accurate

The images generated by FontAwesomeIconFactory do not match the size attribute.

I modified the demo project as such:

- (void)setupButtons {
    NIKFontAwesomeIconFactory *factory = [NIKFontAwesomeIconFactory buttonIconFactory];
    NIKFontAwesomeIcon icon = NIKFontAwesomeIconGlass;
    factory.size = 15.0;
    for (UIButton *button in _buttons) {
        if (icon == NIKFontAwesomeIconHeart) {
            factory.colors = @[[UIColor redColor], [UIColor blackColor]];
        } else {
            factory.colors = @[[NIKColor darkGrayColor]];
        }
        UIImage *image = [factory createImageForIcon:icon];
        NSLog(@"size = %f, actual height = %f", factory.size, image.size.height);
        [button setImage:[factory createImageForIcon:icon] forState:UIControlStateNormal];
        [button setTitle:@"Hello" forState:UIControlStateNormal];
        icon++;
        factory.size += 1.0;
    }
}

and received the following output:

2013-05-25 13:02:20.570 FontAwesomeIconFactoryDemo[4985:c07] size = 15.000000, actual height = 16.500000
2013-05-25 13:02:20.572 FontAwesomeIconFactoryDemo[4985:c07] size = 16.000000, actual height = 17.500000
2013-05-25 13:02:20.573 FontAwesomeIconFactoryDemo[4985:c07] size = 17.000000, actual height = 18.500000
2013-05-25 13:02:20.574 FontAwesomeIconFactoryDemo[4985:c07] size = 18.000000, actual height = 16.500000
2013-05-25 13:02:20.574 FontAwesomeIconFactoryDemo[4985:c07] size = 19.000000, actual height = 19.500000
2013-05-25 13:02:20.575 FontAwesomeIconFactoryDemo[4985:c07] size = 20.000000, actual height = 21.000000
2013-05-25 13:02:20.576 FontAwesomeIconFactoryDemo[4985:c07] size = 21.000000, actual height = 22.000000
2013-05-25 13:02:20.576 FontAwesomeIconFactoryDemo[4985:c07] size = 22.000000, actual height = 22.000000
2013-05-25 13:02:20.577 FontAwesomeIconFactoryDemo[4985:c07] size = 23.000000, actual height = 25.000000
2013-05-25 13:02:20.578 FontAwesomeIconFactoryDemo[4985:c07] size = 24.000000, actual height = 22.000000
2013-05-25 13:02:20.579 FontAwesomeIconFactoryDemo[4985:c07] size = 25.000000, actual height = 23.000000
2013-05-25 13:02:20.579 FontAwesomeIconFactoryDemo[4985:c07] size = 26.000000, actual height = 24.000000
2013-05-25 13:02:20.580 FontAwesomeIconFactoryDemo[4985:c07] size = 27.000000, actual height = 21.000000
2013-05-25 13:02:20.581 FontAwesomeIconFactoryDemo[4985:c07] size = 28.000000, actual height = 22.000000
2013-05-25 13:02:20.581 FontAwesomeIconFactoryDemo[4985:c07] size = 29.000000, actual height = 31.500000
2013-05-25 13:02:20.582 FontAwesomeIconFactoryDemo[4985:c07] size = 30.000000, actual height = 30.000000
2013-05-25 13:02:20.583 FontAwesomeIconFactoryDemo[4985:c07] size = 31.000000, actual height = 34.000000
2013-05-25 13:02:20.583 FontAwesomeIconFactoryDemo[4985:c07] size = 32.000000, actual height = 35.000000

Using custom fonts

Do you have any plan for extending your library to use custom fonts like FontAwesomeKit library? Right now it is quite limited for fontawesome only

Thanks!

Example project doesn't include FontAwesome.otf

After checking out source from here and running example project, this error shows up:

(null): error: /PATH_TO/Font-Awesome/fonts/FontAwesome.otf: No such file or directory

It persists even after dragging FontAwesome.otf into the project.

Adding pod 'FontAwesomeIconFactory to the Podfile and updating didn't help.

I assume you want the demo project to work out of the box? Let me know if there's something else I can try.

The idea of running the demo project is to see how the API works as you've constructed it. I'd like to do this before installing in my project... thanks

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.