Using beautiful fonts applet micro letter:
There are several ways:
1. Convert the required font files into css base64 format, like Ali font icon iconfont use
In the font conversion website https://transfonter.org/, first the Add ` Fonts ,选中
Base64 encode ,
Formats 根据你的字体格式选择,一般是
TTF 格式,在选择
Convert`, get good compression package after conversion, you can get fonts css file after decompression, but in the micro-channel applet is not here apply, as the size of the applet must be packaged <2MB, css file thus obtained exceeds the volume limit, this approach is not feasible
2. Use wx.loadFontFace load external fonts
Documentation: https://developers.weixin.qq.com/miniprogram/dev/api/wx.loadFontFace.html
. 1 |
wx.loadFontFace({ |
3. disposed in wxss
1 |
/ * Network Load Font * / |