8000 Merge pull request #3868 from jenshnielsen/font_family_unicode · matplotlib/matplotlib@143973a · GitHub
[go: up one dir, main page]

Skip to content

Commit 143973a

Browse files
committed
Merge pull request #3868 from jenshnielsen/font_family_unicode
BUG : Ensure that font family is unicode
1 parent 431edb7 commit 143973a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/font_manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
set
5353
except NameError:
5454
from sets import Set as set
55+
from collections import Iterable
5556
import matplotlib
5657
from matplotlib import afm
5758
from matplotlib import ft2font
@@ -822,7 +823,9 @@ def set_family(self, family):
822823
if family is None:
823824
family = rcParams['font.family']
824825
if is_string_like(family):
825-
family = [family]
826+
family = [six.text_type(family)]
827+
elif (not is_string_like(family) and isinstance(family, Iterable)):
828+
family = [six.text_type(f) for f in family]
826829
self._family = family
827830
set_name = set_family
828831

0 commit comments

Comments
 (0)
0