This tool allows you to get the font filename on your system. It will collect TrueType (.ttf), OpenType (.otf), TrueType Collection (.ttc) and OpenType Collection (.otc) font format.
It uses some APIs to find the font filename:
- Windows (Vista SP2 and more are supported): DirectWrite API and GDI API
- macOS (10.6 and more are supported): Core Text API
- Unix: Fontconfig API
- Android (SDK/API 29 and more are supported): NDK Font API
pip install FindSystemFontsFilename
from find_system_fonts_filename import get_system_fonts_filename, FindSystemFontsFilenameException
try:
fonts_filename = get_system_fonts_filename()
except FindSystemFontsFilenameException:
# Deal with the exception
pass