css - @font-face 渲染为 Times New Roman

标签 css meteor fonts font-face webfonts

我正在使用 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/

相关文章:

html - 无法加载 ttf 字体

html - 为什么这个动画不起作用?

node.js - 在 Meteor 1.5.1 中使用 buffermaker 时找不到模块 './lib/BufferMaker'

javascript - 从 meteor mongo 返回数组

unicode - CFF 字体文件中的编码和字符集表是如何组织的?

actionscript-3 - 加载和卸载多语言 Flex 应用程序的字体

javascript - CSS 打印 : Avoiding cut-in-half table between pages?

css - 强制 Bootstrap 响应图像为正方形

css - 设置特定组件的样式

javascript - 将二进制数据从 Nodejs 缓冲区写入 Meteor 客户端上的 blob