scripting - 是否可以删除/编辑 fontforge 中的元数据

标签 scripting fontforge

我有这样的东西正在转换字体

i=1
while ( i<$argc )
  Open($argv[i])
  # edit meta somehow
  Generate($argv[i]:r + type)
  i = i+1
endloop

打印此元数据

Created by FontForge 20141024 at Wed Nov 12 16:59:42 2014
 By Jimmy Wärting

我想删除或更改

最佳答案

您可以使用内置函数 SetFontNames

它有这样的签名:

SetFontNames(fontname[,family[,fullname[,weight[,copyright-notice[,fontversion]]]]])

i=1
while ( i<$argc )
  Open($argv[i])
  #edit meta
  SetFontNames('fontName', 'fontFamilyName', 'fullName', 'weight', 
'copyright', 'version')
  Generate($argv[i]:r + type)
  i = i+1
endloop

如果有些参数不是必须的,就写空字符串:

 SetFontNames('', '', '', '', 'copyright', 'version')

更多详情请见https://fontforge.github.io/scripting-alpha.html

关于scripting - 是否可以删除/编辑 fontforge 中的元数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26891490/

相关文章:

linux - 如何从 Perl 运行和结束 script() linux 命令?

bash - 新 Bash session 的多个初始化文件

compiler-errors - 来自源的 'making' fontforge错误

fonts - fontforge - 合并字体以添加字形的脚本

python - 在 Ubuntu 中安装 fontcustom/fontforge

typography - 使用 fontforge 脚本设置基线

linux - 需要使用 BASH 脚本从 FQDN 列表中删除 TLD

linux - Sed 似乎正在删除整行

Pip install fontforge,说找不到版本

scala - Scala 脚本的有用资源