【发布时间】:2012-07-03 06:10:21
【问题描述】:
我想知道为什么 TFontDialog 提供的字体比 Screen.Fonts 少? (例如Arial*字体、Comic字体等在TFontDialog中不显示)
TFontDialog给出的字体列表好像和WordPad一样,而Screen.Fonts给出的字体列表和Word基本一样。
非常感谢您的见解!
PS: 德尔福 XE, 视窗 7
PS:相关的 SO 主题:
- Too many fonts when enumerating with EnumFontFamiliesEx function
- Finding System Fonts with Delphi
- How to use external fonts?
PS:相关网页:
- TFontDialog to show all Fonts @ borland.newsgroups.archived
- TFontDialog to show all Fonts @ 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.
【问题讨论】:
-
使用 dlgFont1.Device 的不同值可能会得到不同的结果。尝试 fdScreen 和 fdPrinter,然后再次比较列表。
-
@Doug
Device属性在现代 Windows 上被忽略(我认为) -
@Doug 对 dlgFont1.Device 使用不同的值没有区别。
标签: windows delphi fonts wordpad