PDF Creator节点总是显示斜体



我使用PDF -creator-node包从HTML生成PDF。但是,当它显示时,我的文本总是显示斜体即使我没有设置它为font-style:italic。我试着用font-style:normal !important;到我的身体和HTML,但它仍然不起作用。有人知道怎么解决这个问题吗?谢谢您,先生,非常感谢。

编辑:

这是我的css

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<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=Playfair+Display:wght@400;500&family=Sacramento&display=swap" rel="stylesheet">
<style>
body,
html {
margin: 0;
padding: 0;
height: 100%;
font-family: 'Playfair Display', serif;
font-style: normal !important;
}
body {
color: black;
display: table;
font-size: 24px;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
margin: 0 auto;
}
.container {
width: 900px;
display: table-cell;
vertical-align: middle;
background-image: linear-gradient(45deg, #f4f4ff, #eee);
padding: 3rem;
position: relative;
}
.container img.bg-sertifikat {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
}
.container .front{
position: relative;
z-index: 1;
}
.logo {
color: #5A8DEE;
margin-bottom: 3rem;
}
.marquee {
color: #000;
font-size: 48px;
margin: 20px;
font-weight: bold;
}
.assignment {
margin: 20px;
}
.person {
border-bottom: 1px solid #000000;
font-size: 3rem;
padding-bottom: .5rem;
font-family: 'Sacramento', cursive;
font-weight: normal;
}
.class-name {
margin-top: 2rem;
font-weight: bold;
font-size: 1rem;
font-weight: 400;
}
.info {
margin-top: 3rem;
font-family: 'Playfair Display', serif;
padding: 1rem 5rem;
}
.info .date-wrapper{
float: left;
margin-top: 1rem;
}
.info .signature-wrapper{
float: right;
}
.info .date-wrapper,
.info .signature-wrapper {
display: flex;
flex-direction: column;
font-size: 1rem;
}
.info .date-wrapper div:nth-child(1),
.info .signature-wrapper img {
border-bottom: 1px solid #000;
padding-bottom: .5rem;
}
.info .date-wrapper div {
margin: .2rem 0;
}
.info .signature-wrapper div {
margin: .2rem 0;
}
</style>
</head>

在样式表中导入Google Open Sans字体

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;700;800&display=swap');

然后,使用这个作为你的主要字体族选项

* {
font-family: 'Open Sans', Arial, sans-serif;
}

最新更新