css - SVG - 自定义字体不适用
问题描述
这是我的 svg 文件,我正在尝试使用自定义字体。但不起作用。有人帮我吗?
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="79" height="48" viewBox="0 0 79 48"><defs><style>@font-face {
font-family: 'MyriadPro-Regular';
src:url('MyriadPro-Regular.woff');
}.a{fill:none;}.b{clip-path:url(#a);}.c{fill:#fff;font-size:14px;letter-spacing:0.01em;}</style><clipPath id="a"><rect class="a" width="79" height="48"/></clipPath></defs><g class="b"><text font-family="MyriadPro-Regular" class="c" transform="translate(0 13)"><tspan x="0" y="0">ASSESSMENT</tspan><tspan x="0" y="16">OPERATING</tspan><tspan x="0" y="32">SYSTEM</tspan></text></g></svg>
MyriadPro-Regular.woff
- 字体嵌套在同一个文件夹中。
解决方案
推荐阅读
- c# - Amazon Linux 2 上的 .NET 5.0 ASP.NET Web 服务器启动错误:“System.UnauthorizedAccessException:对路径 '/root/.dotnet' 的访问被拒绝。”
- burp - Burp Suite 专业版。一段时间后如何重复相同的扫描?
- python - django.db.utils.IntegrityError:NOT NULL 约束失败:app_user.zip
- java - Apache Spark 在使用 spark-submit 时抛出 java.net.UnknownHostException: hera01
- python - 我更改了一些代码,KeyError 为 0。但它无法正常工作
- swift - AppCenter Swift 包管理器依赖项导入失败
- java - 如何解决 Netbeans 12.0 IllegalAccessError?
- sql - 如何通过 SSMS 连接到 SQL Server 并且不了解命名约定?
- moodle - 项目具有不同范围时的加权平均聚合
- java - 如何在存档文件中提取 .Z 文件?(未定义)大小但在 android studio java 中未损坏