با عرض سلام و خسته نباشید.
در ویندوز xp یه روال نوشته بودم که باهاش فونتهای برنامه رو نصب میکردم.
اما در سون جواب نمیده.
چی کارش باید کرد.
ممنون.
procedure InstallFont(PathDirFontLocal: String);
var
F : TSearchRec;
FileName : TFileName;
i:Byte;
List:TStringList;
DirFontSystem :string;
DirWin: array [0..MAX_PATH] of Char;
begin
try
GetWindowsDirectory(DirWin, MAX_PATH);
DirFontSystem :=strpas(DirWin)+'\Fonts\';
PathDirFontLocal:=IncludeTrailingBackslash(PathDir FontLocal);
List:=TStringList.Create;
try
if DirectoryExists(PathDirFontLocal)then
begin
if (FindFirst(PathDirFontLocal + '*.*',faAnyFile - faDirectory,F) = 0)then
begin
try
repeat
FileName := F.Name;
List.Add(F.Name)
until FindNext(F) <> 0;
finally
FindClose(F);
end;
end;
for i:=0 to List.Count-1 do
begin
FileSetAttr(PathDirFontLocal +List[i], faArchive);
AddFontResource(pchar(PathDirFontLocal+List[i]));
//OR CopyFile(pchar(PathDirFontLocal+List[i]),pchar(DirFontSystem + List[i]),false);
SendMessage(HWND_BROADCAST,WM_FONTCHANGE, 0, 0 );
end;
end;
finally
List.Free;
end;
except
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
InstallFont(ExtractFilePath(Application.ExeName)+' Fonts');
end;