【发布时间】:2014-09-14 17:20:15
【问题描述】:
我有一个simple svg (drawn by me in illustrator),我正在尝试将其转换为网络字体(与其他 svg 一起)。当我在编辑器中打开一个 svg 时,我正确地看到了它(黑棋与白棋握手)。如果我将其转换为 png,则方法相同。
但是在我使用grunt webfont 将其转换为网络字体之后
webfont: {
icons: {
src : 'path/svg/*.svg',
dest : 'path/fonts',
destCss : 'path/css',
options : {
autoHint: false,
font : 'icons',
hashes : false
}
}
}
但是在 webfont 中它看起来很奇怪(除了轮廓之外,一切都是透明的)
这是一个example of my webfont 和为它生成的css:
@font-face {
font-family: 'icons';
url('font/icons.woff') format('woff'),
font-weight: normal;
font-style: normal;
}
.icon {
font-family: 'icons';
display: inline-block;
vertical-align: middle;
line-height: 1;
font-weight: normal;
font-style: normal;
speak: none;
text-decoration: inherit;
text-transform: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon_draw:before {
content: '\f103';
}
我坚信问题出在我的 svg 上(所有其他字体看起来都不错:其中一些是我的,一些来自其他来源)。但我不知道出了什么问题。
附:我试图包含所有相关和不相关的详细信息,但如果您需要其他内容(或者我忘记了其他内容),请告诉我。
【问题讨论】:
标签: css svg gruntjs webfonts adobe-illustrator