Step1: Choose your font and download it as *.ttf
Step2: Use 'Fontmin'(http://ecomfe.github.io/) to compress your font
Step3: Use (https://transfonter.org/) with 'Base64 encode on' to convert your compressed font
Step4: Download the converted zip file and copy the content in *.css to your index.wxss file (better at the bottom of the file cause it's pretty long).

 

之前在 https://github.com/ADu2021/GirlsDay0/pull/3/ 写小程序的时候总结的,现在搬过来免得以后找不到。

不过话说回来,如果能找到能在线访问的字体资源就没这么多事儿了,这种办法不仅要用户现下载(压缩版)字体,还要在每次改动内容之后重新生成字体base64,不适合大规模开发。

posted on 2022-06-02 21:54  Duyy  阅读(328)  评论(0编辑  收藏  举报