css - 将多个字体文件合并到一个 @font-face 中

标签 css fonts font-face

我有以下代码:

@font-face {
  font-family: 'icomoon';
  src:url('../fonts/icons/icomoon.eot?2hq9os');
  src:url('../fonts/icons/icomoon.eot?#iefix2hq9os') format('embedded-opentype'),
  url('../fonts/icons/icomoon.woff?2hq9os') format('woff'),
  url('../fonts/icons/icomoon.ttf?2hq9os') format('truetype'),
  url('../fonts/icons/icomoon.svg?2hq9os#icomoon') format('svg');
  font-weight: normal;
  font-style: normal;
}

现在,问题是我被迫使用多个图标集(来自多个文件),并且为了方便和干净的结构,我希望仅在一个“icomoon”中拥有所有这些图标(来自所有文件)字体。

例如,如果:

../fonts/icons/icomoon.* includes icon-1 / icon-2 and icon-3

and 

../fonts/icons/customicon.* includes icon-4 / icon-5

如何将它们全部包含在

@font-face {
  font-family: 'icomoon';
  -- include multiple files --
}

div#selector { // will have con-1 / icon-2 / icon-3 / icon-4 / icon-5
  font-family: icomoon; 
}

这可能吗?

最佳答案

我认为为此目的你可以使用IcoMoon插入。 使用它,您可以将 FontAwesome 与您的图标等结合起来创建自定义字体。

关于css - 将多个字体文件合并到一个 @font-face 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24820187/

相关文章:

html - 为 Bootstrap 3 和响应能力正确水平对齐 HTML 输入字段

css - 无法在 Django 模板中加载字体

css - 不同字体的不同字体粗细

VIM GTK-UI 字体

css - Mac 无法在浏览器中呈现字体

css - 网络字体和使用本地字体

javascript - 功能前延迟并在悬停时取消功能

html - 固定顶部div

html - 如何在图像旁边放置 <hr>?

html - 如何实现像github.com这样的图标字体