Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 49d111c

Browse files
authored
Merge pull request #15673 from anntzer/unfindfont
Rely on findfont autofallback-to-default in pdf/ps backends.
2 parents 907efd0 + b8af401 commit 49d111c

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

lib/matplotlib/backends/_backend_pdf_ps.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,8 @@ def get_text_width_height_descent(self, s, prop, ismath):
6969
return w, h, d
7070

7171
def _get_font_afm(self, prop):
72-
fname = (
73-
font_manager.findfont(
74-
prop, fontext="afm", directory=self._afm_font_dir)
75-
or font_manager.findfont(
76-
"Helvetica", fontext="afm", directory=self._afm_font_dir))
72+
fname = font_manager.findfont(
73+
prop, fontext="afm", directory=self._afm_font_dir)
7774
return _cached_get_afm_from_fname(fname)
7875

7976
def _get_font_ttf(self, prop):

lib/matplotlib/backends/backend_pdf.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -661,10 +661,6 @@ def fontName(self, fontprop):
661661
elif rcParams['pdf.use14corefonts']:
662662
filename = findfont(
663663
fontprop, fontext='afm', directory=RendererPdf._afm_font_dir)
664-
if filename is None:
665-
filename = findfont(
666-
"Helvetica",
667-
fontext='afm', directory=RendererPdf._afm_font_dir)
668664
else:
669665
filename = findfont(fontprop)
670666

0 commit comments

Comments
 (0)