【发布时间】:2020-11-18 08:01:57
【问题描述】:
在将 google 字体 URL 添加到 SVG 时遇到解析错误。
字体是“NunitoSans-Regular”,我使用的网址是:
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans&display=swap');
这是相关的 SVG 标记:
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 376 150" style="enable-background:new 0 0 376 150;" xml:space="preserve">
<style type="text/css">
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans&display=swap');
.st0{fill:#EFC7C7;}
.st1{fill:#90EEE1;}
.st2{fill:#F15641;}
.st3{display:none;}
.st4{display:inline;}
.st5{font-family:'NunitoSans-Regular';}
.st6{font-size:45px;}
</style>
【问题讨论】:
标签: svg google-fonts