diff --git a/pdf2zh/high_level.py b/pdf2zh/high_level.py index 6f0691de..b96ac916 100644 --- a/pdf2zh/high_level.py +++ b/pdf2zh/high_level.py @@ -189,7 +189,8 @@ def translate_stream( elif lang_out.lower() in noto_list: # noto resfont = "noto" # docker - ttf_path = "/app/GoNotoKurrent-Regular.ttf" + ttf_path = os.environ.get("NOTO_FONT_PATH", "/app/GoNotoKurrent-Regular.ttf") + if not os.path.exists(ttf_path): ttf_path = os.path.join(tempfile.gettempdir(), "GoNotoKurrent-Regular.ttf") if not os.path.exists(ttf_path):