skolchin / sgf2gif

Small Python script to replay a saved SGF file (kifu) producing an animated GIF file
MIT License
1 stars 1 forks source link

ERROR %s cannot open resource #1

Open sugizo opened 1 year ago

sugizo commented 1 year ago

environment

google colab
os : ubuntu
python : 3.10.12

steps

!git clone https://github.com/skolchin/sgf2gif
!cd sgf2gif && pip install -r requirements.txt
!cd sgf2gif && python ./sgf2gif.py ./20221219_Shin-Jinseo_Ke-Jie.sgf out.gif -d 3 -n -s 2048

result

SGF file: ./20221219_Shin-Jinseo_Ke-Jie.sgf
Game properties:
    date played: 2022-12-19
    black: Shin Jinseo
    white: Ke Jie
    komi: 7.5
    handicap: unknown
    winner: B+R
    total moves: 181
Starting and ending moves: B[R16], W[E17], B[E4], ..., W[C18], B[F18], W[F17]
ERROR %s cannot open resource
qcgm1978 commented 4 months ago

Maybe your system hasn't or can't access arial.ttf. I modified the code as the following:

font_p = '/System/Library/Fonts/Supplemental/Arial.ttf' # the arial.ttf path in your system
label_fnt = ImageFont.truetype(font_p, size=label_fnt_sz)
move_fnt = ImageFont.truetype(font_p, size=move_fnt_sz)