9951 explained code solutions for 126 technologies


python-matplotlibHow to list supported fonts


import matplotlib.font_manager
fonts = matplotlib.font_manager.findSystemFonts(fontpaths=None, fontext='ttf')
print(fonts)ctrl + c
import matplotlib.font_manager

load font manager component

findSystemFonts

finds all fonts according to given params

fontext='ttf'

find all available ttf fonts

print(fonts)

print the list of supported fonts


Usage example

import matplotlib.font_manager
fonts = matplotlib.font_manager.findSystemFonts(fontpaths=None, fontext='ttf')
print(fonts)
output
['/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf', '/usr/share/fonts/truetype/msttcorefonts/Webdings.ttf', '/usr/share/fonts/truetype/liberation/LiberationSerif-BoldItalic.ttf', '/usr/share/fonts/truetype/msttcorefonts/Arial_Black.ttf', '/usr/share/fonts/truetype/msttcorefonts/arialbd.ttf', '/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Regular.ttf', '/usr/share/fonts/truetype/msttcorefonts/trebucit.ttf', '/usr/share/fonts/truetype/msttcorefonts/Georgia_Bold.ttf', '/usr/share/fonts/truetype/msttcorefonts/impact.ttf', '/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf', '/usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf', '/usr/share/fonts/truetype/msttcorefonts/ariblk.ttf', '/usr/share/fonts/truetype/msttcorefonts/webdings.ttf', '/usr/share/fonts/truetype/msttcorefonts/arialbi.ttf', '/usr/share/fonts/truetype/msttcorefonts/times.ttf', '/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf', '/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf', '/usr/share/fonts/truetype/msttcorefonts/Andale_Mono.ttf', '/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf', '/usr/share/fonts/truetype/msttcorefonts/Impact.ttf', '/usr/share/fonts/truetype/msttcorefonts/georgiai.ttf', '/usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf', '/usr/share/fonts/truetype/msttcorefonts/georgiaz.ttf', '/usr/share/fonts/truetype/msttcorefonts/courbi.ttf', '/usr/share/fonts/truetype/msttcorefonts/verdanai.ttf', '/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Italic.ttf', '/usr/share/fonts/truetype/liberation/LiberationSans-Italic.ttf', '/usr/share/fonts/truetype/msttcorefonts/timesbi.ttf', '/usr/share/fonts/truetype/liberation/LiberationSansNarrow-BoldItalic.ttf', '/usr/share/fonts/truetype/msttcorefonts/verdana.ttf', '/usr/share/fonts/truetype/msttcorefonts/comicbd.ttf', '/usr/share/fonts/truetype/msttcorefonts/courbd.ttf', '/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf', '/usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf', '/usr/share/fonts/truetype/msttcorefonts/timesi.ttf', '/usr/share/fonts/truetype/msttcorefonts/Verdana.ttf', '/usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS.ttf', '/usr/share/fonts/truetype/msttcorefonts/Georgia_Italic.ttf', '/usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf', '/usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS_Bold.ttf', '/usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS_Italic.ttf', '/usr/share/fonts/truetype/msttcorefonts/Arial.ttf', '/usr/share/fonts/truetype/liberation/LiberationMono-Bold.ttf', '/usr/share/fonts/truetype/msttcorefonts/cour.ttf', '/usr/share/fonts/truetype/msttcorefonts/verdanab.ttf', '/usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf', '/usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf', '/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Bold.ttf', '/usr/share/fonts/truetype/liberation/LiberationSerif-Regular.ttf', '/usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf', '/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf', '/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf', '/usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf', '/usr/share/fonts/truetype/msttcorefonts/Georgia_Bold_Italic.ttf', '/usr/share/fonts/truetype/msttcorefonts/timesbd.ttf', '/usr/share/fonts/truetype/msttcorefonts/arial.ttf', '/usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf', '/usr/share/fonts/truetype/liberation/LiberationSerif-Italic.ttf', '/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf', '/usr/share/fonts/truetype/msttcorefonts/andalemo.ttf', '/usr/share/fonts/truetype/msttcorefonts/verdanaz.ttf', '/usr/share/fonts/truetype/liberation/LiberationMono-BoldItalic.ttf', '/usr/share/fonts/truetype/msttcorefonts/georgia.ttf', '/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf', '/usr/share/fonts/truetype/msttcorefonts/Georgia.ttf', '/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf', '/usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf', '/usr/share/fonts/truetype/msttcorefonts/trebucbi.ttf', '/usr/share/fonts/truetype/msttcorefonts/trebucbd.ttf', '/usr/share/fonts/truetype/msttcorefonts/comic.ttf', '/usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS_Bold_Italic.ttf', '/usr/share/fonts/truetype/msttcorefonts/georgiab.ttf', '/usr/share/fonts/truetype/msttcorefonts/trebuc.ttf', '/usr/share/fonts/truetype/liberation/LiberationSerif-Bold.ttf', '/usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf', '/usr/share/fonts/truetype/liberation/LiberationMono-Italic.ttf', '/usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf', '/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf', '/usr/share/fonts/truetype/msttcorefonts/couri.ttf', '/usr/share/fonts/truetype/msttcorefonts/ariali.ttf', '/usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf', '/usr/share/fonts/truetype/liberation/LiberationSans-BoldItalic.ttf']