1 | import createIconSet from './create-icon-set';
|
2 |
|
3 | export default function createIconSetFromIcoMoon(
|
4 | config,
|
5 | fontFamilyArg,
|
6 | fontFile
|
7 | ) {
|
8 | const glyphMap = {};
|
9 | config.icons.forEach(icon => {
|
10 | icon.properties.name.split(/\s*,\s*/g).forEach(name => {
|
11 | glyphMap[name] = icon.properties.code;
|
12 | });
|
13 | });
|
14 |
|
15 | const fontFamily =
|
16 | fontFamilyArg || config.preferences.fontPref.metadata.fontFamily;
|
17 |
|
18 | return createIconSet(glyphMap, fontFamily, fontFile || `${fontFamily}.ttf`);
|
19 | }
|