SVG忽略自定义站点字体

时间:2016-08-31 19:28:51

标签: css svg fonts

问题:如果未在操作系统中安装自定义字体,则网页上的svg图像无法识别该字体。

研究:在网站上,我在kombinezonik.ru/fonts/futuris/FuturisC.otf有自定义字体。在CSS中,我在任何其他定义之前定义它如下:

@font-face {
  font-family: FuturisC;
  src: 
    local('FuturisC'),
    url("/fonts/futuris/FuturisC.otf")    ;
}

tr.navig a#hrefb37 {
  width: 85px;
  height: 42px;
  background-size: 70px 35px;
  background-image: url('/images/navig_b37.png');  
  background-image: url('/images/navig_b37.svg');
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.7;
}

我的SVG-image是:

<svg
  xmlns="http://www.w3.org/2000/svg"
  viewBox="0 0 145.683 84.904">
  <text
    y="26.982203"
    x="73.03183"
    style="
      font-weight:normal;
      font-size:40px;
      font-family:FuturisC;
      text-align:center;
      text-anchor:middle;"
    xml:space="preserve"><tspan 
    y="26.982203" x="73.03183">Мальчики</tspan><tspan 
    y="76.982201" x="73.03183">3-7 лет</tspan></text>
</svg>

问题:如何将FuturisC.otf字体应用于the SVG image

0 个答案:

没有答案