快捷搜索:  xxx  as  推理研究所  幼幼  侦探研究所

二星缩水app:再学GDI+43 文本输出获取已安装的字体列表



这比用 Screen.F二星缩水apponts; 获取麻烦一些.

本例效果图:

代码文二星缩水app件:unit Unit1;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls;

type

TForm1 = class(TForm)二星缩水app

Memo1: TMemo;

procedure FormCreate(Sender: TObjec二星缩水appt);

end;

var

Form1: TForm1;

implementation

{$R *.dfm}

uses GDIPOBJ, GDIPAPI;

proc二星缩水appedure TForm1.FormCreate(Sender: TObject);

var

fontFamilyArr: array of TGPFontFamily;

fonts: TGPFontCollection;

fontCount: Integer;

str: string;

i: Integer;

begin

fonts := TGPInstalledFontCollection.Create;

fontCount := fonts.GetFamilyCount;

SetLength(fontFamilyArr, fontCount);

for i := 0 to fontCount - 1 do fontFamilyArr[i] := TGPFontFamily.Create;

fonts.GetFamilies(fontCount, fontFamilyArr, fontCount);

Memo1.Clear;

for i := 0 to fontCount - 1 do

begin

fontFamilyArr[i].GetFamilyName(str);

Memo1.Lines.Add(str);

end;

for i := 0 to fontCount - 1 do fontFamilyArr[i].Free;

fonts.Free;

end;

end.

免责声明:以上内容源自网络,版权归原作者所有,如有侵犯您的原创版权请告知,我们将尽快删除相关内容。

您可能还会对下面的文章感兴趣: