【问题标题】:Is it possible to create fonts (TTF) from SVGs from the command line?是否可以从命令行从 SVG 创建字体(TTF)?
【发布时间】:2014-08-12 18:09:25
【问题描述】:

我有一组 SVG 想要转换为字体 (TTF) - 但必须以自动化方式完成 - 这可能吗?

似乎fontforge等都需要一些人工交互。

【问题讨论】:

    标签: svg fonts font-face font-awesome fontforge


    【解决方案1】:

    使用 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')
    

    【讨论】:

      猜你喜欢
      • 2010-11-06
      • 2014-04-27
      • 2018-10-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-02
      • 2016-02-25
      • 2012-10-16
      相关资源
      最近更新 更多