我可以使用Google网络字体自定义字体吗?

Sha*_*non 3 css fonts webfonts custom-font

我想用我自己的字体.如何将其与Google的字体加载器一起使用?

Tom*_*Tom 6

您可以将Google Font Loader与您自己的字体文件一起使用,例如

<script type="text/javascript">
WebFontConfig = {
  custom: { families: ['Font Family Name', 'Another Font Family'],
  urls: [ 'http://f.fontdeck.com/s/css/xxxx/domain/nnnn.css' ] }
};

(function() {
  var wf = document.createElement('script');
  wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +   
  '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
  wf.type = 'text/javascript';
  wf.async = 'true';
  var s = document.getElementsByTagName('script')[0];
  s.parentNode.insertBefore(wf, s);
})();
</script>
Run Code Online (Sandbox Code Playgroud)

CSS文件应包含指向所有兼容字体文件的链接.