Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_trapping_clips: "arial.ttf" not found on Linux #14

Open
gabrielmittag opened this issue Jul 21, 2022 · 1 comment
Open

create_trapping_clips: "arial.ttf" not found on Linux #14

gabrielmittag opened this issue Jul 21, 2022 · 1 comment

Comments

@gabrielmittag
Copy link
Contributor

"arial.ttf" cannot be found on Ubuntu. Could maybe add an optional input argument for the font?

Start creating files
Traceback (most recent call last):
  File "create_trapping_clips.py", line 207, in <module>
    n_created_files = create_trap_db(tp_cfg, args.source, args.des)
  File "create_trapping_clips.py", line 129, in create_trap_db
    msg_videos = create_msg_video(cfg, des, s_f)
  File "create_trapping_clips.py", line 44, in create_msg_video
    create_msg_img(cfg, score, des, width, height)
  File "create_trapping_clips.py", line 85, in create_msg_img
    font = ImageFont.truetype("arial.ttf", font_size)
  File "/home/gmittag/miniconda3/lib/python3.8/site-packages/PIL/ImageFont.py", line 959, in truetype
    return freetype(font)
  File "/home/gmittag/miniconda3/lib/python3.8/site-packages/PIL/ImageFont.py", line 956, in freetype
    return FreeTypeFont(font, size, index, encoding, layout_engine)
  File "/home/gmittag/miniconda3/lib/python3.8/site-packages/PIL/ImageFont.py", line 247, in __init__
    self.font = core.getfont(
OSError: cannot open resource
@mehulmadaan02
Copy link

Verify that the font file "arial.ttf" is present on your instance. You can use the ls command to check if the file exists in the expected location:
1. ls /usr/share/fonts/truetype/msttcorefonts/arial.ttf

If the font file is not present, you can install it by running the following command:
1. sudo apt-get update
2. sudo apt-get install ttf-mscorefonts-installer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants