vcl里是怎么封装EnumFontFamilies,EnumFontFamiliesEx,最好能给个例子。
反正不管怎样,如何才能在delphi中得到系统字体信息?????????????
反正不管怎样,如何才能在delphi中得到系统字体信息?????????????
解决方案 »
- 挤进CSDN前1000,散分
- 求处理Null值?
- delphi和vfp相比,有什幺优点?
- 简单问题:如何让程序一运行后就处于ShowModal状态?(60分来拣!)
- 哪里有画流程图的控件下载??
- 想找个朋友讨论一下Delphi中如何把MDI子窗体放在Dll中的问题???
- 请问定时程序怎么设计?还有,哪有讲hook的范例吗?谢谢
- 前面一个“多线程+MSSQL”的问题很久都没人回答,现在再加120分!有本事,你来拿!
- N难的题:Delphi怎么编写一个需要Smtp认证的发邮件程序?
- 在vs+opencv中,对于读入的一张图像,如何得到图像的基本参数?
- 请问此语可否简化:j:=strtoint(floattostr(int(random(num))))??
- Delphi菜鸟问题:关于ado的
FontType: Integer; Data:Pointer): Integer; {$IFDEF WIN32} stdcall; {$ELSE} export; {$ENDIF}function EnumFontFamiliesProc(var LogFont: TLogFont; var TextMetric: TTextMetric;
FontType: Integer; Data:Pointer): Integer; {$IFDEF WIN32} stdcall; {$ELSE} export; {$ENDIF} procedure AddToList(const aValue:String);
var
i, IntValue:Integer;
begin
i:=0;
IntValue := StrToInt(AValue);
with TStrings(Data) do
begin
while (i < Count) do
if IntValue >= StrToInt(Strings[i]) then Inc(i)
else Break;
Insert(i, aValue);
end;
end;var
i: Integer;
c: String;
const
csizes:array[0..MaxStdSizes-1] of Integer=(8,9,10,11,12,14,16,18,20,
22,24,26,28,36,48,72);
begin
result:=0;
with TStrings(Data) do
begin
if ((FontType and TRUETYPE_FONTTYPE) = TRUETYPE_FONTTYPE) or (FontType in [0,2]) then
begin
For i := 0 to (MaxStdSizes - 1) do Add(IntToStr(Csizes[i]));
result := 0
end; if ((FontType and RASTER_FONTTYPE) = RASTER_FONTTYPE) then
with TextMetric do
begin
C := IntToStr(MulDiv((tmHeight-tmInternalLeading), 72 , VRES));
if IndexOf(c) = -1 then AddToList(c);
result := 1;
end;
end
end;
var
buffer:array[0..255] of Char;
DC:HDC;
begin
with lbxFontSize do
begin
Items.Clear;
DC:=GetDC(0);
Items.BeginUpdate;
try
StrPCopy(Buffer, FFontName);
vres := GetDeviceCaps(DC, LOGPIXELSY);
EnumFontFamilies(DC, Buffer, @EnumFontFamiliesProc, LongInt(Items));
finally
ReleaseDC(0, DC);
Items.EndUpdate;
end;
end;
还有vres=?