1 Commits

Author SHA1 Message Date
90a43e2491 codecVis: support DejaVu font on macOS 2023-02-24 16:18:13 +01:00
4 changed files with 8 additions and 4 deletions

View File

@ -9,7 +9,4 @@ setup(
"checkMetadata = checkMetadata.__main__:main"
]
},
install_requires=[
'tqdm>=4.62.3'
]
)
)

View File

@ -7,6 +7,7 @@
"""
import os
import platform
import sys
import time
import subprocess
@ -55,6 +56,12 @@ def extract_frame(video_file, time_offset, output_file):
subprocess.call(shlex.split(cmd),stdout=devnull, stderr=devnull)
def get_font_path():
if platform.system() == "Darwin":
# Assume DejaVu to be installed in the user library
path = "~/Library/Fonts/DejaVuSans-Bold.ttf"
return os.path.expanduser(path)
# Default platform: Linux
path = "/usr/share/fonts"
files = glob.glob(path + "/**/DejaVuSans-Bold.ttf", recursive = True)
return files[0]