UNPKG

@react-native-vector-icons/icomoon

Version:
39 lines (36 loc) 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = createIconSetFromIcoMoon; var _common = require("@react-native-vector-icons/common"); /** * Fontello icon set component. * Usage: <Fontello name="icon-name" size={20} color="#4F8EF7" /> */ // entries are optional because they can be derived from the config function createIconSetFromIcoMoon(config, postScriptNameOrOptions, fontFileNameParam) { const { postScriptName, fontFileName, fontSource, fontStyle } = typeof postScriptNameOrOptions === 'object' ? postScriptNameOrOptions : { postScriptName: postScriptNameOrOptions, fontFileName: fontFileNameParam }; const glyphMap = {}; config.icons.forEach(icon => { icon.properties.name.split(/\s*,\s*/g).forEach(name => { glyphMap[name] = icon.properties.code; }); }); const fontFamily = postScriptName || config.preferences.fontPref.metadata.fontFamily; return (0, _common.createIconSet)(glyphMap, { postScriptName: fontFamily, fontFileName: fontFileName || `${fontFamily}.ttf`, fontSource, fontStyle }); } //# sourceMappingURL=index.js.map