乘风破浪 激流勇进
你好!欢迎来看Tuziki !

小工具——字体包子集在线抽取

上传字体包:

拖拽文件到这里 or 点击上传
1、当前只支持ttf格式的字体文件上传,每次只能传一个字体包
2、另外有些字体包本身是有编码格式问题,无法在这个工具使用抽取,可以更换其它字体包试试

    输入文字:

    26 字

    字体预览:

    0% 本地字体包正在加载
    这是一个Web在线字体包子集抽取工具,欢迎使用!!!

    使用示例:

    @font-face {
      font-family: 'CustomFont';
      src: url('../assets/fonts/CustomFont.ttf') format('truetype');
      font-style: normal;
      font-weight: normal;
    }
    

    工具介绍:

    可实现字体子集的在线抽取,打出精简版的子集字体包文件,使用百度 Fontmin-v0.2.0做工程集成:

    官网:http://ecomfe.github.io/fontmin/

    Github:https://github.com/ecomfe/fontmin

    const Fontmin = require("fontmin");
    var rename = require("gulp-rename");
    const fontmin = new Fontmin()
        .src(localTTFPath)
        .dest(destPath)
        // .use(Fontmin.ttf2svg()) // 转换为 WOFF 格式
        .use(
            Fontmin.glyph({
            text: words,
            hinting: true, // keep ttf hint info (fpgm, prep, cvt). default = true
            })
        )
        .use(rename(`${fontName}-lite.ttf`));
    
    fontmin.run(async function (err, files) {
        if (err) {
            console.error(err);
        }
        // console.log(files[0]);
    });
    


    标签:小工具
    返回列表
    返回顶部←