iconfont
- category: API
- chinese: iconfont
- type: API
---
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).
``js
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';
// or
`
#### options
- options.name : iconfont name, for example 'your-unique-font-name'
- options.url : iconfont path, currently support ttf and woff
`js``
const { formatUnicode } = Iconfont;
formatUnicode(''); // \ue600
Transform icon html code into unicode to fit both weex and web