1. download the font file .ttf file and the introduction of:
2. font.css file, the path to the downloaded font file introduction:
@font-face {
font-family: 'PMZD';
src: url('PMZD.ttf');
font-weight: normal;
font-style: normal;
}
3. font.css introduced in the style you want to use it:
@import "../less/font/font.css";
4. webpack configuration file to add the rule to resolve .ttf file:
module: {
rules: [
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
}