Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,15 +8,10 @@ import uuid
|
|
| 8 |
from urllib.request import urlretrieve
|
| 9 |
import os
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 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):
|