googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
152 stars 43 forks source link

The familyName in the font information cannot use other characters and must be ascii. #690

Open StringKe opened 1 year ago

StringKe commented 1 year ago
font = defcon.Font()
setattr(font.info, "familyName", "中文")
font.save(path=ufo_dir)

ufo = defcon.Font(ufo_dir)
otf = ufo2ft.compileOTF(ufo)
otf.save(ttf_file)

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128)