Check if the font is installed (Win32)

How to check if a font is installed?

Ultimately, I want to implement font selection as HTML, i.e. when specifying, for example, "Verdana, Arial", he should select the first font that is installed.

This question provides an answer for .NET. It seems that it is recommended to create a font, and then assemble a regular font face.

Is this the most effective way?

+4
source share
2 answers

You can use EnumFontFamiliesEx to list the fonts in the system, or if you pass a font name, you can list the fonts for this family.

+5
source

You can try to create a font and see what you get (in this way, using OS match / replace font name).

Or you can list the installed fonts and do it yourself.

The โ€œmost effectiveโ€ way will depend on the details of the โ€œmatchโ€ and, in all likelihood, the number of fonts. On a system with, say, 50 fonts, you will probably find that performance differs significantly from a system with 1000 fonts installed.

Ultimately, you can only profile representative systems, if you fit first (keep it simple), it turns out to be a performance bottleneck.

+6
source

All Articles