The most elegant way I found:
from matplotlib.font_manager import get_font_names def font_exists(name): return name in get_font_names()