我想知道为什么 TFontDialog 提供的字体比 Screen.Fonts 少? (例如,Arial* 字体、Comic 字体等不会在 TFontDialog 中显示)
TFontDialog 给出的字体列表似乎与 WordPad 相同,而 Screen.Fonts 给出的字体列表与 Word 基本相同。
非常感谢您的见解!
附:
德尔福XE,
Windows 7的
PS:相关SO主题:
- 使用 EnumFontFamiliesEx 函数枚举时字体过多
- 用Delphi查找系统字体
- 如何使用外部字体?
PS:相关网页:
- TFontDialog 显示所有字体@borland.newsgroups.archived
- TFontDialog 显示所有字体@delphigroups
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.
Screen.Fonts
返回所有已安装的字体,包括管理的隐藏字体注册表 \HKCU\Software\Microsoft\Windows NT\CurrentVersion\Font Management\Inactive Fonts. (Source) 显然,TFontDialog
不显示这些隐藏字体。
此外,一些字体中列出Screen.Fonts
中没有提到Font的组合框TFontDialog
,但被添加到字体样式组合框。拿Arial例如:Font style列出了10项,这似乎是字体的组合Arial, 宋体黑 and 窄宋体.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)