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

Skip to content

Commit 76c614c

Browse files
committed
Keep FontEntry helpers private.
They are not released yet and don't need to be made public.
1 parent af76ddf commit 76c614c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/matplotlib/font_manager.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def findSystemFonts(fontpaths=None, fontext='ttf'):
382382
return [fname for fname in fontfiles if os.path.exists(fname)]
383383

384384

385-
def fontentry_helper_repr_png_(fontent):
385+
def _fontentry_helper_repr_png(fontent):
386386
from matplotlib.figure import Figure # Circular import.
387387
fig = Figure()
388388
font_path = Path(fontent.fname) if fontent.fname != '' else None
@@ -392,8 +392,8 @@ def fontentry_helper_repr_png_(fontent):
392392
return buf.getvalue()
393393

394394

395-
def fontentry_helper_repr_html_(fontent):
396-
png_stream = fontentry_helper_repr_png_(fontent)
395+
def _fontentry_helper_repr_html(fontent):
396+
png_stream = _fontentry_helper_repr_png(fontent)
397397
png_b64 = b64encode(png_stream).decode()
398398
return f"<img src=\"data:image/png;base64, {png_b64}\" />"
399399

@@ -414,8 +414,8 @@ def fontentry_helper_repr_html_(fontent):
414414
415415
It is used when populating the font lookup dictionary.
416416
""",
417-
'_repr_html_': lambda self: fontentry_helper_repr_html_(self),
418-
'_repr_png_': lambda self: fontentry_helper_repr_png_(self),
417+
'_repr_html_': lambda self: _fontentry_helper_repr_html(self),
418+
'_repr_png_': lambda self: _fontentry_helper_repr_png(self),
419419
}
420420
)
421421

0 commit comments

Comments
 (0)