I'm currently fighting with an issue of styling. I am creating a PDF using IronPDF and generating the new PDF from HTML.
I have an instance where my fonts are being overridden. The style is the following:
.bbBlankPage {
font-size: 20px; /*14 pt*/
text-align: center;
font-family: Arial !important;
font-weight: bold;
padding-top: 55%;
text-indent: 40px;
}
When the HTML is generated and spit out into the PDF, the PDF shows the font as ArialBold. This is causing an issue with the font looking smaller and scrunched up in comparison to the original. I'm trying to overcompensate by enlarging the font size but the change in font family has me stumped. If I remove font-weight, it becomes ArialRegular, which isn't right either. I just want normal Arial font.
I work for IronSoftware as a support engineer.
Try using a local font by importing it from a folder instead of using the system font installed on the system. This isn't perfect though gives a better result.
Code example below references Arial:
This issue will be resolved with a new rendering engine we are building for release in the first half of 2021.