前提python
1.安装
npm install font-spider -g
2.下载字体文件
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div class="Calculus">123456789%</div>
</body>
</html>
<style>
/*声明 WebFont*/
@font-face {
font-family: 'Calculus';
src: url('../font/pinghei.eot');
src:
url('../CalculusRegular/CalculusLCDOblique.eot?#font-spider') format('embedded-opentype'),
url('../CalculusRegular/CalculusLCDOblique.woff') format('woff'),
url('../CalculusRegular/CalculusLCDOblique.ttf') format('truetype'),
url('../CalculusRegular/CalculusLCDOblique.svg') format('svg');
font-weight: normal;
font-style: normal;
}
/*使用选择器指定字体*/
.Calculus{
font-family: 'pinghei';
}
</style>
4.>font-spider test.html
网友评论