Finding System Fonts with Delphi

后端 未结 3 1532
旧巷少年郎
旧巷少年郎 2021-02-09 17:07

What is the best way to find all the system fonts a user has available so they can be displayed in a dropdown selection box?

I would also like to distinguish between Un

3条回答
  •  执笔经年
    2021-02-09 17:40

    You can look in the forms.pas source to see how Codegear fill Screen.Fonts by enumerating the Windows fonts. The returned LOGFONT structure has a charset member, but this does not provide a simple 'Unicode' determination.

    As far as I know Windows cannot tell you explicitly if a font is 'Unicode'. Moreover if you try to display Unicode text in a 'non-Unicode' font Windows may substitute a different font, so it is difficult to say whether a font will or will not display Unicode. For example I have an ancient Arial Black font file which contains no Unicode glyphs, but if I use this to display Japanese text in a D2009 memo, the Japanese shows up correctly in Arial and the rest in Arial Black. In other examples, the usual empty squares may show up.

提交回复
热议问题