jaywcjlove / svgtofont

Read a set of SVG icons and ouput a TTF/EOT/WOFF/WOFF2/SVG font.
https://jaywcjlove.github.io/svgtofont
MIT License
520 stars 82 forks source link

部分svg图片可转化成unicode展示,但转化为font class失败,请问是我有什么地方操作不对吗? #158

Open tongchong opened 2 years ago

tongchong commented 2 years ago

font class:

屏幕快照 2022-03-07 下午4 56 52

unicode

屏幕快照 2022-03-07 下午4 48 54

test11

jaywcjlove commented 2 years ago

@1261960504 没有太懂,失败在什么地方。

图标尽量使用 path 绘制出来,并且不要使用旋转之类的样式。

<svg width="24" height="24" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
 <path d="m2.6 10.59l5.78-5.79 1.69 1.7c-0.24 0.85 0.15 1.78 0.93 2.23v5.54c-0.6 0.34-1 0.99-1 1.73a2 2 0 0 0 2 2 2 2 0 0 0 2 -2c0-0.74-0.4-1.39-1-1.73v-4.86l2.07 2.09c-0.07 0.15-0.07 0.32-0.07 0.5a2 2 0 0 0 2 2 2 2 0 0 0 2 -2 2 2 0 0 0 -2 -2c-0.18 0-0.35 0-0.5 0.07l-2.57-2.57c0.26-0.93-0.22-1.95-1.15-2.34-0.43-0.16-0.88-0.2-1.28-0.09l-1.7-1.69 0.79-0.78c0.78-0.79 2.04-0.79 2.82 0l7.99 7.99c0.79 0.78 0.79 2.04 0 2.82l-7.99 7.99c-0.78 0.79-2.04 0.79-2.82 0l-7.99-7.99c-0.79-0.78-0.79-2.04 0-2.82z" fill="#e64a19"/>
</svg>
tongchong commented 2 years ago

谢谢,失败就是像上面截图中的test11和test22这两个图标,在unicode方式下可以展示,但是在font-class模式下无法展示出来

tongchong commented 2 years ago

image

jaywcjlove commented 2 years ago

@1261960504 没有看到你的代码不知道什么原因

jaywcjlove commented 2 years ago

@1261960504 你可以把你的这俩 svg 图标代码贴出来,我看看

tongchong commented 2 years ago

<svg t="1640610881396" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25389" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M319.936 243.2h573.504c18.432 0 33.792-21.056 33.792-46.08a39.424 39.424 0 0 0-33.792-43.52H320a39.424 39.424 0 0 0-33.792 43.52c0 25.024 15.36 46.08 33.792 46.08z m573.504 224H320c-18.432 0-33.792 22.016-33.792 44.032S300.992 556.8 320 556.8h573.504c18.432 0 33.792-24.064 33.792-45.568 0-21.504-14.848-43.968-33.792-43.968z m0 313.664H320a38.912 38.912 0 0 0-33.792 41.472c0 21.44 14.848 48.064 33.792 48.064h573.504c18.432 0 33.792-26.624 33.792-48.064a38.912 38.912 0 0 0-33.792-41.984v0.512z m-790.4-627.2a45.504 45.504 0 0 0-45.568 44.992c0.256 24.96 20.544 44.992 45.504 44.992a44.992 44.992 0 1 0 0-90.048z m0 313.6a44.992 44.992 0 1 0 0 89.536 44.992 44.992 0 1 0 0-89.6z m0 313.6a44.992 44.992 0 1 0 0 89.024 44.992 44.992 0 1 0 0-89.536v0.512z" fill="#758096" p-id="25390"></path></svg>

jaywcjlove commented 2 years ago

@1261960504 你无法显示的 viewBox 尺寸是不是跟能显示的不一样?通过工具弄成一样试一试?

tongchong commented 2 years ago

嗯嗯,好的,我去试试