I have a firebase function that generates and returns a pdf blob.
Locally, and using firebase serve, I can use a font loaded from a url and locally.
On firebase, the font is not ever loaded. I have tried variations of this in my template.html
<style>
@import url('./fonts/helvetica-neue.ttf'); and
@import url('http://somewebsite.com/fonts/helvetica-neue.ttf');
@import url('https://somewebsite.com/fonts/helvetica-neue.ttf');
body > * {
font-family: 'Helvetica Neue', sans-serif;
font-weight: regular;
}
</style>
I have also tried importing google fonts using the link tag. This does not work either.
Remember firebase serve and locally installed Node works fine and the font is fetched and used.
There are no errors in firebase logs.
Has anyone had success loading a custom font using firebase functions? I am using node-html-pdf to generate the pdf. The pdf generates fine, but it uses DevaVu Sans font (I assume this is standard san-serif font on Firebase)