React-native-vector-icons: Problem with custom icons using fontello

Created on 12 Aug 2016  Â·  5Comments  Â·  Source: oblador/react-native-vector-icons

I'm trying to setup a custom font with Fontello, and I couldn't make it work. I found the readme section for it confusing specially this section :

Don't forget to import the font as described above

I've downloaded the files including config.json from Fontello and wrote this :

import { createIconSetFromFontello } from 'react-native-vector-icons';
import fontelloConfig from '../../../data/icons/config.json';
const MyIcon = createIconSetFromFontello(fontelloConfig, 'mobile-icons');

<MyIcon name="my-notifications" color="black" />

adding the 'mobile-icons' didn't work, it says

Unrecognized font familly 'mobile-icons'

even though I have the correct font familly in config.json and in the css files associated.

Most helpful comment

Read under the Installation title.

All 5 comments

You must add the font itself to your application, see the documentation which states how to do this step by step.

@oblador can you please give me a link to that?

It's the front page of this project?

Sorry, I'm asking because I just didn't know how to do it, the only thing I found is :

import { createIconSet } from 'react-native-vector-icons';

const glyphMap = { 'icon-name': 1234, test: '∆' };
const Icon = createIconSet(glyphMap, 'FontName');
import { createIconSetFromFontello } from 'react-native-vector-icons';
import fontelloConfig from './config.json';

const Icon = createIconSetFromFontello(fontelloConfig);

I added the font name, like this :

const Icon = createIconSetFromFontello(fontelloConfig, 'font-name');

and didn't worked :(

Am I missing something?

Read under the Installation title.

Was this page helpful?
0 / 5 - 0 ratings