【发布时间】:2020-06-10 19:50:35
【问题描述】:
我正在使用来自谷歌的自定义字体的 svg,但我自己托管它。这是the SVG file,代码如下:
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="430" height="590">
<defs>
<style type="text/css"><![CDATA[
@font-face {
font-family: 'Fjalla';
src: url('http://build-podcast.com/fonts/fjalla.eot');
src: url('http://build-podcast.com/fonts/fjalla.eot?#iefix') format('embedded-opentype'),
url('http://build-podcast.com/fonts/fjalla.woff') format('woff'),
url('http://build-podcast.com/fonts/fjalla.ttf') format('truetype'),
url('http://build-podcast.com/fonts/fjalla.svg#fjalla') format('svg');
font-weight: normal;
font-style: normal;
}
text { font-family: Fjalla, sans-serif; font-weight: bold; fill: #4b5568; }
]]>
</style>
</defs>
<g id="logo">
<text x="135" y="60" font-size="210" transform="rotate(45)">/</text>
<text x="115" y="363" font-size="210" transform="rotate(-45)">\</text>
<text x="15" y="341" font-size="200">build</text>
<text x="15" y="475" font-size="127">podcast</text>
<text x="21" y="540" font-size="36">screencasts on tech tools</text>
</g>
</svg>
我正在使用img 标签在main website 上显示它
<img src="logo.svg">
它在桌面浏览器甚至 Android Chrome 等移动浏览器上都能正常显示。但它在 iOS 7 Chrome 或 Android 中根本不显示。关于如何修改自定义字体部分的 SVG 文件代码的任何线索?谢谢!
【问题讨论】:
-
为简单起见,我已将其转换为路径,它适用于所有桌面和移动浏览器。不过,这是一种解决方法。