From f3963aabd2b491f5129bcdcc5d2cb3530b691306 Mon Sep 17 00:00:00 2001 From: Robin Lewis Date: Mon, 23 Feb 2015 11:51:51 +0000 Subject: [PATCH] Allow .otf files in truetype() --- PIL/ImageFont.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIL/ImageFont.py b/PIL/ImageFont.py index afbae372f..a2f2db43c 100644 --- a/PIL/ImageFont.py +++ b/PIL/ImageFont.py @@ -239,7 +239,7 @@ def truetype(font=None, size=10, index=0, encoding="", filename=None): try: return FreeTypeFont(font, size, index, encoding) except IOError: - if font.endswith(".ttf"): + if font.endswith(".ttf") or font.endswith(".otf"): ttf_filename = font else: ttf_filename = "%s.ttf" % font