<div id="printMe">
<h1>这是一段话</h1>
</div>
@font-face {
font-family: 'FZBS';
src: url('FZBS.ttf');
font-weight: normal;
font-style: normal;
}
h1 {
font-family: 'FZBS';
color: red;
}
printJS({
printable: 'printMe',
type: 'html',
style: `
@font-face {
font-family: 'FZBS';
src: url('FZBS.ttf');
font-weight: normal;
font-style: normal;
}
h1 {
font-family: 'FZBS';
color: red;
}
`
})
这是我目前的写法,打印时字体不生效