• 字蛛,抽取字体。让引用文件更小。


    字蛛是一个智能 WebFont 压缩工具,它能自动分析出页面使用的 WebFont 并进行按需压缩。

    官网

    http://font-spider.org/
    

    github

    https://github.com/aui/font-spider
    

    安装

    sudo npm install font-spider -g
    sudo ln -s /usr/local/nodejs/bin/font-spider /usr/local/bin
    
    # font-spider --version
    1.3.5
    

    使用

    创建好html

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>字体抽取</title>
    </head>
    <style>
        @charset "UTF-8";
        @font-face {
            font-family: 'huakang';
            src: url('../font/华康俪金黑W8.eot');
            src:
                url('../font/华康俪金黑W8.eot?#font-spider') format('embedded-opentype'),
                url('../font/华康俪金黑W8.woff') format('woff'),
                url('../font/华康俪金黑W8.ttf') format('truetype'),
                url('../font/华康俪金黑W8.svg') format('svg');
            font-weight: normal;
            font-style: normal;
        }
    
        /* @font-face {
            font-family: 'huakang';
            src: url('../font/华康俪金黑W8.ttf');
        } */
    
        .box {
            font-family: 'huakang';
        }
    </style>
    
    <body>
        <div class="box">
            扶贫公告政策二十条资讯动漫说
        </div>
    </body>
    
    </html>
    

  • 相关阅读:
    .NET Core 服务调用 RPC
    从Docker 到 Kubernatetes 的跃迁之路
    同步异步-多线程梳理
    Net的微服务选型之路
    Visual Studio 2019安装SSIS
    HL7协议的基本语法
    vue学习笔记
    开发常用的部分sql语句总结
    VSPD虚拟串口来调试通信接口程序
    SSRS报表工具之合并行数据
  • 原文地址:https://www.cnblogs.com/jiqing9006/p/13042500.html
Copyright © 2020-2023  润新知