unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,Printers;type
  TForm1 = class(TForm)
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure ComboBox1Change(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
  printer.Refresh;
  comboBox1.Clear;
  comboBox1.Items.Assign(Printer.Printers);
  comboBox1.ItemIndex:=printer.PrinterIndex;end;procedure TForm1.ComboBox1Change(Sender: TObject);
begin
  combobox2.Clear;
  printer.PrinterIndex:=combobox1.ItemIndex;
  combobox2.Items.Assign(printer.Fonts);
end;end.以上同样的代码,在不同windows环境下出现不同的情况:
如果系统中设有网络打印情况1: 如果该台打印机设为默认打印机,则运行以上代码,并在combobox1中选取取该网络打印机时,combobox2可以列出打印机支持字体。情况2: 如果把该台打印机设为非默认打印机,则运行以上代码,并在combobox1中选取该网络打印机时,弹出错误: 'printer selected is not valid'....
请问各位朋友遇到如此情况吗????
请如何处理????我想得到指定打印机支持的字体列表