包含 Museo 的 Font Stack 在 FireFox 和 Opera 中根本无法工作

发布于 2024-12-09 00:03:35 字数 1958 浏览 0 评论 0原文

我使用三种不同的字体。这是我的@fontface

@font-face {
font-family: 'Mikadan-Regular'; 
src: url('../fonts/mikadan/eot/style_134713.eot');
src: url('../fonts/mikadan/eot/style_134713.eot?#iefix') format('embedded-opentype'),
     url('../fonts/mikadan/woff/style_134713.woff') format('woff'),
     url('../fonts/mikadan/ttf/style_134713.ttf') format('truetype'),
     url('../fonts/mikadan/svg/style_134713.svg#Mikadan-Regular') format('svg');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'MuseoSans500';
src: url('../fonts/museosans_500/MuseoSans_500-webfont.eot');
src: url('../fonts/museosans_500/MuseoSans_500-webfont.eot?#iefix') format('embedded-opentype'),
     url('../fonts/museosans_500/MuseoSans_500-webfont.woff') format('woff'),
     url('../fonts/museosans_500/MuseoSans_500-webfont.ttf') format('truetype'),
     url('../fonts/museosans_500/MuseoSans_500-webfont.svg#MuseoSans500') format('svg');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'MuseoSlab500';
src: url('../fonts/museoslab_500/Museo_Slab_500-webfont.eot');
src: url('../fonts/museoslab_500/Museo_Slab_500-webfont.eot?#iefix') format('embedded-opentype'),
     url('../fonts/museoslab_500/Museo_Slab_500-webfont.woff') format('woff'),
     url('../fonts/museoslab_500/Museo_Slab_500-webfont.ttf') format('truetype'),
     url('../fonts/museoslab_500/Museo_Slab_500-webfont.svg#MuseoSlab500') format('svg');
font-weight: normal;
font-style: normal;
}

第一个和第三个工作正常。

第二个为 body 标记指定为:

body, button, input, select, textarea {
font: 16px/1.625 MuseoSans500 "Lucida Grande", "Lucida Sans Unicode", "Trebuchet MS", sans-serif;
_font-size: 1em;
color: #333;
}

This Works Excellent in Chrome and Safari

But, in Opera 11.50 and Firefox 4.0.1, bad news;整个字体堆栈不起作用,并且字体呈现为普通的旧衬线(恶心!)

我认为问题出在 Museo 上,因为当我将 Museo 从字体堆栈中取出时,它会正确呈现。

我在 Windows 7 上使用这些浏览器。

I am using three different fonts. Here is my @fontface

@font-face {
font-family: 'Mikadan-Regular'; 
src: url('../fonts/mikadan/eot/style_134713.eot');
src: url('../fonts/mikadan/eot/style_134713.eot?#iefix') format('embedded-opentype'),
     url('../fonts/mikadan/woff/style_134713.woff') format('woff'),
     url('../fonts/mikadan/ttf/style_134713.ttf') format('truetype'),
     url('../fonts/mikadan/svg/style_134713.svg#Mikadan-Regular') format('svg');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'MuseoSans500';
src: url('../fonts/museosans_500/MuseoSans_500-webfont.eot');
src: url('../fonts/museosans_500/MuseoSans_500-webfont.eot?#iefix') format('embedded-opentype'),
     url('../fonts/museosans_500/MuseoSans_500-webfont.woff') format('woff'),
     url('../fonts/museosans_500/MuseoSans_500-webfont.ttf') format('truetype'),
     url('../fonts/museosans_500/MuseoSans_500-webfont.svg#MuseoSans500') format('svg');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'MuseoSlab500';
src: url('../fonts/museoslab_500/Museo_Slab_500-webfont.eot');
src: url('../fonts/museoslab_500/Museo_Slab_500-webfont.eot?#iefix') format('embedded-opentype'),
     url('../fonts/museoslab_500/Museo_Slab_500-webfont.woff') format('woff'),
     url('../fonts/museoslab_500/Museo_Slab_500-webfont.ttf') format('truetype'),
     url('../fonts/museoslab_500/Museo_Slab_500-webfont.svg#MuseoSlab500') format('svg');
font-weight: normal;
font-style: normal;
}

The first and the third work fine.

The second one is specified for the body tag as:

body, button, input, select, textarea {
font: 16px/1.625 MuseoSans500 "Lucida Grande", "Lucida Sans Unicode", "Trebuchet MS", sans-serif;
_font-size: 1em;
color: #333;
}

This works perfectly fine in Chrome and Safari

However, in Opera 11.50 and Firefox 4.0.1, bad news; the entire font stack does not work, and the font is rendered as plain old serif (yuck!)

I think the problem is with Museo,as when I take Museo out of the font stack it renders correctly.

I'm using these browsers on Windows 7.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一杯敬自由 2024-12-16 00:03:35

你少了一个逗号。

font: 16px/1.625 MuseoSans500 "Lucida Grande"
font: 16px/1.625 MuseoSans500, "Lucida Grande"
                            ^^^ add this comma

You're missing a comma.

font: 16px/1.625 MuseoSans500 "Lucida Grande"
font: 16px/1.625 MuseoSans500, "Lucida Grande"
                            ^^^ add this comma
小梨窩很甜 2024-12-16 00:03:35

尽管您现在缺少逗号,但根据您所说的,您在使用正文文本的 MuseoSans500 字体时遇到了问题。当你删除它时,你就没事了。我认为现在您向我们展示您的代码时缺少逗号。

我会尝试一次将 font-family 设置为一个选项,看看会发生什么。我还会将字体大小和行高分开,以防万一从而隔离问题,如下所示:

body, button, input, select, textarea {
  font-family: MuseoSans500; /* start with this one by itself */
  font-size: 16px;
  line-height: 1.625;
  color: #333;
}

Although you are missing that comma now, based on what you said, you were having problems with the MuseoSans500 font for body text. When you removed it you were fine. I think the comma is missing now that you are showing us your code.

I would try setting font-family to one choice at a time and see what happens. I would also separate the font-size and line-height just in case thereby isolating the problem, like so:

body, button, input, select, textarea {
  font-family: MuseoSans500; /* start with this one by itself */
  font-size: 16px;
  line-height: 1.625;
  color: #333;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文