html2image icon indicating copy to clipboard operation
html2image copied to clipboard

how to use a custom font?

Open danielmari2 opened this issue 2 years ago • 2 comments

I'm trying to using a custom font but I'm not able to do so. I tried with google fonts using and it works, but when I try to add my custom font from a local file with @face-font it doesn't work.

Can someone share the code?

danielmari2 avatar Feb 12 '23 23:02 danielmari2

You can work around this by embedding it as base64: https://codepen.io/netsi1964/pen/mLWoaE

A solution would be to make a mechanism to pass these files so they can also be copied to the temp folder (Or you can maybe try to set your folder as the tmp folder)

BranislavBajuzik avatar Mar 05 '23 21:03 BranislavBajuzik

You can work around this by embedding it as base64: https://codepen.io/netsi1964/pen/mLWoaE

A solution would be to make a mechanism to pass these files so they can also be copied to the temp folder (Or you can maybe try to set your folder as the tmp folder)

I can confirm, have included it as base64 - and you get the correct font also in the screenshot.

einzelfabrik avatar Aug 14 '23 09:08 einzelfabrik