简体   繁体   English

相同字体在FF7和Chrome中呈现的方式不同

[英]Same font renders differently across FF7 and Chrome

Screenshot : http://i.imgur.com/QVBGx.png 截图http//i.imgur.com/QVBGx.png

It is pretty evident that my site renders different on Chrome and FF7 on my Win7 machine 很明显,我的网站在Win7机器上的Chrome和FF7上呈现出不同

I am using this: 我用这个:

h1, h2 {font-family: "Lucida Grande", "Helvetica Neue", Arial; }

Does anybody can point me how can I even these diffs? 有人可以指出我该如何区分这些差异吗? I don't want fonts with different 'feelings' on each browser. 我不希望每个浏览器上的字体具有不同的“感觉”。

The font, Lucida Grande is installed in my Windows machine 我的Windows机器中安装了Lucida Grande字体

EDIT: font-weight: normal !important 编辑:字体粗细:正常!重要

doesn't work either 也不起作用

It looks like the two browsers are rendering it with a different weight . 看起来这两个浏览器正在以不同的权重渲染它。

I can think of two possibilities, though I don't know if either are correct. 我可以想到两种可能性,尽管我不知道这两种说法是否正确。

  • You requested a bold font, but that font is not available in bold. 您要求使用粗体字体,但是该字体不能用粗体显示。 One browser is just showing the regular, non-bold variant unchanged, whereas the other has processed it to look bold. 一个浏览器仅显示不变的常规非粗体变体,而另一个浏览器将其处理为粗体。

  • You requested a particular weight of font, say "bold" or "600" but the installed fonts do not precisely match that weighting. 您要求特定的字体粗细,例如“粗体”或“ 600”,但安装的字体与该粗细不完全匹配。 One browser is substituting an "extra-bold" variant of font, and the other a "regular-bold", or something of this nature. 一个浏览器正在替换字体的“超粗体”,而另一个则是“常规加粗”或类似的性质。

If either of these is correct you could play around with the font-weight CSS property to try and alter it. 如果以上任一方法都正确,则可以使用font-weight CSS属性尝试对其进行更改。 But then that may affect substitution of whichever font is chosen in the case that it is viewed on a system with no Lucida Grande font at all. 但是,如果在完全没有Lucida Grande字体的系统上查看该字体,则这可能会影响所选字体的替换。

Fonts will always render slightly different from one browser to another, but that was a bit more difference than usual. 字体总是会在一个浏览器和另一个浏览器之间呈现出一些细微的差异,但是这与平时相比有所不同。 Probably because the headers have font-weight: bold; 可能是因为标头具有font-weight: bold; as default, and the font doesn't have a bold variation so the browsers create the bold style from the regular weight in different ways. 默认情况下,字体没有粗体变化,因此浏览器会以不同的方式根据常规粗细创建粗体样式。

Anyway, you might want to use more common fonts. 无论如何,您可能想使用更多常见的字体。 On my Windows 7 machine there is neither Lucida Grande nor Helvetica Neue, so it would render using Arial. 在我的Windows 7计算机上,既没有Lucida Grande也没有Helvetica Neue,因此可以使用Arial进行渲染。 Still, I have the additional fonts that come with both MS Office and Photoshop, so I have a lot more fonts installed than you can expect from a standard system. 尽管如此,我还有MS Office和Photoshop随附的其他字体,所以我安装的字体比标准系统所期望的要多得多。

Also, you should always specify a generic font as the last resort, in this case sans serif , otherwise it would render using the default font if none of the fonts are installed, which is something like Times Roman which has a completely different look. 另外,您应始终将通用字体指定为最后的手段,在这种情况下为sans serif ,否则,如果未安装任何sans serif ,则它将使用默认字体进行渲染,例如Times Roman ,外观完全不同。 Perhaps also adding Helvetica , which is the closest equivalent of Arial on non-Windows systems. 也许还要添加Helvetica ,它与非Windows系统上的Arial最接近。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM