@@ -440,8 +440,6 @@ def __init__(self, filename, metadata=None):
440440 fh = filename
441441 self .passed_in_file_object = True
442442
443- self ._core14fontdir = os .path .join (
444- rcParams ['datapath' ], 'fonts' , 'pdfcorefonts' )
445443 self .fh = fh
446444 self .currentstream = None # stream object to write to, if any
447445 fh .write (b"%PDF-1.4\n " ) # 1.4 is the first version to have alpha
@@ -635,10 +633,11 @@ def fontName(self, fontprop):
635633 filename = fontprop
636634 elif rcParams ['pdf.use14corefonts' ]:
637635 filename = findfont (
638- fontprop , fontext = 'afm' , directory = self . _core14fontdir )
636+ fontprop , fontext = 'afm' , directory = RendererPdf . _afm_font_dir )
639637 if filename is None :
640638 filename = findfont (
641- "Helvetica" , fontext = 'afm' , directory = self ._core14fontdir )
639+ "Helvetica" ,
640+ fontext = 'afm' , directory = RendererPdf ._afm_font_dir )
642641 else :
643642 filename = findfont (fontprop )
644643
@@ -1571,7 +1570,7 @@ class RendererPdf(_backend_pdf_ps.RendererPDFPSBase):
15711570 def afm_font_cache (self , _cache = cbook .maxdict (50 )):
15721571 return _cache
15731572
1574- _afm_font_dir = pathlib . Path ( rcParams [ "datapath" ], " fonts" , " pdfcorefonts" )
1573+ _afm_font_dir = cbook . _get_data_path ( " fonts/ pdfcorefonts" )
15751574 _use_afm_rc_name = "pdf.use14corefonts"
15761575
15771576 def __init__ (self , file , image_dpi , height , width ):
0 commit comments