为什么TFontDialog提供的字体少于Screen.Fonts?

SOU*_*ser 4 windows delphi fonts wordpad

我想知道为什么TFontDialog提供的字体少于Screen.Fonts?(例如,Arial*字体,漫画字体等在TFontDialog中不显示)

似乎TFontDialog给出的字体列表与写字板相同,而Screen.Fonts给出的字体列表与Word基本相同.

非常感谢您的见解!

PS:Delphi XE,Windows 7

PS:相关的SO主题:

  1. 使用EnumFontFamiliesEx函数枚举时字体太多
  2. 使用Delphi查找系统字体
  3. 如何使用外部字体?

PS:相关网页:

  1. TFontDialog显示所有字体@ borland.newsgroups.archived
  2. TFontDialog显示所有字体@ delphigroups

SYS 应用

unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm2 = class(TForm)
    lst1: TListBox;
    dlgFont1: TFontDialog;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.FormCreate(Sender: TObject);
begin
  lst1.Items.AddStrings(Screen.Fonts);
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
  dlgFont1.Device := fdBoth;
  if dlgFont1.Execute then
  begin

  end;
end;

end.    
Run Code Online (Sandbox Code Playgroud)

NGL*_*GLN 6

Screen.Fonts返回所有已安装的字体,包括在Registry\HKCU\Software\Microsoft\Windows NT\CurrentVersion\Font Management\Inactive Fonts中管理的隐藏字体.(来源)显然,TFontDialog不显示这些隐藏字体.

此外,字体组合框中Screen.Fonts未提及列出的某些字体,但会添加到字体样式组合框中.以Arial为例:字体样式列出了10个项目,这些项目似乎是字体Arial,Arial BlackArial Narrow的组合.TFontDialog