[python-win32] List all fonts filename

Tim Roberts timr at probo.com
Fri Dec 30 21:24:17 EST 2022


On 12/23/22 6:29 AM, Moi15 Moi wrote:

>
> Is it possible to list all the fonts filename with pywin32?
>
> From what I can see, it is possible with the GetFontData 
> <https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-getfontdata> from 
> GDI.

GetFontData is certainly available in pywin32, as are most Win32 APIs.  
However, it only returns information about one font at a time -- the 
font that is currently selected into that DC.

You can use EnumFontFamilies or EnumFontFamiliesEx, available in win32gui.

http://timgolden.me.uk/pywin32-docs/win32gui__EnumFontFamilies_meth.html

https://stackoverflow.com/questions/5760594/pywin32-enumfontfamilies-breaks-python

-- 
Tim Roberts,timr at probo.com
Providenza & Boekelheide, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/python-win32/attachments/20221230/9907a86a/attachment.html>


More information about the python-win32 mailing list