我下載了這兩種字體的所有格式,人道字體可以在mozilla和chrome上使用,但不能在safari上使用,而夏普Grotesk字體不能在任何一種最流行的瀏覽器上使用。
在我的CSS中我有:
:root {
/*color palette*/
--color-primario: #305ae2;
--color-secundario-oscuro: #000111;
--color-secundario-claro: #f7f7f7;
/*fonts*/
--fuente-titulos: "Humane", sans-serif;
--fuente-cuerpo: "Sharp", sans-serif;
}
@font-face {
font-family: "Sharp", sans-serif;
src: url("../fonts/SharpGrotesk-Medium20.woff2") format("woff2"),
url("../fonts/SharpGrotesk-Medium20.woff") format("woff"),
url("../fonts/SharpGrotesk-Medium20.ttf") format("truetype"),
url("../fonts/SharpGrotesk-Medium20.svg") format("svg"),
url("../fonts/SharpGrotesk-Medium20.eot") format("embedded-opentype"),
url("../fonts/SharpGrotesk-Medium20.otf") format("opentype");
font-weight: 400;
font-style: normal;
text-rendering: optimizeLegibility;
}
@font-face {
font-family: "Sharp", sans-serif;
src: url("../fonts/SharpGrotesk-Book20.woff2") format("woff2"),
url("../fonts/SharpGrotesk-Book20.woff") format("woff"),
url("../fonts/SharpGrotesk-Book20.ttf") format("truetype"),
url("../fonts/SharpGrotesk-Book20.svg") format("svg"),
url("../fonts/SharpGrotesk-Book20.eot") format("embedded-opentype"),
url("../fonts/SharpGrotesk-Book20.otf") format("opentype");
font-weight: 300;
font-style: normal;
text-rendering: optimizeLegibility;
}
@font-face {
font-family: "Humane", sans-serif;
src: url("../fonts/Humane-Bold.woff2") format("woff2"),
url("../fonts/Humane-Bold.woff") format("woff"),
url("../fonts/Humane-Bold.ttf") format("truetype"),
url("../fonts/Humane-Bold.svg") format("svg"),
url("../fonts/Humane-Bold.eot") format("embedded-opentype"),
url("../fonts/Humane-Bold.otf") format("opentype");
font-weight: 600;
font-style: normal;
text-rendering: optimizeLegibility;
}
@font-face {
font-family: "Humane", sans-serif;
src: url("../fonts/Humane-Regular.woff2") format("woff2"),
url("../fonts/Humane-Regular.woff") format("woff"),
url("../fonts/Humane-Regular.otf") format("truetype"),
url("../fonts/Humane-Regular.svg") format("svg"),
url("../fonts/Humane-Regular.eot") format("embedded-opentype"),
url("../fonts/Humane-Regular.otf") format("opentype");
font-style: normal;
font-weight: normal;
text-rendering: optimizeLegibility;
}
h1,
h2,
h3,
h4,
h5 {
font-family: var(--fuente-titulos) !important;
font-family: "Humane", sans-serif !important;
font-weight: 600;
line-height: 1;
}
p {
font-family: "Sharp", sans-serif !important;
}
p,
a,
h6 {
font-family: var(--fuente-cuerpo) !important;
font-family: "Sharp", sans-serif;
font-weight: 300;
}
我想做一個(gè)兼容的,好看的自定義字體的網(wǎng)站,不會(huì)出現(xiàn)一種字體一半工作,另一種根本不工作的情況。
如果有人能給我一個(gè)解決這個(gè)問題的方法,我將不勝感激,因?yàn)槲乙呀?jīng)嘗試了所有可能的方法(甚至gpt ),但我還是無法修復(fù)它。