Get List of Fonts (Win32)

I want to create a combo box with all the fonts installed on it listed in it. I am not sure how to do this. Do I need to access the registry to get this? Thanks

+6
c ++ fonts winapi
source share
2 answers

You should use the Win32 EnumFontFamiliesEx API function. You call this function by passing a callback function that matches the type of EnumFontFamExProc . The callback function is called once for each font found by EnumFontFamiliesEx.

I would recommend using the Unicode version (EnumFontFamiliesExW), since I saw that the ascii version (EnumFontFamiliesExA) exhibits very strange behavior for East Asian fonts.

Related articles have sample code.

+8
source share

In this case, winapi uses the EnumFontFamiliesEx function. You must pass the filled structure with the default parameter DEFAULT_CHARSET to display all installed fonts.

See MSDN for more information.

+4
source share

All Articles