库HTML-PDF提供字体为斜体样式
我使用HTML-PDF将HTML转换为PDF。但是,当我包含我的字体AS
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap" rel="stylesheet">
并在CSS中写入时:
html {
font-family: 'Poppins', sans-serif;
font-weight: 400;
font-size: 14px;
}
它使我的字体成为斜体。但是在html中,它是正常的字体。如何解决?我尝试了字体面,它不起作用
I use html-pdf to convert my html to pdf. But when I include my font as
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap" rel="stylesheet">
And write in css:
html {
font-family: 'Poppins', sans-serif;
font-weight: 400;
font-size: 14px;
}
It renders my font as italic. But in HTML it is normal font. How to solve it? I tried font-face, it did not work
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论