I'm having a nestjs project and want to generate server side pdf using notice.ejs template. And I have a ttf font Debrosee-ALPnL and want to apply this font to all the <h2> element inside the html template.
I'm importing the ttf font in notice.ejs file as follows:-
<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
font-family: "newfont";
src: url("../files_ttf/Debrosee-ALPnL.ttf");
}
h2 {
font-family: "newfont";
}
</style>
</head>
<body>
<h2>Some text</h2>
</body>
</html>
But here the problem is I'm able to generate the pdf out of this template, but the font is not applied to the pdf.
The folder/file structure is as follows:-
-- assets
|-- files_ttf
|-- Debrosee-ALPnL.ttf
|-- templates
|-- notice.ejs
I tried solutions from multiple post on how to import .ttf file, but none of them seems to work for me. What could be the issue for the font not applying?