我用GothamBook和GothamBold在我的网站。 GothamBook正确渲染,但没有GothamBold,只有在Safari。
我不知道为什么大胆不渲染...
@font-face {
font-family: 'Gotham HTF';
src: url("font/GothamHTF-Book.woff") format("woff");
url("font/GothamBook.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Gotham HTF';
src: url("font/Gotham-Bold.woff") format("woff"),
url("font/Gotham-Bold.woff2") format("woff2"),
url("font/Gotham-Bold.ttf") format("truetype");
font-weight: bold;
font-style: normal;
}
我找到了解决办法。老版本的Safari浏览器不支持此类型声明的。我需要不同的名称来声明字体:
@font-face {
font-family: 'Gotham HTF';
src: url("font/GothamHTF-Book.woff") format("woff");
url("font/GothamBook.ttf") format("truetype");
}
@font-face {
font-family: 'Gotham HTF Bold';
src: url("font/Gotham-Bold.woff") format("woff"),
url("font/Gotham-Bold.woff2") format("woff2"),
url("font/Gotham-Bold.ttf") format("truetype");
}