Skip to content

Commit 03d98f1

Browse files
authored
Minor fontproperty fixes. (#16120)
Minor fontproperty fixes.
2 parents 68d5e2f + d6d3ce5 commit 03d98f1

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

lib/matplotlib/font_manager.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -657,9 +657,6 @@ def __init__(self,
657657
self.set_file(fname)
658658
self.set_size(size)
659659

660-
def _parse_fontconfig_pattern(self, pattern):
661-
return parse_fontconfig_pattern(pattern)
662-
663660
def __hash__(self):
664661
l = (tuple(self.get_family()),
665662
self.get_slant(),
@@ -850,7 +847,7 @@ def set_fontconfig_pattern(self, pattern):
850847
This support does not depend on fontconfig; we are merely borrowing its
851848
pattern syntax for use here.
852849
"""
853-
for key, val in self._parse_fontconfig_pattern(pattern).items():
850+
for key, val in parse_fontconfig_pattern(pattern).items():
854851
if type(val) == list:
855852
getattr(self, "set_" + key)(val[0])
856853
else:

lib/matplotlib/text.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,17 @@ def __init__(self,
153153
color = rcParams['text.color']
154154
if fontproperties is None:
155155
fontproperties = FontProperties()
156-
elif isinstance(fontproperties, str):
157-
fontproperties = FontProperties(fontproperties)
158156

159157
self._text = ''
160158
self.set_text(text)
161159
self.set_color(color)
160+
self.set_fontproperties(fontproperties)
162161
self.set_usetex(usetex)
163162
self.set_wrap(wrap)
164163
self.set_verticalalignment(verticalalignment)
165164
self.set_horizontalalignment(horizontalalignment)
166165
self._multialignment = multialignment
167166
self._rotation = rotation
168-
self._fontproperties = fontproperties
169167
self._bbox_patch = None # a FancyBboxPatch instance
170168
self._renderer = None
171169
if linespacing is None:

0 commit comments

Comments
 (0)