How to get a list of installed Windows fonts using Python?
How to get a list of installed windows fonts using python?
266
25-Jul-2023
Aryan Kumar
25-Jul-2023Sure, here is how you can get a list of installed Windows fonts using Python:
Python
This code will first import the
winreg
module, which is used to access the Windows registry. Then, it will define a function calledget_installed_fonts()
. This function will get the registry key for the installed fonts and enumerate the values in the key. For each value, it will get the font path and add it to a list. Finally, the function will return the list of fonts.The
get_installed_fonts()
function can be called from the main body of the program. This will print a list of all the installed Windows fonts to the console.