Skip to content
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

How can I enable CORS for drawHtml? #211

Open
Shafaq19 opened this issue Apr 1, 2021 · 1 comment
Open

How can I enable CORS for drawHtml? #211

Shafaq19 opened this issue Apr 1, 2021 · 1 comment

Comments

@Shafaq19
Copy link

Shafaq19 commented Apr 1, 2021

I am using rasterizeHTML.drawHTML to draw html on a canvas but the font family is not displayed for the fonts I load from google api

@cburgmer
Copy link
Owner

If you are sure that this is a CORS issue, then I believe your only option is to set appropriate CORS headers is on the server side.

I also saw issues in the past, where fonts weren't always correctly rendered to canvas, as the browser might render the fonts a bit delayed, and the delay causes the update to be missed when drawn to the canvas. One way to double check is to use the resulting image and render that into the DOM (like https://github.com/cburgmer/rasterizeHTML.js/blob/master/test/manualIntegrationTestForWebkit.html#L121).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants