tsayen / dom-to-image

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

Doesn't work with Font Awesome, Material Icons from Google, etc. #57

Open mortenmoulder opened 8 years ago

mortenmoulder commented 8 years ago

https://jsfiddle.net/sscm9nr7/

It generates the DOM element perfectly. CSS works just as it should. However, the text doesn't work. When I try this in Angular Material with <md-icon>add</md-icon> for instance, the add text gets included, but it has a default font (like Times New Roman).

With FontAwesome... Well, it's all squares.

https://jsfiddle.net/sscm9nr7/

mortenmoulder commented 8 years ago

Fixed. Loading the CSS externally doesn't seem to work, so including the Material Icons directly inside the CSS works fine: https://jsfiddle.net/sLc2kcwy/3/

tsayen commented 8 years ago

This problem might be related to #13. I looked at it yesterday and I suspect a bug, as the style inlining didn't seem to work as expected.

mortenmoulder commented 8 years ago

@tsayen Oh yeah. It's definitely a bug which could be fixed, but a workaround is also working. Not sure why I closed it though.

IgorKurkov commented 3 years ago

Unfortunately workaround not work for icons from elements kits like angular material where we have components like mat-icon... last fiddle is old. Any updates?