Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack icons into a composite image #12

Merged
merged 1 commit into from
Feb 9, 2014

Conversation

alexshepard
Copy link
Contributor

It would be lovely to be able to stack multiple icons into the same image. Each icon could have a different color, alpha, shape and size, and the resulting image would be a composite of the various icons. In this way, we can create FAKIcons that have varying transparencies within the icon, as well as different colors within the icon. I don't know if others will use this, but I need it for my project! :)

@PrideChung
Copy link
Owner

Hi, Alex

Thanks for your pull request but stacked icons looks like a rarely used feature to me and I prefer not to merge this pull request. As I stressed before I want to keep FAK tiny because I believe reusable components are better than a giant library try to solve everything,

I recommend that you put your code into a factory object like StackedIconsFactory which inherited from NSObject. If you want to use this feature in multiple projects and want to share to others, you can create your own pod and mark FontAwesomeKit as it's dependency.

@alexshepard
Copy link
Contributor Author

Hi Pride,

Stacked icons are part of the FontAwesome project that FAK is named after. http://fortawesome.github.io/Font-Awesome/examples/#stacked
I'm not sure I understand why an implementation of FontAwesome on iOS wouldn't support them.

If you look at the stacked examples on the FontAwesome project page, how are icons like fa-ban, fa-square, and fa-circle supposed to be useful in FontAwesomeKit if they can't be stacked with other icons?

Best,
alex

@PrideChung
Copy link
Owner

OK I'm convinced that this is an useful feature, but putting stackedImageWithIcons:(NSArray *)icons withSize:(CGSize)imageSize in FAKIcon makes me feel a little bit weird since it doesn't return a FAKIcon instance, and every FAKIcon subclass will have access to it. would it be more appropriate to make an UIImage category, or just make a FAKUtils class?

@alexshepard
Copy link
Contributor Author

I understand your feeling about this implementation being weird.

FAK is your project, so I would be happy to follow your suggestion and make it whatever way that you'd prefer. :)

Best,
alex

PrideChung added a commit that referenced this pull request Feb 9, 2014
stack icons into a composite image
@PrideChung PrideChung merged commit 7869fc3 into PrideChung:master Feb 9, 2014
@lynchseattle
Copy link

@alexshepard - So how does this work? I saw this was merged but can't seem to get it to do anything (note, I'm using Swift).

@alexshepard
Copy link
Contributor Author

@lynchseattle - Pride transitioned this feature into a UIImage category (which in my opinion looks much nicer than the way I originally coded it).

In objective-c:

FAKIcon *pinBG = [FAKIonIcons iosLocationIconWithSize:25];
[pinBG addAttribute:NSForegroundColorAttributeName value:[UIColor grayColor]];
FAKIcon *pinFG = [FAKIonIcons iosLocationOutlineIconWithSize:25];
[pinFG addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor]];
 UIImage *pinStacked = [UIImage imageWithStackedIcons:@[pinBG, pinFG] imageSize:CGSizeMake(25, 25)];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants