Spaces:
Running
Running
capradeepgujaran
commited on
Commit
•
0287e79
1
Parent(s):
5af6c1b
Update app.py
Browse files
app.py
CHANGED
@@ -170,6 +170,11 @@ class FontManager:
|
|
170 |
|
171 |
return font_paths
|
172 |
|
|
|
|
|
|
|
|
|
|
|
173 |
class CertificateGenerator:
|
174 |
def __init__(self):
|
175 |
self.certificate_size = (1200, 800)
|
@@ -184,6 +189,7 @@ class CertificateGenerator:
|
|
184 |
"""Load fonts with fallbacks"""
|
185 |
fonts = {}
|
186 |
try:
|
|
|
187 |
fonts['title'] = ImageFont.truetype(self.font_paths['bold'], 60)
|
188 |
fonts['text'] = ImageFont.truetype(self.font_paths['regular'], 40)
|
189 |
fonts['subtitle'] = ImageFont.truetype(self.font_paths['regular'], 30)
|
|
|
170 |
|
171 |
return font_paths
|
172 |
|
173 |
+
class QuizGenerationError(Exception):
|
174 |
+
"""Exception raised for errors in quiz generation"""
|
175 |
+
pass
|
176 |
+
|
177 |
+
|
178 |
class CertificateGenerator:
|
179 |
def __init__(self):
|
180 |
self.certificate_size = (1200, 800)
|
|
|
189 |
"""Load fonts with fallbacks"""
|
190 |
fonts = {}
|
191 |
try:
|
192 |
+
# Use Liberation Sans fonts instead of Arial
|
193 |
fonts['title'] = ImageFont.truetype(self.font_paths['bold'], 60)
|
194 |
fonts['text'] = ImageFont.truetype(self.font_paths['regular'], 40)
|
195 |
fonts['subtitle'] = ImageFont.truetype(self.font_paths['regular'], 30)
|