首页 > 解决方案 > 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- 字体嵌套在同一个文件夹中。

标签: csssvgfonts

解决方案


推荐阅读