yizhiwang96 / deepvecfont

[SIGGRAPH Asia 2021] DeepVecFont: Synthesizing High-quality Vector Fonts via Dual-modality Learning
MIT License
182 stars 31 forks source link

No such glyph #20

Closed Johnson-yue closed 2 years ago

Johnson-yue commented 2 years ago

I used ‘data/utils/convert_ttf_to_sfd_mp.py’ and add '0123456789' after charset, so the finally charset is "a-zA-Z0-9".

when convert "a-zA-Z" it is success, but it failed when char is "0"
TypeError:No such glyph
the error code is line 61 char_description.write(str(new_font_for_char[char].width) + "\n")

I check the font and it has "0" glyph in ttf file

Johnson-yue commented 2 years ago

I close this because, in fontforge, 0 = "zero" so new_font_for_char["zero"].width it works

yizhiwang96 commented 2 years ago

Thank you for sharing this solution. We also found reading non-latin characters needs unicodes to be the indexes.