CSS Garamond 真的是一种网络安全字体吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10403696/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 03:44:42  来源:igfitidea点击:

Is Garamond really a web safe font?

cssfont-facetypography

提问by J D

Is Garamond really web safe? Should I go ahead and use it? I know its not there in XP(Georgia is the fallback), however, what about other operating systems? Is it present in macs, new windows and linux?

Garamond 真的是网络安全吗?我应该继续使用它吗?我知道它在 XP 中不存在(格鲁吉亚是后备),但是,其他操作系统呢?它是否存在于 mac、新窗口和 linux 中?

I know I could simple do a @font-face, however, the if I embed it, it looks pretty hideous in Google Chrome.

我知道我可以简单地做一个@font-face,但是,如果我嵌入它,它在谷歌浏览器中看起来非常可怕。

EDIT

编辑

Okay, what if I do

好吧,如果我这样做怎么办

@import url(http://fonts.googleapis.com/css?family=EB+Garamond);
html{font-family: Garamond, EB Garamond, Georgia, serif;}

Will, this way the web browser will first check if Garamond is installed or not, and if not, load will load the web font EB Garamond, or this wont happen?

会不会,这样网页浏览器会先检查 Garamond 是否安装,如果没有,load 会加载网页字体 EB Garamond,或者这不会发生?

回答by Undefined

I don't believe it is a safe font to use on all computers. You can use the font and use another as a backup by using font family. Such as this:

我不认为它是一种可以在所有计算机上使用的安全字体。您可以使用该字体并通过使用字体系列将另一个用作备份。比如这个:

font-family:Garamond, Georgia, serif;

See here for more reading on web safe fonts -> http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html

有关网络安全字体的更多信息,请参见此处 -> http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html

回答by Nick White

Other than a very short list, you should not rely on everyone having the various font families on their computers.

除了一个非常短的列表之外,您不应该依赖每个人的计算机上都有各种字体系列。

Instead, try out Google WebFonts. In fact, use the search box on the left to find their Garamond equivalent. Works in all browsers (including older IE!) and looks great everywhere.

相反,请尝试使用Google WebFonts。事实上,使用左侧的搜索框可以找到它们的 Garamond 等价物。适用于所有浏览器(包括较旧的 IE!)并且在任何地方看起来都很棒。

EDIT

编辑

Regarding your additional question, yes, the browser will look for the fonts in the order that you specify them, so putting "Garamond" before "EB Garamond" will show Garamond if available in the user's computer.

关于您的附加问题,是的,浏览器将按照您指定的顺序查找字体,因此将“Garamond”放在“EB Garamond”之前将显示 Garamond(如果用户计算机中可用)。

回答by thomasrutter

For a font to look consistently good across platforms at small sizes it must be hinted well - otherwise it will only look good on those platforms which default to very soft, lightly hinted font smoothing for everything, like Mac - and it'll look terrible on Windows, which will apply strongest hinting and try to make them look really crisp, which really needs the hinting built into the font to be good to work well.

为了让字体在小尺寸的平台上看起来始终如一,它必须得到很好的暗示 - 否则它只会在那些默认为非常柔和,轻微暗示的字体平滑的平台上看起来很好,比如 Mac - 它会看起来很糟糕Windows,它将应用最强的提示并尝试使它们看起来非常清晰,这确实需要字体中内置的提示才能很好地工作。

EB Garamond is a free reproduction of Garamond which has an impressive range of glyphs but pays virtually no attention to on-screen rendering - consequently its lack of decent hinting will ensure it looks terrible at small sizes on certain platforms, particularly Windows. While Vista/7/8 improves font rendering somewhat, it only does so in some applications - others, particularly Google Chrome, uses the old font rendering. Edit August 2015 - this is no longer true of Google Chrome.

EB Garamond 是 Garamond 的免费复制品,它具有令人印象深刻的字形范围,但几乎不注意屏幕上的渲染 - 因此它缺乏适当的提示将确保它在某些平台上的小尺寸下看起来很糟糕,尤其是 Windows。 尽管 Vista/7/8 改进了字体渲染,它只在某些应用程序中这样做 - 其他应用程序,特别是谷歌浏览器,使用旧字体渲染. 2015 年 8 月编辑 - 谷歌浏览器不再如此。

There are other versions of Garamond out there, probably the best IMHO being Adobe Garamond. Being a commercial font you would need a special license to be allowed to embed it in a web page. Some font foundries sell these, some don't - you just need to read their license :) But if you get that, you may find that they are much better hinted. I can't guarantee it though (but some font stores will allow you to see a preview of a browser-rendered font in certain browsers).

还有其他版本的 Garamond,可能最好的恕我直言是 Adob​​e Garamond。作为商业字体,您需要获得特殊许可才能将其嵌入网页中。一些字体代工厂出售这些,有些不出售 - 您只需要阅读他们的许可证 :) 但是如果您知道了,您可能会发现他们得到了更好的暗示。不过我不能保证(但某些字体商店将允许您在某些浏览器中查看浏览器渲染字体的预览)。

