1、上传ttf文件进行转换的网站地址:
转换地址:https://www.fontsquirrel.com/tools/webfont-generator
然后在网站上进行下载
2、stylesheet.css默认生成在下载文件夹中。把整个下载的文件夹复制进入项目。
3、在main.js中引入
import '@/assets/font/DS-DIGIT/stylesheet.css'
4、stylesheet.css中的内容:
@font-face {
font-family: 'ds-digitalbold_italic';
src: url('ds-digit-webfont.woff2') format('woff2'),
url('ds-digit-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}