This commit is contained in:
GotenXiao 2015-04-01 01:51:12 +00:00
commit af30f8ae35

View File

@ -261,7 +261,7 @@ def truetype(font=None, size=10, index=0, encoding="", filename=None):
try: try:
return FreeTypeFont(font, size, index, encoding) return FreeTypeFont(font, size, index, encoding)
except IOError: except IOError:
if font.endswith(".ttf"): if font.endswith(".ttf") or font.endswith(".otf"):
ttf_filename = font ttf_filename = font
else: else:
ttf_filename = "%s.ttf" % font ttf_filename = "%s.ttf" % font