可能的重复:
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.
发布评论
评论(1)
笑脸用作不可能存在(或者至少极不可能)的字体名称,因此不会使用恰好与所需字体同名的本地字体
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