I am wondering why TFontDialog gives less fonts than Screen.Fonts? (For example, the Arial* font, the Comic font, etc, does not show in TFontDialog)
It also seems th
Screen.Fonts
returns all installed fonts, including hidden fonts as administrated in Registry\HKCU\Software\Microsoft\Windows NT\CurrentVersion\Font Management\Inactive Fonts. (Source) Apparently, TFontDialog
does not display these hidden fonts.
Furthermore, some fonts listed in Screen.Fonts
are not mentioned in the Font combo box of TFontDialog
, but are added to the Font style combo box. Take Arial for example: the Font style lists 10 items, which seems to be the combination of the fonts Arial, Arial Black and Arial Narrow.
Different APIs, different results. Screen.Fonts
uses EnumFontFamiliesEx()
, which returns all installed fonts. TFontDialog
uses ChooseFont()
instead, which only displays the fonts that are compatible with the TFontDialog.Font
and TFontDialog.Options
properties.