網(wǎng)友評(píng)分:
5分
FontSpider是一款中文字體壓縮器,讓網(wǎng)頁(yè)自由引入中文字體成為可能。字蛛通過(guò)分析本地 CSS 與 HTML 文件獲取 WebFont 中沒(méi)有使用的字符,并將這些字符數(shù)據(jù)從字體中刪除以實(shí)現(xiàn)壓縮,同時(shí)生成跨瀏覽器使用的格式。
先安裝好 NodeJS,然后執(zhí)行:
npm install font-spider -g
在 CSS 中使用 WebFont:
/*聲明 WebFont*/
@font-face {
font-family: 'pinghei';
src: url('../font/pinghei.eot');
src:
url('../font/pinghei.eot?#font-spider') format('embedded-opentype'),
url('../font/pinghei.woff') format('woff'),
url('../font/pinghei.ttf') format('truetype'),
url('../font/pinghei.svg') format('svg');
font-weight: normal;
font-style: normal;
}
/*使用選擇器指定字體*/
.home h1, .demo > .test {
font-family: 'pinghei';
}
1. @font-face 中的 src 定義的 .ttf 文件必須存在,其余的格式將由工具自動(dòng)生成
2. 開(kāi)發(fā)階段請(qǐng)使用相對(duì)路徑的 CSS 與 WebFont
標(biāo)簽: 字體壓縮器
關(guān)于本站|下載幫助|下載聲明|軟件發(fā)布|聯(lián)系我們
Copyright ? 2005-2024 www.wndwig.cn.All rights reserved.
浙ICP備2024132706號(hào)-1 浙公網(wǎng)安備33038102330474號(hào)