npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-iconic-font

v0.0.6

Published

Use iconic font in a simple way.

Downloads

10

Readme

react-native-iconic-font

Use iconic font in a simple way.

Usage

Notice:android library add custom font supports in v0.16,so make sure your native dependency is above it:

compile 'com.facebook.react:react-native:0.16.+'

  1. install module
    npm install --save react-native-iconic-font

    setp 2 and 3 are same as offical way to use custom font.

  2. copy font file

  3. import to use

var icon = require('react-native-iconic-font/fontawesome');

...

React.createClass({
  render: function() {
  //FontFamily perproty value must same as font file name.
    return (
       <Text style={{fontFamily: 'fontawesome',fontSize:30}}> 
                twitter-icon:{icon('twitter')}
       </Text>
    );
  }
});

reload js , you'll see the icon there.

##Icon Fonts Font-awesome
foundation-icons
ionicons
octicons
typicons
weathericons material-design-icons ...

In fact,it will be so easy to use any iconic font after you read this article.

What's the difference?

There are already some good solutions to use iconic font :
https://github.com/oblador/react-native-vector-icons
https://github.com/lwhiteley/react-native-android-iconify
https://github.com/corymsmith/react-native-icons

But ... these libraries are all require native code and/or native project config file modifications.
Believe me , it confusd many 'javascript' developers who are familar with 'native code'.
That's why i start this project .
No native code. Let's try to use pure javascript!

How

A font system is basically a 'character-graph' mapping.
In a web page,CSS rules deal with webfont like this:

<i class="fa-twitter">
==CSS rules==> .fa-twitter:before{content: "\f099";} 
                                 ==font system==>  a twitter graph

It's same process in React native except the CSS rules.That's what this project do.Mapping names to characters.

Besides I create a command tool to help transforming CSS file to these mapping module.

Run one command to generate the js module
iconmap -f test/font-awesome-v4.4.0.css -p '^\.fa-([a-z0-9-]+?):before$'
Read more: https://github.com/sospartan/iconfont-map-builder

Changelog

2015.11.24: * add material-design-icons