我正在使用 Meteor 框架,并且在我的 main.scss
文件中包含以下内容:
@font-face {
font-family: 'GrandHotel-Regular';
src: url('GrandHotel-Regular.eot');
src: url('GrandHotel-Regular.woff2') format('woff2'),
url('GrandHotel-Regular.woff') format('woff'),
url('GrandHotel-Regular.ttf') format('truetype'),
url('GrandHotel-Regular.svg#GrandHotel-Regular') format('svg'),
url('GrandHotel-Regular.eot?#iefix') format('embedded-opentype');
font-weight: normal;
font-style: normal;
}
h1 {
font-family: 'GrandHotel-Regular';
}
这是行不通的,当我检查所选字体时,字体系列是 GrandHotel-Regular
,但控制台显示它正在呈现为 Times New Roman。
我在 Ubuntu 上使用 Chrome,它是一个旧版本,无法再更新,因为我的笔记本电脑太旧了,但我不认为这是导致问题的原因,因为这样的事情对我有用过去。
可能出了什么问题?
其他问题,比如这个: Font coming out as Times New Roman in Older Browsers
或者这个: Font proxima_novalight is rendered as Times New Roman
没有解决相同的问题。
最佳答案
字体的 url
没有任何文件夹作为文件路径的一部分,这意味着它们必须与 CSS 文件位于同一文件夹中。他们真的吗? (如果没有,添加文件夹/文件路径)
关于css - @font-face 渲染为 Times New Roman,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37846795/