Skip to content

Commit b1e514d

Browse files
committed
Merge branch 'master' of https://github.com/ebenp/matplotlib
2 parents a5c70ac + 0969842 commit b1e514d

3 files changed

Lines changed: 10 additions & 22 deletions

File tree

‎doc/thirdpartypackages/index.rst‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -283,30 +283,14 @@ border, and logo.
283283
:height: 330px
284284

285285
figpager
286-
<<<<<<< HEAD
287-
<<<<<<< HEAD
288286
========
289287

290288
`figpager <https://pypi.org/project/figpager/>`_ provides
291289
customizable figure elements such as text, lines and images
292290
and subplot layout control for single or multi page output.
293291

294292
.. image:: /_static/figpager.png
295-
<<<<<<< HEAD
296-
=======
297-
=====
298-
=======
299-
========
300-
>>>>>>> 898e67f65... Corrected formatting in figpager entry
301293

302-
`figpager <https://pypi.org/project/figpager/>`_ provides
303-
customizable figure elements such as text, lines and images
304-
and subplot layout control for single or multi page output.
305-
306-
.. image:: /_static/figpager_out_1.png
307-
>>>>>>> 5afe979a7... Added figpager info
308-
=======
309-
>>>>>>> 37a6fffb2... Updated figpager image path
310294

311295
blume
312296
=====

‎lib/matplotlib/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ def _get_config_or_cache_dir(xdg_base):
480480
"recommended to set the MPLCONFIGDIR environment variable to a "
481481
"writable directory, in particular to speed up the import of "
482482
"Matplotlib and to better support multiprocessing.",
483-
configdir, tmpdir)
483+
tmpdir, configdir)
484484
return tmpdir
485485

486486

‎lib/matplotlib/font_manager.py‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@
161161
]
162162

163163

164+
@lru_cache(64)
165+
def _cached_realpath(path):
166+
return os.path.realpath(path)
167+
168+
164169
def get_fontext_synonyms(fontext):
165170
"""
166171
Return a list of file extensions extensions that are synonyms for
@@ -1308,10 +1313,9 @@ def findfont(self, prop, fontext='ttf', directory=None,
13081313
rc_params = tuple(tuple(rcParams[key]) for key in [
13091314
"font.serif", "font.sans-serif", "font.cursive", "font.fantasy",
13101315
"font.monospace"])
1311-
filename = self._findfont_cached(
1316+
return self._findfont_cached(
13121317
prop, fontext, directory, fallback_to_default, rebuild_if_missing,
13131318
rc_params)
1314-
return os.path.realpath(filename)
13151319

13161320
@lru_cache()
13171321
def _findfont_cached(self, prop, fontext, directory, fallback_to_default,
@@ -1382,7 +1386,7 @@ def _findfont_cached(self, prop, fontext, directory, fallback_to_default,
13821386
else:
13831387
raise ValueError("No valid font could be found")
13841388

1385-
return result
1389+
return _cached_realpath(result)
13861390

13871391

13881392
@lru_cache()
@@ -1411,10 +1415,10 @@ def is_opentype_cff_font(filename):
14111415
def get_font(filename, hinting_factor=None):
14121416
# Resolving the path avoids embedding the font twice in pdf/ps output if a
14131417
# single font is selected using two different relative paths.
1414-
filename = os.path.realpath(filename)
1418+
filename = _cached_realpath(filename)
14151419
if hinting_factor is None:
14161420
hinting_factor = rcParams['text.hinting_factor']
1417-
return _get_font(os.fspath(filename), hinting_factor,
1421+
return _get_font(filename, hinting_factor,
14181422
_kerning_factor=rcParams['text.kerning_factor'])
14191423

14201424

0 commit comments

Comments
 (0)