如何更改fontforge(Python)中的字形边框?

时间:2019-03-21 06:50:25

标签: fonts fontforge

我使用potrace为字形创建svg,然后使用字形将现有字体中的字形替换为:

import fontforge
font = fontforge.open(font_name) # this will open the existing font
font.removeGlyph(ord(font_char)) # remove existing glyph
glyph = font.createMappedChar(ord(font_char)) # create a new character
glyph.importOutlines(font_glyph) # add the outline

生成的字体看起来不均匀,因此我使用glyph.transform(psMat.scale(glyph_size))缩放了字符,但是由于混合效果,某些字符无法缩放(即在命令后未调整其缩放比例)。有没有一种方法可以直接在python中设置字形边界框?理想情况下,这还将设置字体的左右边界。

0 个答案:

没有答案