Skip to content

Minor fontproperty fixes. #16120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,6 @@ def __init__(self,
self.set_file(fname)
self.set_size(size)

def _parse_fontconfig_pattern(self, pattern):
return parse_fontconfig_pattern(pattern)

def __hash__(self):
l = (tuple(self.get_family()),
self.get_slant(),
Expand Down Expand Up @@ -850,7 +847,7 @@ def set_fontconfig_pattern(self, pattern):
This support does not depend on fontconfig; we are merely borrowing its
pattern syntax for use here.
"""
for key, val in self._parse_fontconfig_pattern(pattern).items():
for key, val in parse_fontconfig_pattern(pattern).items():
if type(val) == list:
getattr(self, "set_" + key)(val[0])
else:
Expand Down
4 changes: 1 addition & 3 deletions lib/matplotlib/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,17 @@ def __init__(self,
color = rcParams['text.color']
if fontproperties is None:
fontproperties = FontProperties()
elif isinstance(fontproperties, str):
fontproperties = FontProperties(fontproperties)

self._text = ''
self.set_text(text)
self.set_color(color)
self.set_fontproperties(fontproperties)
self.set_usetex(usetex)
self.set_wrap(wrap)
self.set_verticalalignment(verticalalignment)
self.set_horizontalalignment(horizontalalignment)
self._multialignment = multialignment
self._rotation = rotation
self._fontproperties = fontproperties
self._bbox_patch = None # a FancyBboxPatch instance
self._renderer = None
if linespacing is None:
Expand Down