Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
react-native-iconic-font
Advanced tools
Use iconic font in a simple way.
compile 'com.facebook.react:react-native:0.16.+'
install module
npm install --save react-native-iconic-font
setp 2 and 3 are same as offical way to use custom font.
copy font file
node_modules/react-native-iconic-font/fonts/
[project root]/android/app/src/main/assets/fonts/
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.
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!
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.
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
2015.11.24: * add material-design-icons
FAQs
Use iconic font in a simple way.
The npm package react-native-iconic-font receives a total of 7 weekly downloads. As such, react-native-iconic-font popularity was classified as not popular.
We found that react-native-iconic-font demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.