那里没有必要使用原来的字体名称。您可以在
font-family: "My Font"
中说 @font-face
,然后在元素 font-family
声明中使用该名称。
事实上,在这个例子中我使用的是“Imperial Script”字体。
@font-face {
font-family: "Sunny";
src: url(https://fonts.gstatic.com/s/imperialscript/v6/5DCPAKrpzy_H98IV2ISnZBbGrVNfOuPk.woff2) format('woff2');
}
body {
font-size: 30px;
font-family: "Sunny";
}
It's not necessary to use the original font name there. you might say `font-family: "My Font"` in `@font-face` and then use that name in your elements `font-family` declarations. In fact, in this example I'm using "Imperial Script" font.