javascript - 自定义网络字体提供商

标签 javascript css webfont-loader

我想在我自己的服务器上使用谷歌的网络字体加载器和我自己的自定义字体。

我对 how to configure 有点困惑我自己的网络字体提供商,如 google 自己的文档中所述:

In addition to the google, typekit, ascender and monotype options, 
there is also a custom module that can load a stylesheet
from any web-font provider.

WebFontConfig = {
  custom: { families: ['OneFont', 'AnotherFont'],
    urls: [ 'http://myotherwebfontprovider.com/stylesheet1.css',
      'http://yetanotherwebfontprovider.com/stylesheet2.css' ] }
};

为了使用这个库,我的外部 CSS 应该包含什么?

最佳答案

看看@font-face 工具包,像 font squirrel 这样的地方是一个很好的起点。您可以将各种文件格式(如 woff、svg 等)保存到字体文件夹中,将 @font face 工具包提供的 css 添加到您自己的样式表中,然后在您的脑海中将其与其余 CSS 一起调用,尽快当您阅读网站上的文档时,它会很有意义,任何进一步的帮助都可以随时询问

关于javascript - 自定义网络字体提供商,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14792258/

相关文章:

javascript - JavaScript 中的高级路由

JavaScript 复选框检查相关问题

fonts - Font Face Observer 在页面加载时加载所有字体?

jquery-isotope - 砌体/同位素/包装图像加载 + 网页字体

javascript - 如何通过 jQuery 重定向到 html 中附加的 href?

css - WebFontLoader : Why is vanilla font-family declaration not sufficient for fallbacks?

javascript - Fullcalendar,需要查看更多/更多按钮的每天限制事件数量的文件?

javascript - 如何根据列的宽度换行文本

html - 在网页中显示两种语言的文本,在 css 规则中使用不同字体的字体

html - 定位3个不同的div