简体   繁体   English

Ubuntu字体在Chromium和Google Chrome中有所不同

[英]Ubuntu Font different in Chromium and Google Chrome

Why does the Ubuntu Font ( http://www.google.com/fonts#UsePlace:use/Collection:Ubuntu ) shows differently in Chromium and Google Chrome? 为什么Ubuntu字体( http://www.google.com/fonts#UsePlace:use/Collection:Ubuntu )在Chromium和Google Chrome中的显示方式不同?

Ubuntu字体在Chromium和Google Chrome中有所不同 (Google Chrome on the right) (右侧是Google Chrome)

In Chromium every font-weight looks right but in Google Chrome the Light , Normal and Medium are all the same. 在Chromium中,每个font-weight看起来都是正确的,但在Google Chrome中, LightNormalMedium都是相同的。

Specs: 眼镜:

  • Ubuntu 13.10 Ubuntu 13.10
  • Chromium 29.0.1547.65 铬29.0.1547.65
  • Google Chrome 30.0.1599.101 谷歌浏览器30.0.1599.101

I think the most plausible explanation is that your computer has Ubuntu (well, a font named Ubuntu) installed, but not with all the typefaces that Google distributes. 我认为最合理的解释是你的计算机安装了Ubuntu(嗯,一种名为 Ubuntu的字体),但没有安装Google分发的所有字体。

The reason is that I was able to construct a similar situation on my computer (Win 7). 原因是我能够在我的计算机上构建类似的情况(Win 7)。 Initially, both Chrome and Firefox (I used it for comparison, because I don't have Chromium) displayed the Google page OK. 最初,Chrome和Firefox(我用它进行比较,因为我没有Chromium)显示Google页面确定。 I had Ubuntu, as downloaded from Google pages, with all the typefaces there, as a normal installed font. 我从谷歌页面下载了Ubuntu,其中包含所有字体,作为普通安装字体。 I then removed Ubuntu Light and Medium (but not their italic versions), and Windows refused to do this (saying the fonts are in use) until I closed Chrome (but having the page open in Firefox wasn't a problem). 然后我删除了Ubuntu Light和Medium(但不是它们的斜体版本),并且Windows拒绝执行此操作(说明字体正在使用中),直到我关闭Chrome(但在Firefox中打开页面不是问题)。 When restarted, Chrome now showed both Light 300 and Light 300 Italic as light italic! 重新启动后,Chrome现在显示Light 300和Light 300 Italic为浅斜体!

So it seems that Chrome decides that when a font family called Ubuntu exists in the system, it does not fetch font files from the Google server but uses the locally installed font. 因此,Chrome似乎决定在系统中存在名为Ubuntu的字体系列时,它不会从Google服务器获取字体文件,而是使用本地安装的字体。 This would be OK, but Chrome fails to notice that the font does not have all the typefaces needed, so it gets confused and seems to use other typefaces in their stead. 这没关系,但Chrome没有注意到字体没有所需的所有字体,所以它变得混乱,似乎使用其他字体代替它们。

When I completely removed Ubuntu from my system, Chrome again shows the page OK. 当我从系统中完全删除Ubuntu后,Chrome会再次显示该页面。

I'm not 100% sure of this analysis, and I'm not sure at all of the implications. 我不是100%肯定这个分析,我不确定所有的含义。 Presumably, the problem only appears for users that have the font installed in their system. 据推测,只有在系统中安装了字体的用户才会出现此问题。 And probably the problem can be avoided if you do not use fonts as hosted by Google but download them, create the usual @font-face kit, and do not include any local(...) part in your src declarations. 如果您不使用Google托管的字体但下载它们,创建通常的@font-face工具包,并且不在src声明中包含任何local(...)部分,则可能会避免此问题。 This would mean some degradation of performace in the (probably rare) cases where the font exists as installed. 这意味着在安装字体时(可能很少见)情况下性能会有所降低。

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

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