CQ-CSER

计算机爱好者

Google Font Directory-Google Font API

Posted on | 五月 29, 2010 | No Comments

Google在5月20日宣布推出Google Font DirectoryGoogle Font API两项服务。在 Google Font Directory中,Google联合了众多的字体设计者为用户提供了多种漂亮的字体,但现在全部是英文字体,相信今后会有中文字体。Google Font API 和Google Font Directory是相辅相成的,用户正是通过Google Font API来使用Google Font Directory中的字体。

下面让我们看看如何使用Google Font API 。

1.在 Google Font Directory查找字体

进入Google Font Directory选择合适的字体。点击选择的字体可以查看它在各种大小下的显示效果。

2.引用字体文件

由于这些字体在本地系统中不存在,所以必须在页面中引用它们的字体文件。这些文件托管在Google的云中,引用它们通过下面的方式。

<link href='http://fonts.googleapis.com/css?family=Reenie+Beanie' rel='stylesheet' type='text/css'>

3.使用字体

使用字体通过将html节点的font-family样式设置为上面引用的字体。

h1 { font-family: 'Reenie Beanie', arial, serif; }

最终效果

很炫吧,去尝试一下!

相关文章:

  1. Change Font/-size
  2. google api ajaxfeeds
  3. 微软的22道数据结构算法面试题
  4. 浅读”google-seo-report-card”:感想
  5. 在C++中嵌入JavaScript——Google V8 JavaScript Engine使用体验

评论|Comments

留言|Leave a Reply





  • Archives

  • SUNSHINE

  • About

    本博客采用创作共用版权协议,要求署名、非商业用途和保持一致. 转载本博客内容也遵循“署名-非商业用途-保持一致”的创作共用协议.

    订阅

    Search

    Admin