小程序引入外部字体怎么实现呢?
发布于 5 年前 作者 jun34 1314 次浏览 来自 官方Issues

小程序引入外部字体,用https://transfonter.org/转成了base64,然后把.css改成.wxss,但是报错 something must be wrong ,我想是因为包太大了,该怎么办呢

4 回复

@font-face {

  font-family‘wzjfont’;  /* project id 1037261 */

  srcurl(https://xxx/font.ttfformat(‘truetype’),

  url(‘https://xxx/font.woff’format(‘woff’),

  url(‘https://xxx/font.woff2’format(‘truetype’),

  url(‘https://xxx/font.svg#wzjfont’format(‘svg’);

}

使用wx.loadFontFace,字体链接 自己下载下来,传到cdn上

回到顶部