想把ttf格式的字体转换成woff格式的,但是在网上找了一下没有找到可以用的软件,在线的转换网站很多都不能用,不仅是因为网站打不开,因为中文字体文件大小都比较大,一些网站不支持大文件字体格式的转换。求好的ttf格式到woff格式的转换方法!

解决方案 »

  1.   

    https://github.com/jaywcjlove/svgtofont
    const { createSVG, createTTF, createEOT, createWOFF, createWOFF2 } = require("svgtofont/src/utils");
    const options = { ... };createSVG(options)
      .then(UnicodeObjChar => {
        return createTTF(options);
      })
      .then(() => {
        return createEOT(options);
      })
      .then(() => {
        return createWOFF(options);
      })
      .then(() => {
        return createWOFF2(options);
      })
    可以通过 node.js 来转换简单,可以转换多种格式