Spaces:
Sleeping
Sleeping
Update Def PDF 3
Browse files
app.py
CHANGED
@@ -100,11 +100,12 @@ def write_pdf(transcription, output_file, tokenizer=None, translation_model=None
|
|
100 |
pdf = FPDF()
|
101 |
pdf.set_auto_page_break(auto=True, margin=15)
|
102 |
pdf.add_page()
|
103 |
-
pdf.set_font("Arial", size=12)
|
104 |
-
|
105 |
-
for i, segment in enumerate(transcription['segments']):
|
106 |
|
|
|
|
|
|
|
107 |
|
|
|
108 |
text = segment['text']
|
109 |
|
110 |
if translation_model:
|
|
|
100 |
pdf = FPDF()
|
101 |
pdf.set_auto_page_break(auto=True, margin=15)
|
102 |
pdf.add_page()
|
|
|
|
|
|
|
103 |
|
104 |
+
# Use a Unicode font like DejaVuSans that supports a wide range of characters
|
105 |
+
pdf.add_font('DejaVu', '', '/path/to/DejaVuSans.ttf', uni=True)
|
106 |
+
pdf.set_font("DejaVu", size=12)
|
107 |
|
108 |
+
for i, segment in enumerate(transcription['segments']):
|
109 |
text = segment['text']
|
110 |
|
111 |
if translation_model:
|