shrhdk / text-to-svg

Convert text to SVG path without native dependence.
Other
974 stars 131 forks source link

Access denied in Internet Explorer 11 #48

Closed GuiRitter closed 5 years ago

GuiRitter commented 5 years ago

Hi everyone.

I've experienced an error when trying to use this library in Internet Explorer in an app created with create-react-app.

Apart from having to use serve to see the app working in IE (as npm start seems to be broken right now), when I try to run load, I get an Access denied error.

I can't say where the source of the error is because, when I follow the error line and column in the console, the script is minified.

More information in the test project I created.

Thanks in advance.

shrhdk commented 5 years ago

Thank you for your detailed bug report.

I'm sorry for that I can not verify your test app because I am not familiar to React and I don't have Windows environment.

In your project, the font file is encoded in Data URI Scheme.

However, it seems that Internet Explorer does not support application/font-ttf in Data URI Scheme.

https://docs.microsoft.com/en-us/previous-versions//cc848897(v=vs.85)

Data URIs are supported only for the following elements and/or attributes.

  • object (images only)
  • img
  • input type=image
  • link
  • CSS declarations that accept a URL, such as background, backgroundImage, and so on.
GuiRitter commented 5 years ago

Thanks for the response. I replaced the data URI by the same font loading method as demonstrated in the project's README.md and confirmed that that works in IE.

Darn, who would've thought? Each day I'm more appalled by the lack of standard in these standards...

Seeing as this is not a text-to-svg issue, I'm closing it. Thanks again.