exupero / saveSvgAsPng

Save SVGs as PNGs from the browser.
MIT License
1.09k stars 362 forks source link

How to use fonts in options parameter. #243

Open mtcanada opened 4 years ago

mtcanada commented 4 years ago

By default, the font for the text is 'serif', but i would like to use 'san-serif' font. How should I do it? i don't know what to use for text. url and format parameter for the parameter since there is no sample.

exupero commented 4 years ago

Use regular CSS to change the font. The fonts option is for webfonts, which you shouldn't need just to get a sans serif font in your output image.

mkpasala commented 4 years ago

its better to add the syntax of all the options available for the saveimageasPNG.js so that users can easily understand and use it. I want to add 'Titillium Web' fonts to my downloading file, how can i do that? Please help me.

andrius-386 commented 4 years ago

Hi @mkpasala. Yes, fonts section could have more examples. I've added example for Google fonts that worked for me: https://github.com/exupero/saveSvgAsPng/issues/240#issuecomment-613270106