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: except OSError:
font = ImageFont.load_default() font = ImageFont.load_default()
if (weight == 'light'): try:
font.set_variation_by_name('Light') if weight == "light":
if (weight == 'bold'): font.set_variation_by_name("Light")
font.set_variation_by_name('Bold') if weight == "bold":
if (weight == 'regular'): font.set_variation_by_name("Bold")
font.set_variation_by_name('Regular') if weight == "regular":
font.set_variation_by_name("Regular")
except AttributeError:
pass
return font return font