可以在没有互联网连接的情况下在本地网页 (XAMPP) 上使用下载的字体吗?我需要这个来查看字体,因为有些人可能负担不起互联网连接费用,他们使用计算机只是为了工作。
这是网络字体:http://openfontlibrary.org/en/font/didact-gothic
我尝试了这个但没有成功:http://css-tricks.com/snippets/css/using-font-face/
提前致谢!!!
编辑
我认为文件存储的地方是问题,因为我有这个 .css 但没有工作。我所有文件的位置是 /opt/lammp/htdocs
@font-face {
font-family: 'DidactGothicMedium';
src: url('didactgothic.eot');
src: url('didactgothic.eot') format('embedded-opentype'),
url('didactgothic.woff') format('woff'),
url('didactgothic.ttf') format('truetype'),
url('didactgothic.svg#DidactGothicMedium') format('svg');
}
p {
font-family: 'Didact Gothic';
font-weight: normal;
font-style: normal;
padding-left: 25px;
padding-right: 25px;
}
input {
font-family: 'Didact Gothic';
font-weight: normal;
font-style: normal;
}
最佳答案
是的,这是可能的,如果您只是在浏览器中转到您的本地主机,它应该像您将其转发并使用您自己的 IP/域转到那里时一样工作。
如果 @font 不适合您,请确保 1) 您使用的是 Chrome/Firefox(Internet Explorer 仅支持某些文件扩展名(我认为是 .otf)。
和 2) 您的路径设置正确!
也许您的一些 html/css 代码可以帮助我们解决您的问题 :)
关于css - 在没有互联网连接的情况下使用下载的字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19380383/