fionasu commited on
Commit
8eaeed4
·
verified ·
1 Parent(s): 120c2bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -9
app.py CHANGED
@@ -8,15 +8,10 @@ import uuid
8
  from urllib.request import urlretrieve
9
  import os
10
 
11
- FONT_DIR = "/tmp/fonts"
12
- FONT_PATH = os.path.join(FONT_DIR, "NotoSans-Regular.ttf")
13
-
14
- os.makedirs(FONT_DIR, exist_ok=True)
15
- if not os.path.exists(FONT_PATH):
16
- urlretrieve(
17
- "https://github.com/google/fonts/raw/main/ofl/notosans/NotoSans-Regular.ttf",
18
- FONT_PATH
19
- )
20
 
21
  def generate_pdf_from_chat(chat_history):
22
  if not chat_history or not isinstance(chat_history, list):
 
8
  from urllib.request import urlretrieve
9
  import os
10
 
11
+ FONT_PATH = "NotoSans-Regular.ttf"
12
+
13
+ pdf.add_font("NotoSans", "", FONT_PATH, uni=True)
14
+ pdf.set_font("NotoSans", size=12)
 
 
 
 
 
15
 
16
  def generate_pdf_from_chat(chat_history):
17
  if not chat_history or not isinstance(chat_history, list):