0

I would like to use the following icon webfont in React Native: @mdi/light-font

I'm using @oblador/react-native-vector-icons to manage my web fonts. I don't use Expo.

Currently I have used the .svg exports of @mdi/light-font and repackaged it as a custom font with Fontello. Then I used react-native-vector-icons helper function to import Fontello.

And suddenly I have the feeling that I'm making my life much more difficult with no reasons.

I've seen that there is a ttf file I could push to android. However I don't find how to import a glyphMap.

Any idea ?

Thanks

Xiiryo
  • 3,021
  • 5
  • 31
  • 48
  • 1
    I'm not really sure how React Native works as I've never used it but couldn't you just use @mdi/react with @mdi/light-js? We really advise against using webfonts for icons where possible, though if you're making your own subset it shouldn't be as bad for users as importing the full font file. – James Coyle Sep 06 '20 at 09:34
  • Hi @JamesCoyle, thanks for your feedback. It is interesting. What would you use rather than a font? .svg files? – Xiiryo Sep 06 '20 at 10:58
  • 1
    We offer @mdi/js and @mdi/light-js which give you the SVG paths for all icons as javascript strings. You can then use those paths directly in code. For react native I think you can use something like the [react-native-svg-icon](https://www.npmjs.com/package/react-native-svg-icon) package to render these paths. Our paths are all designed for a 24x24 viewbox. – James Coyle Sep 06 '20 at 15:23
  • Thanks, I get it. Yes, it is more straightforward. – Xiiryo Sep 06 '20 at 17:19

0 Answers0