是否可以通过命令行从svg创建字体(TTF) ?



我有一组svg,我想变成一个字体(TTF) -但它必须以自动化的方式完成-这是可能的吗?

看起来好像fontforge等都需要一些人工交互

可以使用fontforge:

import fontforge
# create an empty font in memory
font = fontforge.font()
# Create a char in the unicode 41 pos (an "A")
glyph = font.createChar(41, 'A')
# Import the glyph info
glyph.importOutlines('/path/to/svg/foo.svg')
# Write the font from memory to a TTF file
font.generate('/output/math/foo.ttf')

最新更新