mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-10 09:15:28 +00:00
Fix tests
This commit is contained in:
parent
6f5115c716
commit
766a0cc652
1 changed files with 9 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue