![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Шрифты [Delphi, Windows]
a_legayda@mtu-net.ru © (2004-05-09 19:40:00)Как получить список всех установленных в системе шрифтов?
Gandalf (2004-05-12 13:22:00) [1]
function EnumFontsProc(var LogFont: TLogFont; var TextMetric: TTextMetric;
FontType: Integer; Data: Pointer): Integer; stdcall;
var
S: PStrList;
Temp: string;
begin
S := PStrList(Data);
Temp := LogFont.lfFaceName;
if (S.Count = 0) or (AnsiCompareText(S.Items[S.Count-1], Temp) <> 0) then
S.Add(Temp);
Result := 1;
end;
DC: HDC;
LFont: TLogFont;
FFonts:PStrList;
i:Integer;
begin
if FFonts = nil then
begin
FFonts := NewStrList;
DC := GetDC(0);
try
FFonts.Add('Default');
FillChar(LFont, sizeof(LFont), 0);
LFont.lfCharset := DEFAULT_CHARSET;
EnumFontFamiliesEx(DC, LFont, @EnumFontsProc, LongInt(FFonts), 0);
PStrList(FFonts).Sort(False);// := TRUE;
finally
ReleaseDC(0, DC);
end;
end;
for i:=0 to FFonts.Count-1 do
LisBox1.Add(FFonts.Items[i]);
MBo (2004-05-10 07:44:00) [2]зато есть EnumFonts. См. также Screen.Fonts
Yustas (2004-05-10 06:51:00) [3]"enumfontresources" - нет такой функции!
Dimaxx (2004-05-09 21:24:00) [4]enumfontresources