问题
I'm using a data URI with my SVG markup and sticking it in the src attribute of an <img> tag. Works fine in FireFox, but in Chrome/Safari I lose the font support.
See here: http://jsfiddle.net/3vhR7/
Is there a workaround for this such that I can still use <img> instead of <embed> or <object>?
EDIT: I submitted this to caniuse.com and they confirmed it as a bug
回答1:
Why can't you use an object tag? It's easy and super fun.
<object type="image/svg+xml" data="chart.svg">
<img src="fallback.png" alt="No SVG Support"/>
</object>
YAY! (the Monty Python version)
来源:https://stackoverflow.com/questions/15194870/is-there-a-workaround-to-get-proper-font-support-in-svg-loaded-in-an-img-tag-i