Skip to content

Commit

Permalink
Merge pull request #15673 from anntzer/unfindfont
Browse files Browse the repository at this point in the history
Rely on findfont autofallback-to-default in pdf/ps backends.
  • Loading branch information
dstansby committed Nov 22, 2019
2 parents 907efd0 + b8af401 commit 49d111c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 2 additions & 5 deletions lib/matplotlib/backends/_backend_pdf_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,8 @@ def get_text_width_height_descent(self, s, prop, ismath):
return w, h, d

def _get_font_afm(self, prop):
fname = (
font_manager.findfont(
prop, fontext="afm", directory=self._afm_font_dir)
or font_manager.findfont(
"Helvetica", fontext="afm", directory=self._afm_font_dir))
fname = font_manager.findfont(
prop, fontext="afm", directory=self._afm_font_dir)
return _cached_get_afm_from_fname(fname)

def _get_font_ttf(self, prop):
Expand Down
4 changes: 0 additions & 4 deletions lib/matplotlib/backends/backend_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,10 +661,6 @@ def fontName(self, fontprop):
elif rcParams['pdf.use14corefonts']:
filename = findfont(
fontprop, fontext='afm', directory=RendererPdf._afm_font_dir)
if filename is None:
filename = findfont(
"Helvetica",
fontext='afm', directory=RendererPdf._afm_font_dir)
else:
filename = findfont(fontprop)

Expand Down

0 comments on commit 49d111c

Please sign in to comment.