CSS:Bulletproof @font-face:笑脸变体

发布于 2024-09-27 19:01:48 字数 1094 浏览 10 评论 0 原文

可能的重复:
CSS @font-face - “src: local('☺'”的作用是什么)”是什么意思?

嗨,

我看到这篇文章 - Bulletproof @font-face 语法

http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/

这是防弹的语法,

@font-face {
  font-family: 'Graublau Web';
  src: url('GraublauWeb.eot');
  src: local('☺'),
         url('GraublauWeb.otf') format('opentype');
}

但我不明白他对笑脸的说法是什么本地()。这是什么意思?它是一个跨浏览器、PC 和 Apple 支持的标准吗?我可以放别的东西进去吗?

这是他的解释,

2010.02.04添加:已经有 关注指定本地字体 名称。主要原因是你 将控制权交给用户的机器, 可能显示本地 安装的字体而不是您安装的字体 想要服务。虽然会加载 更快,机会很小 该文件可能是错误的。

为了解决这个问题,我已经 指定本地字体名称“☺”。 是的,这是一张笑脸。开放式 spec 表示任何两字节 unicode 字符在字体名称中不起作用 在 Mac 上,这样就减少了 某人实际上的可能性 发布了一个具有这样名称的字体。这 如果您认为,建议使用技术 本地安装的版本 字体不符合您的最佳利益。

谢谢。

Possible Duplicate:
CSS @font-face - what does “src: local('☺')” mean?

Hi,

I came across this article - Bulletproof @font-face syntax

http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/

Here is the syntax of bulletproof,

@font-face {
  font-family: 'Graublau Web';
  src: url('GraublauWeb.eot');
  src: local('☺'),
         url('GraublauWeb.otf') format('opentype');
}

but I don't understand what he says about the smiley face in the local(). What does it mean? Is it a standdard which is supported across browsers, PCs and Apples? Can I put something else in?

Here is what he explains,

Added 2010.02.04: There has been
concern over specifying local font
names. The primary reason is that you
cede control to the user's machine,
potentially showing a locally
installed font instead of the one you
want to serve. While that will load
faster, there's a very small chance
the file could be wrong.

To account for this gotcha, I've
specified a local font name of '☺'.
Yes, it's a smiley face. The OpenType
spec indicates any two-byte unicode
characters won't work in a font name
on Mac at all, so that lessens the
likelihood that someone actually
released a font with such a name. This
technique is recommended if you think
a locally installed version of this
font is not in your best interest.

thanks.

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

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

发布评论

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

评论(1

和影子一齐双人舞 2024-10-04 19:01:48

笑脸用作不可能存在(或者至少极不可能)的字体名称,因此不会使用恰好与所需字体同名的本地字体

The smiley is used as the name of a font that cannot possibly exist (or is, at least, extremely unlikely) so that a local font that happens to have the same name as the desired fony will not be used

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文