Why TFontDialog gives less fonts than Screen.Fonts?

前端 未结 2 859
终归单人心
终归单人心 2021-01-06 10:58

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

相关标签:
2条回答
  • 2021-01-06 11:10

    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.

    0 讨论(0)
  • 2021-01-06 11:32

    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.

    0 讨论(0)
提交回复
热议问题