UNPKG

expo-vector-icons

Version:

Built-in support for popular icon fonts and the tooling to create your own Icon components from your font and glyph map. This is a wrapper around react-native-vector-icons to make it compatible with Expo.

20 lines (16 loc) 491 B
import createIconSet from './create-icon-set'; export default function createIconSetFromIcoMoon( config, fontFamilyArg, fontFile, ) { const glyphMap = {}; config.icons.forEach(icon => { icon.properties.name.split(/\s*,\s*/g).forEach(name => { glyphMap[name] = icon.properties.code; }); }); const fontFamily = fontFamilyArg || config.preferences.fontPref.metadata.fontFamily; return createIconSet(glyphMap, fontFamily, fontFile || `${fontFamily}.ttf`); }