zoukankan      html  css  js  c++  java
  • 字蛛,抽取字体。让引用文件更小。

    字蛛是一个智能 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>
    

  • 相关阅读:
    JS函数
    JS数据类型
    JavaScript HTML DOM
    JavaScript-HTML
    HTML基础知识
    数据库--事务:级联删除(学生教师信息表)为例
    javascript window.open
    设置DIV半透明CSS代码:
    css实现你的网页图片半透明效果
    html中,如何打开index.html后可以自动打开另一个页面?
  • 原文地址:https://www.cnblogs.com/jiqing9006/p/13042500.html
Copyright © 2011-2022 走看看