【发布时间】:2017-07-01 21:19:56
【问题描述】:
我正在尝试将新字体文件添加到我的网络应用程序。我找不到在 @font-face 规则中添加 svg 文件的完美语法。我的字体规则是 scss 格式。以下是那些。
@font-face {
font-family: "Brandon";
src: asset_url("#{$font-reg}.eot");
src:
asset_url("#{$font-reg}.eot?#iefix") format("embedded-opentype"),
asset_url("#{$font-reg}.woff2") format("woff2"),
asset_url("#{$font-reg}.woff") format("woff"),
asset_url("#{$font-reg}.ttf") format("truetype"),
asset_url("#{$font-reg}.svg#svgFontName") format("svg");
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "Brandon";
src: asset_url("#{$font-bold}.eot");
src:
asset_url("#{$font-bold}.eot?#iefix") format("embedded-opentype"),
asset_url("#{$font-bold}.woff2") format("woff2"),
asset_url("#{$font-bold}.woff") format("woff"),
asset_url("#{$font-bold}.ttf") format("truetype"),
asset_url("#{$font-bold}.svg#svgFontName") format("svg");
font-weight: 700;
font-style: normal;
}
对于上面的 svg 文件,我需要在“#”之后添加什么。我很迷惑。非常感谢任何帮助。
【问题讨论】: