yinuozhang commited on
Commit
f5f80ba
·
1 Parent(s): a21a9e8

font size change

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -349,7 +349,15 @@ def annotate_cyclic_structure(mol, sequence):
349
  # Convert to PIL Image
350
  img = Image.open(BytesIO(drawer.GetDrawingText()))
351
  draw = ImageDraw.Draw(img)
352
- small_font = ImageFont.load_default()
 
 
 
 
 
 
 
 
353
 
354
  # Add just the sequence header at the top
355
  seq_text = f"Sequence: {sequence}"
 
349
  # Convert to PIL Image
350
  img = Image.open(BytesIO(drawer.GetDrawingText()))
351
  draw = ImageDraw.Draw(img)
352
+ try:
353
+ small_font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 60)
354
+ except OSError:
355
+ try:
356
+ small_font = ImageFont.truetype("arial.ttf", 60)
357
+ except OSError:
358
+ # If no TrueType fonts are available, fall back to default
359
+ print("Warning: TrueType fonts not available, using default font")
360
+ small_font = ImageFont.load_default()
361
 
362
  # Add just the sequence header at the top
363
  seq_text = f"Sequence: {sequence}"