How to get a list of all the fonts currently available for Matplotlib?


To get a list of all the fonts currently available for matplotlib, we can use the font_manager.findSystemFonts() method.

Steps

  • Print a statement.

  • Use font_manager.findSystemFonts() method to get a list of fonts availabe.

Example

from matplotlib import font_manager

print("List of all fonts currently available in the matplotlib:
") print(*font_manager.findSystemFonts(fontpaths=None, fontext='ttf'), sep="
")

Output

/usr/share/fonts/truetype/Nakula/nakula.ttf
/usr/share/fonts/truetype/ubuntu/Ubuntu-L.ttf
/usr/share/fonts/truetype/tlwg/Loma-BoldOblique.ttf
.................................................................
............................................................................
.................................................................................
........
/usr/share/fonts/truetype/lohit-malayalam/Lohit-Malayalam.ttf
/usr/share/fonts/truetype/tlwg/TlwgTypist-Oblique.ttf
/usr/share/fonts/truetype/liberation2/LiberationMono-Bold.ttf

Updated on: 06-May-2021

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements