You can use the CSS @font-face declaration for this.
However, beware: not all browsers support the otf format. You can use a tool such as FontSquirrel's Font-face Generator to convert the font into all the different formats you'll need. It'll even generate the CSS for you, which you'll then simply copy and paste into your project.
It does have some drawbacks however: text can't be copied and it uses javascript which may be a problem in some very old browsers of if someone is browsing with js turned off.
发布评论
评论(4)
您可以使用 CSS
@font-face
为此声明。但请注意:并非所有浏览器都支持
otf
格式。您可以使用诸如FontSquirrel's Font-face Generator之类的工具将字体转换为所有不同的格式你会需要的。它甚至会为您生成 CSS,然后您只需将其复制并粘贴到您的项目中即可。
You can use the CSS
@font-face
declaration for this.However, beware: not all browsers support the
otf
format.You can use a tool such as FontSquirrel's Font-face Generator to convert the font into all the different formats you'll need. It'll even generate the CSS for you, which you'll then simply copy and paste into your project.
不是 100% 支持,但是:
Not 100% supported, but:
或者,您可以使用 Cufon 字体替换:
http://cufon.shoqolate.com/generate/
但确实有一些缺点:文本无法复制,并且它使用 javascript,这在一些非常旧的浏览器中可能会出现问题,如果有人在关闭 js 的情况下浏览。
Alternatively, you could use Cufon font replacement:
http://cufon.shoqolate.com/generate/
It does have some drawbacks however: text can't be copied and it uses javascript which may be a problem in some very old browsers of if someone is browsing with js turned off.
CSS 3 使浏览器能够下载和使用 TTF 文件格式。与往常一样,IE 提供部分支持。像往常一样,谷歌来救援。
http://code.google.com/apis/webfonts/docs/getting_started.html
CSS 3 has given browsers the ability to download and use TTF file formats. As usual IE gives partial support. As usual, Google to the rescue.
http://code.google.com/apis/webfonts/docs/getting_started.html