nuke-iconfont
v2.3.12
Published
iconfont
Downloads
161
Readme
Iconfont
- category: API
- chinese: iconfont
- type: API
Design
This component provides a static method to define an icon font set. SVG icons is not supported by now.
Notice: This feature is experientmental and if font source is a remote ttf file, icons may not be rendered at the first time page showing. To avoid conflicts of network and icon render, we sugguest to use pictures instead , or pre-load font files (You can also integrate them into app source).
API
Iconfont
Iconfont({
name: 'your-unique-font-name',
url: 'https://at.alicdn.com/t/font_1474198576_7440977.ttf'
});
// \u mode,code must be variable
const code = '\ue60f';
<Text style={{ fontSize: 40, fontFamily: 'your-unique-font-name' }}>{code}</Text>;
// or
<Text style={{ fontSize: 40, fontFamily: 'your-unique-font-name' }}></Text>;
options
- options.name : iconfont name, for example 'your-unique-font-name'
- options.url : iconfont path, currently support
ttf
andwoff
formatUnicode
const { formatUnicode } = Iconfont;
formatUnicode(''); // \ue600
Transform icon html code into unicode to fit both weex and web