Skip to content

Commit

Permalink
For local backend custom font path
Browse files Browse the repository at this point in the history
  • Loading branch information
xxnuo committed Dec 20, 2024
1 parent 7692434 commit ec57d04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pdf2zh/high_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit ec57d04

Please sign in to comment.