Fix tests

This commit is contained in:
Joachim 2022-01-20 22:19:49 +01:00 committed by Joel Bradshaw
parent 6f5115c716
commit 766a0cc652

View file

@ -41,12 +41,15 @@ def get_font(weight, size=28):
except OSError:
font = ImageFont.load_default()
if (weight == 'light'):
font.set_variation_by_name('Light')
if (weight == 'bold'):
font.set_variation_by_name('Bold')
if (weight == 'regular'):
font.set_variation_by_name('Regular')
try:
if weight == "light":
font.set_variation_by_name("Light")
if weight == "bold":
font.set_variation_by_name("Bold")
if weight == "regular":
font.set_variation_by_name("Regular")
except AttributeError:
pass
return font