The font-spider tool is used to compress webfont web fonts

http://font-spider.org/

npm install font-spider -g

hyheilizhitij (Hanyi black lychee script)

// import

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

//use

.test{
            font-family: 'myfont';
        }

Run the font-spider command, the page-dependent fonts will be automatically compressed, and the original .ttf fonts will be backed up

font-spider ./index.html

//Original size: 1753.24 KB File fonts/HYHeiLiZhiTiJ.ttf created: 4.796 KB

//Effect

//complete code

<div class="test">
        账号未登录,请先登录的分身乏术地方发送
    </div>
    <style>
        @font-face{
            font-family: 'myfont';
            src:url('./fonts/HYHeiLiZhiTiJ.ttf') format('truetype');
            font-weight: normal;
            font-style: normal;
        }
        .test{
            font-family: 'myfont';
        }
    </style>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324936331&siteId=291194637