tsayen / dom-to-image

Generates an image from a DOM node using HTML5 canvas
Other
10.21k stars 1.68k forks source link

How to use self hosted font files #423

Open ardiansyaherwin opened 1 year ago

ardiansyaherwin commented 1 year ago

Hi, in the readme is mentioned about using font by converting the font files to Data URL and apply it to style props.

Any example on how to do that?

I'm creating a png file, so I used toPNG.

Any advice is really welcomed