将图标加载为字体系列

Loading icons as a font-family

我刚刚向我的 Web 应用程序添加了自定义 .ttf。

@font-face{
  font-family: 'CustomIcons';
  src: font-url('CustomIcons.ttf') format("truetype");
}

我还不关心浏览器兼容性。

加载图标后,我不知道如何使用它们。我没有像添加 FontAwesome 图标时那样的 css,所以我不确定映射是怎样的。

你知道我怎样才能知道吗?

这是未记录的图标字体存在的祸根。

如果您想查看什么映射到什么,@Omar 的 this answer 对如何对奇怪的字符映射进行逆向工程有很好的 运行 了解。

Option 2) Use the icomoon app

Sign up AND create a new project In that project, import your font files (Top left button called "+ Import Icons") Under Fonts (Bottom right option), you'll see the list of all your icons and respective codes. This should work for sure.