Right mime type for SVG images with fonts embedded

HtmlSvgFont FaceMime Types

Html Problem Overview


This is the usual SVG mime type:

image/svg+xml

And it works great. However, when embedding an SVG font, chrome tells you the mime type is incorrect, obviously because you return a font instead of an image.

Is there any universal mime type? is chrome wrong? is application/svg+xml accepted somehow?

I guess this is still a gray area in HTML5 but someone here might know.

Html Solutions


Solution 1 - Html

There's only one registered mediatype for SVG, and that's the one you listed, image/svg+xml. You can of course serve SVG as XML too, though browsers tend to behave differently in some scenarios if you do, for example I've seen cases where SVG used in CSS backgrounds fail to display unless served with the image/svg+xml mediatype.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestioncmpliegerView Question on Stackoverflow
Solution 1 - HtmlErik DahlströmView Answer on Stackoverflow