New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FontAwesome icons are not rendered in firefox only #314
Comments
Could you setup an example on jsfiddle? |
Ran into the same problem with a custom icon font. It works in Safari and Chrome but doesn't work in Firefox and IE. |
Did some digging and made it work in Firefox 26 and IE 11. The problem is the following line: https://github.com/niklasvh/html2canvas/blob/master/src/Parse.js#L951 I'll try to explain why it's happening. Some of my assumptions might be wrong so feel free to correct me. It seems that in non-webkitbrowser the object that gets returned by getComputedStyles only sets the numeric properties To fix it you can replace the for (var prop in elStyle) {
if (indexedProperty(prop) && prop !== 'cssText') {
// Prevent assigning of read only CSS Rules, ex. length, parentRule
try {
elps.style[prop] = elStyle[prop];
} catch (e) {
h2clog(['Tried to assign readonly property ', prop, 'Error:', e]);
}
}
} The reason why I am checking Hope this helps. |
@Enome this is very good, although I still have not tested, please send an "Pull Request". Thanks! 👍 |
Font icons are rendering fine in chrome but not in firefox. It just renders as a box. niklasvh#314
Did @Enome ever make a pull request on this topic? I'm currently using his code as a workaround. |
@fpslater I never made a pull request. If I remember correctly I went away from trying to convert html -> canvas and started using svg instead. |
FontAwesome also fails to render for me in webkit browsers like Chrome and PhantomJS |
@kmdavis Have you tried html2canvas v0.5? |
We are currently using html2canvas v0.5.0-alpha |
Could you provide a simple example on jsfiddle where the issue can be replicated or does http://jsfiddle.net/3ub69/52/ not work for you? |
I'm having this problem also. How do I upgrade to html2canvas v0.5? I feel silly asking this, but I don't see such a branch or tag on this repo. Thanks in advance. |
PS I'm using html2canvas via rails-assets with
|
From what I see at https://rails-assets.org/components only versions <= 0.4.1 are available for rails-assets. So I've simply added the latest dist/html2canvas.js to my |
@sweetleon Try swapping your https://github.com/fpslater/fix-html2canvas-webkit-font-conversion |
@sweetleon Oh nevermind, you've already found a workaround ;-) |
I'mhaving the same problem |
The problem with fontawesome still happens in version 'html2canvas 1.0.0-alpha.12' |
Any solution? Thanks |
The problem with fontawesome still happens in version 'html2canvas 1.0.0-rc.5 |
FontAwesome http://fontawesome.io/ icons are rendering fine in chrome but not in firefox. It just renders a box.
The text was updated successfully, but these errors were encountered: