I'm having trouble incorporating a custom font into my PDF generated from HTML.
Although I successfully displayed the font in an HTML file, indicating that the font path is correct and it's being used properly, the .ttf font type doesn't render when converted to PDF according to the documentation on .
This is my current CSS styling:
@font-face {
font-family: "Swiss";
src: url("/static/font/swiss.ttf");
}
body {
font-family: "Swiss";
font-size: 12px;
}
And here's the HTML snippet:
<body>
asdf
</body>
Despite trying various solutions such as removing quotation marks from the font URL and family, ensuring proper HTML format with tags wrapping the body content, the conversion to PDF still does not display the custom font correctly. Can anyone assist me in identifying the issue?