But if you are limiting yourself to free fonts available from Google web fonts, I'd count EB Garamond out for body text, mainly just because of these issues.

但是,如果您限制自己使用 Google 网络字体提供的免费字体,我会将 EB Garamond 计入正文,主要是因为这些问题。

Maybe specify "Adobe Garamond" as first, as a few people may have that, but then fall back to fonts like Constantia, then Georgia, then just "serif". Note that Garamond and Constantia have a light stroke and a small x-height so will look a lot more "feint" than something like Georgia.

也许首先指定“Adobe Garamond”,因为有些人可能会这样做,然后又回到像 Constantia、Georgia 这样的字体,然后只是“serif”。请注意,Garamond 和 Constantia 具有轻微的笔触和较小的 x 高度,因此与 Georgia 之类的相比,它们看起来更“佯装”。

回答by Michael Moriarty

1) No, Garamond is not a web safe font.

1) 不,Garamond 不是网络安全字体。

2) Garamond is not recommended for usage on the web. See this article: Why you don't use Garamond on the Web

2) Garamond 不建议在网络上使用。请参阅本文:为什么不在 Web 上使用 Garamond

3) Recommendation: use Georgia for headings and Verdana for body text. They are both web safe and are tried and proven to work very well together.

3) 建议:标题使用 Georgia,正文使用 Verdana。它们都是网络安全的,并且经过尝试和证明可以很好地协同工作。

If you want to stick with EB Garamond, Google Fonts recommends pairing it with Lobster.

如果您想坚持使用 EB Garamond,Google Fonts 建议将其与 Lobster 配对。

Writing the code:

编写代码:

@import url('https://fonts.googleapis.com/css?family=Lobster|EB+Garamond');
h1, h2, h3, h4, h5, h6 {font-family: Lobster, cursive; }
p {font-family: 'EB Garamond', serif; }

回答by Jukka K. Korpela

No, Garamond is not “web safe” in the sense of being available on all computers. No font is. Garamond has been estimated, in CodeStyle.org surveys, to have about 85% coverage on Windows. It is probably quite rare on other systems.

不,Garamond 并非“网络安全”,因为它可以在所有计算机上使用。没有字体。在CodeStyle.org 的调查中,估计 Garamond在 Windows 上的覆盖率约为 85%。这在其他系统上可能很少见。

Using Georgia as fallback for Garamond sounds odd, because they are very different fonts, as you can see by just looking at texts containing them (remember to include digits, they are very different).

使用 Georgia 作为 Garamond 的后备听起来很奇怪,因为它们是非常不同的字体,您只需查看包含它们的文本即可看到(请记住包括数字,它们非常不同)。

Georgia is close to 99% on Windows and Mac but somewhere around 70% on Linux, so it would not be really browser-safe either. The main point however is that it is a font with special characteristics and generally not a good fallback font. Even the generic sans-seriffont name is probably a better guess.

Georgia 在 Windows 和 Mac 上接近 99%,但在 Linux 上接近 70%,所以它也不是真正的浏览器安全。然而,主要的一点是它是一种具有特殊特征的字体,通常不是一个好的后备字体。甚至通用sans-serif字体名称也可能是更好的猜测。

回答by takeshin

What's your definition of web safe font?

您对网络安全字体的定义是什么?

If you consider a font being web safewhen it is rendered on all the computers the same way, the answer is no - Garamond is not, and no other font is.

如果您认为一种字体在所有计算机上以相同方式呈现时是Web 安全的,那么答案是否定的 - Garamond 不是,其他字体也不是。

You can embed Garamond using various techniques (eg. javascript font API), but it will never be the same on all of the computers.

您可以使用各种技术(例如 javascript 字体 API)嵌入 Garamond,但它不会在所有计算机上都相同。

You can try to create a web safe font stack, considering font parameters, e.g. x-height. Something like this should work fine:

您可以尝试创建一个网络安全字体堆栈,考虑字体参数,例如 x 高度。这样的事情应该可以正常工作:

Garamond, Baskerville, "Baskerville Old Face", "Hoefler Text", "Times New Roman", Times, serif;

Anything you choose, remember that Garamond has very small x-height, so it is ok for print, but not very legible on screen. If you decide to use it, use bigger font-size.

无论您选择什么,请记住 Garamond 的 x 高度非常小,因此可以打印,但在屏幕上不太清晰。如果您决定使用它,请使用更大的font-size.

Edit

编辑

Saying JavaScript APII mean importing fonts using APIs like Google Font API, TypeKit or other solutions that do not work when JS is off. Then you still need font stack, so importing won't help in this case.

JavaScript API我的意思是使用 API 导入字体,例如 Google Font API、TypeKit 或其他在 JS 关闭时不起作用的解决方案。那么您仍然需要字体堆栈,因此在这种情况下导入将无济于事。