【发布时间】:2017-05-15 11:33:40
【问题描述】:
我在托管网站时遇到问题:在托管之前,当我在计算机上本地运行网站时,字体很好,但在托管时,字体不起作用。 (我在我的网页上使用 pdf 字体,我使用 dompdf 转换为 pdf)
代码如下:
/* latin-ext */
@font-face {
font-family: 'Great Vibes';
font-style: normal;
font-weight: 400;
src: local('Great Vibes'), local('GreatVibes-Regular'), url(./asset/fonts/font-sertifikat/sertifikat.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Great Vibes';
font-style: normal;
font-weight: 400;
src: local('Great Vibes'), local('GreatVibes-Regular'), url(./asset/fonts/font-sertifikat/sertifikat4.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
}
p.serif {
font-family: 'Great Vibes';
font-size: 70px;
padding-top: 250px;
}
【问题讨论】:
-
您可能没有在服务器上安装字体,但您在本地计算机上安装了它们。
-
@PeterM 我已经在服务器上安装了字体。
-
你检查过路径
url(./asset/吗?尝试把 1) 完成 2) 相对路径,看看它做了什么 -
这里只有css,问题不支持任何其他标签