snapdom icon indicating copy to clipboard operation
snapdom copied to clipboard

[bug]下载时,网页的自定义字体图标重复显示

Open luckyguanxin opened this issue 1 year ago • 5 comments

What's this about?

  • [x] I found a bug
  • [ ] I have a feature idea

Describe it simply:

在通过https://layui.dev/docs/2/页面测试snapdom时,发现自定义字体图标被重复生成

Quick demo?

预期显示:

Image

生成结果:

Image

代码:

await snapdom.download(document.querySelector("html"),{
        embedFonts: true
      })

Anything else we should know?

浏览器为edge

luckyguanxin avatar Jul 04 '25 02:07 luckyguanxin

怀疑你是和我一样看完推送的文章就来试了,不加embedFonts: true自定义icon直接变框框,添加了这个属性之后,icon就重复了,试了几个UI库,问题基本一致

lx221115 avatar Jul 04 '25 03:07 lx221115

我也遇到这样的问题,svg和element-ui的图标都不会显示,加了embedFonts: true没有效果

qlzmzlt avatar Jul 04 '25 03:07 qlzmzlt

谢谢你反馈这个问题。我认为这个问题可能与 issue #51 有关,需要添加 Layui 的图标字体。如果你能提交一个 PR,那就太好了。


Thanks for reporting this issue. I believe it's related to issue #51 — we need to include the Layui icon font. If you could open a PR, that would be great.

tinchox5 avatar Jul 04 '25 04:07 tinchox5

And related with issue #30

tinchox5 avatar Jul 04 '25 04:07 tinchox5

好的,我做了一个测试,把 layui 加入到 icon-fonts 中,已经可以正常工作了,即使在 embedFonts: false 的情况下也没问题。我会在下一个版本中加入这个修复。此外,为了应对将来的情况,我还会加入一个功能,让用户可以添加自己的 icon-fonts。


OK, I ran a test adding layui to the icon-fonts, and it’s working—even with embedFonts: false. I’ll include the fix in the next release. Also, for future cases, I’ll add support for users to include their own icon-fonts (#51).

tinchox5 avatar Jul 04 '25 05:07 tinchox5