|  | 
 
|   
用Google Font API来摆脱网页字体的单调(试用)
x
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册  本文关键字:GoogleFontAPI,GoogleFont,GoogleFontDirectory,网页字体
 
 在网页设计里,字体的显示是个问题。最普遍用的是宋体,但是宋体在 Win 7 下的表现真的很难看。雅黑端庄一些,但是随着字体大小,感觉汉字的大小也会有区别。
 比如 Bitter 字体,用来做标题倒是不错:
 复制代码<div style="text-align:center; font-size:24px; font-family:Bitter;">Welcome To BeiJing</div>
效果图:
 
   CSS 怎么调用 Bitter 字体?
 
 复制代码@font-face {
  font-family: 'Bitter';
  font-style: normal;
  font-weight: 400;
  src: local('Bitter-Regular'), url(http://themes.googleusercontent.com/static/fonts/bitter/v4/s9gJB935qk_YG8d-lnTdvA.woff) format('woff');
}
@font-face {
  font-family: 'Bitter';
  font-style: normal;
  font-weight: 700;
  src: local('Bitter-Bold'), url(http://themes.googleusercontent.com/static/fonts/bitter/v4/JGVZEP92dXgoQBG1CnQcfD8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
}
其实,这是 Google 推出的Google Font Directory和Google Font API两项服务,Google联合了众多的字体设计者为用户提供了多种漂亮的字体。具体可以参看以前写的一篇文章:《用Google Font API来丰富网页字体》。
 
 这里仅仅抛砖引玉,国内实在太少网站用 Google Font API 了。
 | 
 |