Comments (6)
第一个问题我看一下,有同事也遇到 sketch 上的图标导出不能用的问题。
第二个问题能更详细描述下么?咱们在 HTML 上是怎么写字体的呢。
from iconfont-builder.
sketch 上的图标导出不能用,可能跟设计有关吧。我目前只发现被 SVGO 压缩过的 SVG,用原始的svgicons2svgfont 和 svg2ttf 是转的字体是完整的,而 iconfont-builder 却出问题,这个比较奇怪。
我参考 Google material-design-icons 使用 16 进值,我在 Unicode 完整下载的码表也是 16 进值。
改成这样就可以显示。
<i class="icon iconfont"></i>
<div class="name">check</div>
<div class="code">&#xF050;</div>
原来是这样的。
<i class="icon iconfont">�xf050;</i>
<div class="name">check</div>
<div class="code">&#x0xf050;</div>
from iconfont-builder.
@Ashung 是这样,&#
是 html 转义的起始字符,后面一般跟的是十进制,如果要使用十六进制,需要以 &#x
最为起始字符。也就是说,咱们之前的写法 �xf050
冗余了。
from iconfont-builder.
对,问题是生产的HTML好像没区分用户使用十进制或十六进制。可是你为什么要用十进制?
from iconfont-builder.
@Ashung 这里是生成字体的输入,而且也支持 16 进制,我看你传的就是 16 进制嘛,这个会进行转换的。采用十进制是考虑到我们的 code 可能会从数据库里取,库里是十进制的。
from iconfont-builder.
@Ashung 你说用 svgo 压过的样式有问题,这个后来我看了下:现在我们内部的解决方案还是规范 SVG 的设计,在设计时路径一定要闭合,形状必须合并。其实我这个也是依赖 svgicons2svgfont 和 svg2ttf,理论上生成的结果应该是一样的。
from iconfont-builder.
Related Issues (2)
- 字体图标显示异常,建议更新 svg2ttf 依赖 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iconfont-builder.