谭粗体字体不呈现在Safari

问题描述 投票:0回答:1

我用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;
}

工作:https://image.noelshack.com/fichiers/2019/05/5/1549031420-51034508-622499171534647-4506454994643320832-n.png

不工作:https://image.noelshack.com/fichiers/2019/05/5/1549031420-51176106-755763351461937-4132132935346159616-n.png

fonts safari
1个回答
0
投票

我找到了解决办法。老版本的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");
}
© www.soinside.com 2019 - 2024. All rights reserved.