首页 > 解决方案 > 将 Google 字体添加到 SVG 文件

问题描述

我一直在尝试将 Google 字体添加到我的 svg 文件中,因为我没有在我的 html 文件中使用它,而是作为图像使用它。我已经通过网站上的线程寻找解决方案,但它们似乎都不起作用。这是我的 svg 代码,任何帮助将不胜感激!:

<?xml version="1.0" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="0 0 289.226 867.666" width="289.226" height="867.666">

<defs>
<style xmlns="http://www.w3.org/2000/svg" type="text/css">
  @import url('http://fonts.googleapis.com/css?family=Raleway');
</style>
</defs>


<g>
    <g><path d=" M 144.613 0 C 64.746 0 0 64.745 0 144.612 C 0 224.479 64.746 289.222 144.613 289.222" fill="rgb(247,147,30)" /><line x1="144.613" y1="0" x2="144.613" y2="289.222"/><g transform="matrix(0,-1,1,0,84.879,191.611)"><text transform="matrix(1,0,0,1,0,28.2)" font-family="Raleway" style="font-family:'Raleway, sans-serif';font-weight:400;font-size:30px;font-style:normal;fill:#000000;stroke:none;">we3dx</text></g></g>
    <g><path d=" M 144.613 289.222 C 224.48 289.222 289.226 353.967 289.226 433.834 C 289.226 513.701 224.48 578.444 144.613 578.444" fill="rgb(247,147,30)" /><line x1="144.613" y1="289.222" x2="144.613" y2="578.444"/><g transform="matrix(0,1,-1,0,200.854,362.333)"><text transform="matrix(1,0,0,1,0,28.2)" style="font-family:'Raleway';font-weight:400;font-size:30px;font-style:normal;fill:#000000;stroke:none;">wooscape</text></g></g>
    <g><path d=" M 144.613 578.444 C 64.746 578.444 0 643.189 0 723.056 C 0 802.923 64.746 867.666 144.613 867.666" fill="rgb(247,147,30)"/><line x1="144.613" y1="578.444" x2="144.613" y2="867.666"/><g transform="matrix(0,-1,1,0,84.879,788.555)"><text transform="matrix(1,0,0,1,0,28.2)" style="font-family:'Raleway';font-weight:400;font-size:30px;font-style:normal;fill:#000000;stroke:none;">woostate</text></g></g>
</g>
</svg>

标签: svgwebfontsgoogle-font-api

解决方案


推荐阅读