bartwisch commited on
Commit
d96a7cf
·
1 Parent(s): 14c6db0

chore: prefer DejaVuSans from Linux path for overlay font

Browse files
Files changed (1) hide show
  1. src/image_processor.py +7 -1
src/image_processor.py CHANGED
@@ -167,7 +167,13 @@ class ImageProcessor:
167
 
168
  def _load_font(self, fontsize: int):
169
  """Helper to load a font with fallback"""
170
- font_names = ["Arial.ttf", "/System/Library/Fonts/Helvetica.ttc", "/System/Library/Fonts/Supplemental/Arial.ttf", "DejaVuSans.ttf"]
 
 
 
 
 
 
171
  for name in font_names:
172
  try:
173
  return ImageFont.truetype(name, fontsize)
 
167
 
168
  def _load_font(self, fontsize: int):
169
  """Helper to load a font with fallback"""
170
+ font_names = [
171
+ "Arial.ttf", # generic name (Windows/macOS dev)
172
+ "/System/Library/Fonts/Helvetica.ttc", # macOS
173
+ "/System/Library/Fonts/Supplemental/Arial.ttf", # macOS supplemental
174
+ "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", # common Linux path (HF Spaces)
175
+ "DejaVuSans.ttf", # fallback by font name
176
+ ]
177
  for name in font_names:
178
  try:
179
  return ImageFont.truetype(name, fontsize)