Skip to content

Commit 0ac65da

Browse files
committed
Move glyph map to fonts dir
1 parent bc0d91e commit 0ac65da

File tree

8 files changed

+31
-1264
lines changed

8 files changed

+31
-1264
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ typings/
129129
.next
130130

131131
### Customize
132+
fonts/
133+
132134
package-lock.json
133135
yarn.lock
134136

.npmignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.editorconfig
2-
.gitignore
3-
.npmignore
4-
generate-icon.js
1+
.*
2+
3+
script/
4+
test/

fonts/Ionicons.ttf

-188 KB
Binary file not shown.

glyph/index.js renamed to glyph.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import glyphs from "./map.json";
2-
3-
export const UNKNOWN_ICON = "";
1+
import map from "./fonts/Ionicons.json";
42

53
/**
64
* Try glyph
@@ -11,12 +9,10 @@ export const UNKNOWN_ICON = "";
119
*/
1210
export function tryGlyph(iconNames, mapper) {
1311
const code = iconNames.reduce((prev, name) => {
14-
return prev || glyphs[name in glyphs ? name : mapper(name)];
12+
return prev || map[name in map ? name : mapper(name)];
1513
}, undefined);
1614

1715
return code ? String.fromCharCode(code) : UNKNOWN_ICON;
1816
}
1917

20-
/**
21-
* @typedef
22-
*/
18+
export const UNKNOWN_ICON = "";

0 commit comments

Comments
 (0)