Skip to content

Commit

Permalink
Add Ant Design icons (oblador#757)
Browse files Browse the repository at this point in the history
* add support for Ant Design fonts

* Automatically build antd icons

* add AntDesign icons to directory & IconExplorer

* add AntDesign.ttf to IconExplorer ios Info.plist

* Add AntDesign to IconExplorer iOS project

* Update build script to automate builds

* Remove @bodhiveggie/antd-icons dependency
  • Loading branch information
BodhiHu authored and oblador committed Sep 30, 2018
1 parent 1d3462e commit 2e3a87e
Show file tree
Hide file tree
Showing 11 changed files with 353 additions and 1 deletion.
18 changes: 18 additions & 0 deletions AntDesign.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* AntDesign icon set component.
* Usage: <AntDesign name="icon-name" size={20} color="#4F8EF7" />
*/

import createIconSet from './lib/create-icon-set';
import glyphMap from './glyphmaps/AntDesign.json';

const iconSet = createIconSet(glyphMap, 'AntDesign', 'AntDesign.ttf');

export default iconSet;

export const Button = iconSet.Button;
export const TabBarItem = iconSet.TabBarItem;
export const TabBarItemIOS = iconSet.TabBarItemIOS;
export const ToolbarAndroid = iconSet.ToolbarAndroid;
export const getImageSource = iconSet.getImageSource;

4 changes: 4 additions & 0 deletions Examples/IconExplorer/icon-sets.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { pipe, toPairs, groupBy, map } from 'ramda';
import AntD from 'react-native-vector-icons/AntDesign';
import Entypo from 'react-native-vector-icons/Entypo';
import EvilIcons from 'react-native-vector-icons/EvilIcons';
import Feather from 'react-native-vector-icons/Feather';
Expand All @@ -10,6 +11,7 @@ import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
import Octicons from 'react-native-vector-icons/Octicons';
import Zocial from 'react-native-vector-icons/Zocial';
import AntDGlyphs from 'react-native-vector-icons/glyphmaps/AntDesign.json';
import EntypoGlyphs from 'react-native-vector-icons/glyphmaps/Entypo.json';
import EvilIconsGlyphs from 'react-native-vector-icons/glyphmaps/EvilIcons.json';
import FeatherGlyphs from 'react-native-vector-icons/glyphmaps/Feather.json';
Expand All @@ -23,6 +25,7 @@ import OcticonsGlyphs from 'react-native-vector-icons/glyphmaps/Octicons.json';
import ZocialGlyphs from 'react-native-vector-icons/glyphmaps/Zocial.json';

const GLYPH_MAPS = {
AntD: AntDGlyphs,
Entypo: EntypoGlyphs,
EvilIcons: EvilIconsGlyphs,
Feather: FeatherGlyphs,
Expand All @@ -37,6 +40,7 @@ const GLYPH_MAPS = {
};

const ICON_SETS = {
AntD,
Entypo,
EvilIcons,
Feather,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
2F10F11996C0402EB56569E2 /* FontAwesome5_Brands.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D4C141BCA6BA4C4D922EF937 /* FontAwesome5_Brands.ttf */; };
2EC1267F4B324ECC82A7E290 /* FontAwesome5_Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5AA0772371A344AAB1E6DEEB /* FontAwesome5_Regular.ttf */; };
54BFE6E0DAD14AAB82ACA819 /* FontAwesome5_Solid.ttf in Resources */ = {isa = PBXBuildFile; fileRef = AE5689FEB9FE4EFCA6F0E9CF /* FontAwesome5_Solid.ttf */; };
C67CA2B25E5A4722B26E706D /* AntDesign.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 2C91AF3E61164A169AFBB568 /* AntDesign.ttf */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -373,6 +374,7 @@
D4C141BCA6BA4C4D922EF937 /* FontAwesome5_Brands.ttf */ = {isa = PBXFileReference; name = "FontAwesome5_Brands.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
5AA0772371A344AAB1E6DEEB /* FontAwesome5_Regular.ttf */ = {isa = PBXFileReference; name = "FontAwesome5_Regular.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
AE5689FEB9FE4EFCA6F0E9CF /* FontAwesome5_Solid.ttf */ = {isa = PBXFileReference; name = "FontAwesome5_Solid.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
2C91AF3E61164A169AFBB568 /* AntDesign.ttf */ = {isa = PBXFileReference; name = "AntDesign.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -654,6 +656,7 @@
D4C141BCA6BA4C4D922EF937 /* FontAwesome5_Brands.ttf */,
5AA0772371A344AAB1E6DEEB /* FontAwesome5_Regular.ttf */,
AE5689FEB9FE4EFCA6F0E9CF /* FontAwesome5_Solid.ttf */,
2C91AF3E61164A169AFBB568 /* AntDesign.ttf */,
);
name = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -1119,6 +1122,7 @@
2F10F11996C0402EB56569E2 /* FontAwesome5_Brands.ttf in Resources */,
2EC1267F4B324ECC82A7E290 /* FontAwesome5_Regular.ttf in Resources */,
54BFE6E0DAD14AAB82ACA819 /* FontAwesome5_Solid.ttf in Resources */,
C67CA2B25E5A4722B26E706D /* AntDesign.ttf in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
1 change: 1 addition & 0 deletions Examples/IconExplorer/ios/IconExplorer/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<true/>
<key>UIAppFonts</key>
<array>
<string>AntDesign.ttf</string>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>Feather.ttf</string>
Expand Down
Binary file added Fonts/AntDesign.ttf
Binary file not shown.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Perfect for buttons, logos and nav/tab bars. Easy to extend, style and integrate

[Browse all](https://oblador.github.io/react-native-vector-icons/).

* [`AntDesign`](https://ant.design/) by AntFinance (**297** icons)
* [`Entypo`](http://entypo.com) by Daniel Bruce (**411** icons)
* [`EvilIcons`](http://evil-icons.io) by Alexander Madyankin & Roman Shamin (v1.10.1, **70** icons)
* [`Feather`](http://feathericons.com) by Cole Bemis & Contributors (v4.7.0, **266** icons)
Expand Down
2 changes: 2 additions & 0 deletions directory/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';

import './App.css';

import AntD from '../../glyphmaps/AntD.json';
import Entypo from '../../glyphmaps/Entypo.json';
import EvilIcons from '../../glyphmaps/EvilIcons.json';
import Feather from '../../glyphmaps/Feather.json';
Expand All @@ -19,6 +20,7 @@ import SimpleLineIcons from '../../glyphmaps/SimpleLineIcons.json';
import Zocial from '../../glyphmaps/Zocial.json';

const IconFamilies = {
AntD,
Entypo,
EvilIcons,
Feather,
Expand Down
Loading

0 comments on commit 2e3a87e

Please sign in to comment.