-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathIconFont.h
79 lines (66 loc) · 2.7 KB
/
IconFont.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//
// FontAwesome.h
// FontAwesomeTools-iOS is Copyright 2013 TapTemplate and released under the MIT license.
// www.taptemplate.com
//
#import "FontHeader.h"
@interface IconFont : NSObject
//================================
// Font and Label Methods
//================================
+(NSString *)icon:(NSString *)iconName fromFont:(NSString *)fontName;
/*! Get the FontAwesome font.
*/
+ (UIFont*)font:(NSString *)fontName withSize:(CGFloat)size;
/*! Make a sized-to-fit UILabel containing an icon in the given font size and color.
*/
+ (UILabel*)labelWithIcon:(NSString*)fa_icon
fontName:(NSString *)name
size:(CGFloat)size
color:(UIColor*)color;
/*! Adjust an existing UILabel to show a FontAwesome icon.
*/
+ (void)label:(UILabel*)label
fontName:(NSString *)name
setIcon:(NSString*)fa_icon
size:(CGFloat)size
color:(UIColor*)color
sizeToFit:(BOOL)shouldSizeToFit;
+ (UIButton*)buttonWithIcon:(NSString*)fa_icon
fontName:(NSString *)name
size:(CGFloat)size
color:(UIColor*)color;
+ (void)button:(UIButton *)button
fontName:(NSString *)name
setIcon:(NSString*)fa_icon
size:(CGFloat)size
color:(UIColor*)color;
//================================
// Image Methods
//================================
/*! Create a UIImage with a FontAwesome icon, with the image and the icon the same size
*/
+ (UIImage*)imageWithIcon:(NSString*)fa_icon
fontName:(NSString *)name
iconColor:(UIColor*)iconColor
iconSize:(CGFloat)iconSize;
+(void)registerFontWithDict:(NSDictionary*)resDict;
+(void)loadFontList;
+(void)logFontList;
/*! Create a UIImage with a FontAwesome icon, and specify a square size for the icon, which will be centered within the CGSize specified for the image itself.
*/
+ (UIImage*)imageWithIcon:(NSString*)fa_icon
fontName:(NSString *)name
iconColor:(UIColor*)color
iconSize:(CGFloat)iconSize
imageSize:(CGSize)imageSize;
/*! The image and the icon inside it can be from a custom font:
*/
+ (UIImage*)imageWithText:(NSString*)characterCodeString
font:(UIFont*)font
iconColor:(UIColor*)iconColor
imageSize:(CGSize)imageSize;
/*! NOTE: This method is deprecated! Use -imageWithIcon:iconColor:iconSize: instead. It does exactly the same thing, but I got fed up with it not matching the phrasing of the second UIImage creation method.
*/
+ (UIImage*)imageWithIcon:(NSString*)fa_icon fontName:(NSString *)name size:(CGFloat)size color:(UIColor*)color __attribute__((deprecated));
@end