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
Doesn't working with Google Fonts #59
Comments
I'm also having fonts changed in the image, using 'open sans' font.
It seems to replace open sans with another font. |
I've run into this as well. It looks like webfonts aren't being included as part of the SVG. I've modified @ralharabi's fiddle to make it easier to access the SVG: https://jsfiddle.net/kuou44ry/ One workaround I've found is that including the contents of the Webfont into your app's CSS seems to work: https://jsfiddle.net/heycr5em/ I've done a little research and it looks like it's possible to include webfonts within an SVG. I'm not sure just yet how it should be approached in this library, but this does seem like a solvable problem. |
Thanks, it's work with me |
Example of workaround for Google fonts:
|
Thanks! |
@MichalBryxi stopped working in Chrome =/ |
@TiagoRocha1985 Yes the same for me with latest Chrome. And that's not the only regression I encountered. I believe there is something really wrong in Chrome-67. In Safari, it works still ok. |
@MichalBryxi For me in firefox still works!! Is it possible to find another solution to get back to working in chrome? |
No idea @TiagoRocha1985. Haven't dug into that one yet. But for me not only the fonts are an issue. So I suspect that it's something bigger. |
Then it will be the way to use the html2canvas for the chrome. If you find out something, I'll let you know @MichalBryxi |
FYI: Looks like some of the forks have patches: fireworkz@bd1ccfd. So I forked the repo and cherry-picked everything that looked nice here: https://github.com/MichalBryxi/dom-to-image (no guarantee) |
thank you brother! Yes, it worked! Many, many thanks! |
Many thanks to the fork of @MichalBryxi , it worked fine |
https://github.com/MichalBryxi/dom-to-image |
I'm trying this fix but I get a CORS error. The error doesn't appear in the regular js file (updated a year ago) from the src folder. Any idea why? |
Can you check with anonymous attribute? |
@sentika The branch I provided is consumable via npm. You just need to point directly on GitHub: https://stackoverflow.com/questions/16350673/depend-on-a-branch-or-tag-using-a-git-url-in-a-package-json As I'm not a maintainer, I can't integrate it into a build. |
Thank you @MichalBryxi. |
Excellent, solved a bug with Google Fonts. Thanks |
@MichalBryxi thanks for your hard work, however, I got the issues with using your version with adobe fonts (typekit) There are two ways to import adobe fonts, one of them is put the in the head of your app, the other way is to put the script like this: <script src="https://use.typekit.net/xxxxxxx.js"></script> <script>try{Typekit.load({ async: true });}catch(e){}</script>-- Because I'm developing a Chinese web, I need to do the script one. I tried the script of google font it works ok and the link tag of adobe font it also works fine. But it doesn't work when I importing adobe font by script. Any thoughts? |
@Hinrick I might take a look if you provide jsbin where (a) you have working example with "standard" fonts and (b) your non-working example. Quick search showed me that this PR might have the necessary code: #118 If that is proven true by testing on your example, I could integrate it to my branch as well. |
Thanks :) |
It works! :) But do you have any idea that how it can be done dynamically without copy & paste? |
Never mind. I found the below way to achieve it.
|
https://jsfiddle.net/3Lu1xpxh/
It generates the DOM element without applying the element font as it's show. I'm not sure if there is limitation with some types of fonts or there are another way to apply the element font
https://jsfiddle.net/3Lu1xpxh/
The text was updated successfully, but these errors were encountered: