Skip to content

Commit

Permalink
Adding support for Octicons
Browse files Browse the repository at this point in the history
  • Loading branch information
corymsmith committed Nov 12, 2015
1 parent e3a418a commit 157d9c2
Show file tree
Hide file tree
Showing 12 changed files with 845 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Example/example.xcodeproj/project.pbxproj
Expand Up @@ -20,6 +20,7 @@
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
2F46E3BD1BF53F2E007EB20D /* octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 2F46E3BC1BF53F2E007EB20D /* octicons.ttf */; };
2F4DA3581ACE2DDC00CC8346 /* libReactNativeIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F4DA3551ACE2DCD00CC8346 /* libReactNativeIcons.a */; };
2F615A2D1B698A5B004A7B1D /* Material-Design-Iconic-Font.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 2F615A2C1B698A5B004A7B1D /* Material-Design-Iconic-Font.ttf */; };
2FF956361B707F51003A2F9E /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2FF956331B707CA0003A2F9E /* libRCTWebSocket.a */; };
Expand Down Expand Up @@ -120,6 +121,7 @@
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = iOS/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = iOS/main.m; sourceTree = "<group>"; };
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
2F46E3BC1BF53F2E007EB20D /* octicons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = octicons.ttf; path = "node_modules/react-native-icons/ios/ReactNativeIcons/Libraries/FontAwesomeKit/octicons.ttf"; sourceTree = "<group>"; };
2F4DA34F1ACE2DCD00CC8346 /* ReactNativeIcons.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactNativeIcons.xcodeproj; path = "node_modules/react-native-icons/ios/ReactNativeIcons.xcodeproj"; sourceTree = "<group>"; };
2F615A2C1B698A5B004A7B1D /* Material-Design-Iconic-Font.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Material-Design-Iconic-Font.ttf"; path = "../../FontAwesomeKit_forked/FontAwesomeKit/Material-Design-Iconic-Font.ttf"; sourceTree = "<group>"; };
2FF956271B707CA0003A2F9E /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../Example/node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -203,6 +205,7 @@
13B07FAE1A68108700A75B9A /* example */ = {
isa = PBXGroup;
children = (
2F46E3BC1BF53F2E007EB20D /* octicons.ttf */,
2F615A2C1B698A5B004A7B1D /* Material-Design-Iconic-Font.ttf */,
CE90A3421B50803400CB0E5D /* FontAwesome.otf */,
CE90A3431B50803400CB0E5D /* foundation-icons.ttf */,
Expand Down Expand Up @@ -455,6 +458,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2F46E3BD1BF53F2E007EB20D /* octicons.ttf in Resources */,
CE90A3481B50803400CB0E5D /* ionicons.ttf in Resources */,
008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
Expand Down
14 changes: 13 additions & 1 deletion Example/index.ios.js
Expand Up @@ -133,7 +133,7 @@ var Example = React.createClass({
</View>

<Text style={styles.header}>
{'Material Icons'}
{'Spinners'}
</Text>

<View style={styles.topContainer}>
Expand Down Expand Up @@ -165,6 +165,13 @@ var Example = React.createClass({
style={[styles.twitterIcon, {backgroundColor: 'transparent'}]}/>
</Icon>

<Icon
name='octicons|alert'
size={40}
color='black'
style={styles.alert}
/>

<Text style={styles.header}>
{'Create social sign in buttons'}
</Text>
Expand Down Expand Up @@ -243,6 +250,11 @@ var styles = StyleSheet.create({
height: 70,
margin: 10
},
alert: {
width: 70,
height: 70,
margin: 10
},
twitterOutline: {
flexDirection: 'column',
width: 70,
Expand Down
Binary file not shown.
164 changes: 164 additions & 0 deletions fonts/octicons.json
@@ -0,0 +1,164 @@
{
"alert": "&#xf02d",
"arrow-down": "&#xf03f",
"arrow-left": "&#xf040",
"arrow-right": "&#xf03e",
"arrow-small-down": "&#xf0a0",
"arrow-small-left": "&#xf0a1",
"arrow-small-right": "&#xf071",
"arrow-small-up": "&#xf09f",
"arrow-up": "&#xf03d",
"beaker": "&#xf0dd",
"bell": "&#xf0de",
"book": "&#xf007",
"bookmark": "&#xf07b",
"briefcase": "&#xf0d3",
"broadcast": "&#xf048",
"browser": "&#xf0c5",
"bug": "&#xf091",
"calendar": "&#xf068",
"check": "&#xf03a",
"checklist": "&#xf076",
"chevron-down": "&#xf0a3",
"chevron-left": "&#xf0a4",
"chevron-right": "&#xf078",
"chevron-up": "&#xf0a2",
"circle-slash": "&#xf084",
"circuit-board": "&#xf0d6",
"clippy": "&#xf035",
"clock": "&#xf046",
"cloud-download": "&#xf00b",
"cloud-upload": "&#xf00c",
"code": "&#xf05f",
"color-mode": "&#xf065",
"comment": "&#xf02b",
"comment-discussion": "&#xf04f",
"credit-card": "&#xf045",
"dash": "&#xf0ca",
"dashboard": "&#xf07d",
"database": "&#xf096",
"desktop-download": "&#xf0dc",
"device-camera": "&#xf056",
"device-camera-video": "&#xf057",
"device-desktop": "&#xf27c",
"device-mobile": "&#xf038",
"diff": "&#xf04d",
"diff-added": "&#xf06b",
"diff-ignored": "&#xf099",
"diff-modified": "&#xf06d",
"diff-removed": "&#xf06c",
"diff-renamed": "&#xf06e",
"ellipsis": "&#xf09a",
"eye": "&#xf04e",
"file-binary": "&#xf094",
"file-code": "&#xf010",
"file-directory": "&#xf016",
"file-media": "&#xf012",
"file-pdf": "&#xf014",
"file-submodule": "&#xf017",
"file-symlink-directory": "&#xf0b1",
"file-symlink-file": "&#xf0b0",
"file-text": "&#xf011",
"file-zip": "&#xf013",
"flame": "&#xf0d2",
"fold": "&#xf0cc",
"gear": "&#xf02f",
"gift": "&#xf042",
"gist": "&#xf00e",
"gist-secret": "&#xf08c",
"git-branch": "&#xf020",
"git-commit": "&#xf01f",
"git-compare": "&#xf0ac",
"git-merge": "&#xf023",
"git-pull-request": "&#xf009",
"globe": "&#xf0b6",
"graph": "&#xf043",
"heart": "&#x2665",
"history": "&#xf07e",
"home": "&#xf08d",
"horizontal-rule": "&#xf070",
"hubot": "&#xf09d",
"inbox": "&#xf0cf",
"info": "&#xf059",
"issue-closed": "&#xf028",
"issue-opened": "&#xf026",
"issue-reopened": "&#xf027",
"jersey": "&#xf019",
"key": "&#xf049",
"keyboard": "&#xf00d",
"law": "&#xf0d8",
"light-bulb": "&#xf000",
"link": "&#xf05c",
"link-external": "&#xf07f",
"list-ordered": "&#xf062",
"list-unordered": "&#xf061",
"location": "&#xf060",
"lock": "&#xf06a",
"logo-github": "&#xf092",
"mail": "&#xf03b",
"mail-read": "&#xf03c",
"mail-reply": "&#xf051",
"mark-github": "&#xf00a",
"markdown": "&#xf0c9",
"megaphone": "&#xf077",
"mention": "&#xf0be",
"milestone": "&#xf075",
"mirror": "&#xf024",
"mortar-board": "&#xf0d7",
"mute": "&#xf080",
"no-newline": "&#xf09c",
"octoface": "&#xf008",
"organization": "&#xf037",
"package": "&#xf0c4",
"paintcan": "&#xf0d1",
"pencil": "&#xf058",
"person": "&#xf018",
"pin": "&#xf041",
"plug": "&#xf0d4",
"plus": "&#xf05d",
"primitive-dot": "&#xf052",
"primitive-square": "&#xf053",
"pulse": "&#xf085",
"question": "&#xf02c",
"quote": "&#xf063",
"radio-tower": "&#xf030",
"repo": "&#xf001",
"repo-clone": "&#xf04c",
"repo-force-push": "&#xf04a",
"repo-forked": "&#xf002",
"repo-pull": "&#xf006",
"repo-push": "&#xf005",
"rocket": "&#xf033",
"rss": "&#xf034",
"ruby": "&#xf047",
"screen-full": "&#xf066",
"screen-normal": "&#xf067",
"search": "&#xf02e",
"server": "&#xf097",
"settings": "&#xf07c",
"shield": "&#xf0e1",
"sign-in": "&#xf036",
"sign-out": "&#xf032",
"squirrel": "&#xf0b2",
"star": "&#xf02a",
"stop": "&#xf08f",
"sync": "&#xf087",
"tag": "&#xf015",
"telescope": "&#xf088",
"terminal": "&#xf0c8",
"three-bars": "&#xf05e",
"thumbsdown": "&#xf0db",
"thumbsup": "&#xf0da",
"tools": "&#xf031",
"trashcan": "&#xf0d0",
"triangle-down": "&#xf05b",
"triangle-left": "&#xf044",
"triangle-right": "&#xf05a",
"triangle-up": "&#xf0aa",
"unfold": "&#xf039",
"unmute": "&#xf0ba",
"versions": "&#xf064",
"watch": "&#xf0e0",
"x": "&#xf081",
"zap": "&#x26A1"
}
Binary file added fonts/octicons.ttf
Binary file not shown.
8 changes: 8 additions & 0 deletions iOS/ReactNativeIcons.xcodeproj/project.pbxproj
Expand Up @@ -18,6 +18,7 @@
2F343ACF1AE46C28002B3539 /* FAKIcon.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F343ABD1AE46C28002B3539 /* FAKIcon.m */; };
2F343AD01AE46C28002B3539 /* FAKIonIcons.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F343ABF1AE46C28002B3539 /* FAKIonIcons.m */; };
2F343AD11AE46C28002B3539 /* FAKZocial.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F343AC11AE46C28002B3539 /* FAKZocial.m */; };
2F46E3B11BF53CE6007EB20D /* FAKOcticons.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F46E3B01BF53CE6007EB20D /* FAKOcticons.m */; settings = {ASSET_TAGS = (); }; };
2F615A3A1B698A87004A7B1D /* FAKMaterial.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F615A371B698A87004A7B1D /* FAKMaterial.m */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -61,6 +62,9 @@
2F343AC41AE46C28002B3539 /* foundation-icons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "foundation-icons.ttf"; sourceTree = "<group>"; };
2F343AC51AE46C28002B3539 /* ionicons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = ionicons.ttf; sourceTree = "<group>"; };
2F343AC61AE46C28002B3539 /* zocial-regular-webfont.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "zocial-regular-webfont.ttf"; sourceTree = "<group>"; };
2F46E3AE1BF53CE6007EB20D /* octicons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = octicons.ttf; sourceTree = "<group>"; };
2F46E3AF1BF53CE6007EB20D /* FAKOcticons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FAKOcticons.h; sourceTree = "<group>"; };
2F46E3B01BF53CE6007EB20D /* FAKOcticons.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FAKOcticons.m; sourceTree = "<group>"; };
2F5A3EB81ACDBF8000439386 /* libReactNativeIcons.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReactNativeIcons.a; sourceTree = BUILT_PRODUCTS_DIR; };
2F615A371B698A87004A7B1D /* FAKMaterial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FAKMaterial.m; sourceTree = "<group>"; };
2F615A381B698A87004A7B1D /* FAKMaterial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FAKMaterial.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -125,6 +129,9 @@
2F343AB71AE46C28002B3539 /* FontAwesomeKit */ = {
isa = PBXGroup;
children = (
2F46E3AE1BF53CE6007EB20D /* octicons.ttf */,
2F46E3AF1BF53CE6007EB20D /* FAKOcticons.h */,
2F46E3B01BF53CE6007EB20D /* FAKOcticons.m */,
2F615A371B698A87004A7B1D /* FAKMaterial.m */,
2F615A381B698A87004A7B1D /* FAKMaterial.h */,
2F615A391B698A87004A7B1D /* Material-Design-Iconic-Font.ttf */,
Expand Down Expand Up @@ -224,6 +231,7 @@
2F343AC71AE46C28002B3539 /* FAKIconImage.m in Sources */,
2F343ACB1AE46C28002B3539 /* SMXTabBarItemManager.m in Sources */,
2F343ACA1AE46C28002B3539 /* SMXTabBarItem.m in Sources */,
2F46E3B11BF53CE6007EB20D /* FAKOcticons.m in Sources */,
2F615A3A1B698A87004A7B1D /* FAKMaterial.m in Sources */,
2F343AD11AE46C28002B3539 /* FAKZocial.m in Sources */,
2F343ACE1AE46C28002B3539 /* FAKFoundationIcons.m in Sources */,
Expand Down
2 changes: 2 additions & 0 deletions iOS/ReactNativeIcons/FAKIconImage/FAKIconImageManager.m
Expand Up @@ -46,6 +46,8 @@ - (UIView *)view
target = [FAKFoundationIcons class];
} else if([fontPrefix isEqualToString:@"material"]) {
target = [FAKMaterial class];
} else if([fontPrefix isEqualToString:@"octicons"]) {
target = [FAKOcticons class];
}

SEL selector = NSSelectorFromString([NSString stringWithFormat:@"%@IconWithSize:",[self camelcase:iconIdentifier]]);
Expand Down
Expand Up @@ -8,5 +8,6 @@
#import "FAKZocial.h"
#import "FAKIonIcons.h"
#import "FAKMaterial.h"
#import "FAKOcticons.h"

#endif

0 comments on commit 157d9c2

Please sign in to comment.