从 ttc 中提取 ttf 文件: ttc2ttf.pe

从 ttc 中提取 ttf 文件: ttc2ttf.pe

#!/usr/local/bin/fontforge
# Usage: fontforge -script ttc2ttf.pe /path/to/font.ttc

fonts = FontsInFile($1)
n = SizeOf(fonts)
i = 0
while (i < n)
    Open($1 + "(" + fonts[i] + ")", 1)

    index = ToString(i + 1)
    if (i < 9)
        index = "0" + index
    endif

    ext = ".ttf"
    if ($order == 3)
        ext = ".otf"
    endif

    filename = $fontname + "-" + index + ext
    Generate(filename)
    Print(filename)
    Close()
    ++i
endloop

相关文章

mac 使用 tcpdump 抓包指定端口
自动将windows本地公钥写入linux服务器的bat
mac查看占用端口的进程
循环读取 txt 文件中的链接并下载
从 ttc 中提取 ttf 文件: ttc2ttf.pe
mac osx python 安装 mysqlclient