CyanoHao / Resource-Han-Rounded

Resource Han Rounded, a rounded font family derived from Source Han Sans.
Other
355 stars 12 forks source link

Error in making font - file not created before dumping #5

Closed NightFurySL2001 closed 4 years ago

NightFurySL2001 commented 4 years ago

When trying to make the font file with my own Source Han Sans font, I put the .otd file in the src folder and run round.py. After running for a long time the following message occur:

Traceback (most recent call last):
  File "round.py", line 660, in <module>
    RoundFont(region, weight)
  File "round.py", line 653, in RoundFont
    with open("out/ResourceHanRounded{}-{}.otd".format(region, weight), 'w') as outFile:
FileNotFoundError: [Errno 2] No such file or directory: 'out/ResourceHanRoundedSC-Regular.otd'

It seems to not create a file before dumping the JSON. Is this expected behaviour?

CyanoHao commented 4 years ago

Run mkdir -p out/ first.

NightFurySL2001 commented 4 years ago

Thanks. Here's another error:

Traceback (most recent call last):
  File "round.py", line 660, in <module>
    RoundFont(region, weight)
  File "round.py", line 654, in RoundFont
    outFile.write(outStr)
UnicodeEncodeError: 'gbk' codec can't encode character '\xa9' in position 3209: illegal multibyte sequence

Can you help on this one?

CyanoHao commented 4 years ago

Should be fixed in commit#17128f2. It’s now UTF-8 encoded.

NightFurySL2001 commented 4 years ago

Ok, its fixed. Thanks for helping.