home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 May
/
Chip_2002-05_cd1.bin
/
sharewar
/
fontlist
/
UNIT1.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1998-08-24
|
3KB
|
82 lines
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls, ExtCtrls, Spin, Grids, SortGrid, Printers;
type
TFontForm = class(TForm)
Panel1: TPanel;
RichEdit1: TRichEdit;
Button1: TButton;
ProgressBar1: TProgressBar;
Label2: TLabel;
SaveDialog1: TSaveDialog;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Label3: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
StopAction:boolean;
OutFile:string;
public
{ Public declarations }
end;
var
FontForm: TFontForm;
implementation
{$R *.DFM}
procedure TFontForm.Button1Click(Sender: TObject);
var a,b,c:integer;
s,r,t:string;
L:TStringList;
tf:TextFile;
begin
if Button1.Caption='Stop' then begin
StopAction:=true;
Exit;
end else StopAction:=false;
Button1.Caption:='Stop';
ProgressBar1.Max:=Screen.Fonts.Count-1;
L:=TStringList.Create;
r:='{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fnil MS Sans Serif;}{\f1\fnil\fcharset2{\*\fname Symbol;}MT Symbol;}{\f2\fswiss\fprq2 System;}{\f3\fnil\fcharset1 MS Sans Serif;}{\f4\fnil\fcharset238{\*\fname MS Sans Serif;}MS Shell Dlg;}';
t:='{\colortbl\red0\green0\blue0;}'+#13+#10+'\deflang1033\pard\tx3000\tx4400\tx5400\tx6800\'+#13+#10;
if RadioButton1.Checked then L.Assign(Printer.Fonts)
else L.Assign(Screen.Fonts);
L.Sort;
for a:=0 to L.Count-1 do begin
r:=r+'{\f'+IntToStr(a+5)+'\fnil\fcharset1 '+L[a]+';}';
t:=t+'\par \plain\f4\fs24 '+L[a]+'\plain\f'+IntToStr(a+5)+'\fs24 \tab Norm\''e1ln\''ed\tab \plain\f'+IntToStr(a+5)+'\fs24\b Tu\''e8n\''e9\plain\f\fs24 \tab \plain\f'+IntToStr(a+5)+'\fs24\i Kurs\''edva\plain\f'+IntToStr(a+5)+'\fs24 \tab \plain\f'+IntToStr(a+5)+'\fs24\b\i Tu\''e8n\''e1 kurs\''edva\plain\f'+IntToStr(a+5)+'\fs24'+#13+#10;
ProgressBar1.Position:=a;
Label2.Caption:=IntToStr(a+1)+' / '+IntToStr(Screen.Fonts.Count);
Application.ProcessMessages;
if StopAction then Break;
end;
r:=r+'}'+#13+#10;
t:=t+'\par }';
AssignFile(tf,OutFile);
Rewrite(tf);
Write(tf,r,t);
CloseFile(tf);
L.Free;
ProgressBar1.Position:=0;
Label2.Caption:='NaΦteno '+IntToStr(a)+' font∙';
Button1.Caption:='Start';
end;
procedure TFontForm.FormShow(Sender: TObject);
begin
if SaveDialog1.Execute then OutFile:=SaveDialog1.FileName
else Application.Terminate;
end;
end.