hereIsChen
V2EX  ›  问与答

base64 的 iconfont 图标,有没有什么方法可以转换为其他文件格式?

  •  
  •   hereIsChen · May 24, 2024 · 1197 views
    This topic created in 746 days ago, the information mentioned may be changed or developed.
    项目里面用的是 iconfont 图标库的图标,已经是 n 手的项目的,找不到之前图片的源。图标用的都是 base64 的方式渲染的。文件也只有 base64 的 css 文件。

    css 内格式为这样, @font-face {font-family: 'iconfont';src: url('data:font/woff2;charset=utf-8;base64,xx......xxxx format('woff2');} .icon-home:before{content: '\e1234';} .icon-user:before{content: '\e5678'}

    用搜索引擎找了下,没有找到可用的方法,有没有什么办法可以转换这个的格式?转换为 woff2 、svg 等格式的
    4 replies    2024-05-24 09:27:34 +08:00
    zcf0508
        1
    zcf0508  
       May 24, 2024 via Android
    😳 我寻思 base64 是可以直接转回源文件的啊
    hereIsChen
        2
    hereIsChen  
    OP
       May 24, 2024
    @zcf0508 #1 这个 iconfont 的字体图标,不是 base64 图片
    qhd1988
        3
    qhd1988  
       May 24, 2024
    你把这个 base64 链接,贴浏览器地址栏,不就能给你转回原文件?
    然后你想要用原文件干啥,不是随你的便了?
    tool2dx
        4
    tool2dx  
       May 24, 2024
    你写着 src 是 data:font/woff2; 那大概率已经是 woff2 格式了。

    把 base64 解码一次,保存到.woff2 文件就可以了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3234 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 12:27 · PVG 20:27 · LAX 05:27 · JFK 08:27
    ♥ Do have faith in what you're doing.