Skip to content

Commit 2b88813

Browse files
committed
fallback font
1 parent 98b2cd7 commit 2b88813

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/braindance.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ def to_surface(x, text=None):
2727
if text is not None:
2828
from PIL import ImageDraw, ImageFont
2929
fontsize=22
30-
font = ImageFont.truetype("/usr/share/fonts/liberation/LiberationSans-BoldItalic.ttf", fontsize)
30+
try:
31+
font = ImageFont.truetype("/usr/share/fonts/liberation/LiberationSans-BoldItalic.ttf", fontsize)
32+
except OSError:
33+
font = ImageFont.load_default()
3134
margin = 8
3235

3336
x = x.transpose(1,0,2)

0 commit comments

Comments
 (0)