马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?站点注册
×
最简单的办法是 做一个动态库,下面给出delphi的实现 pb调用只需声明function string getfontfaces() library "pbgdiex.dll" 结果以tab分割,每项前面用T,R,D分别指明为实型字体,光栅字体,设备字体等 library pbgdiex; uses windows; {$R *.res} var gfuntmpstr:string; function EnumFontFamiliesCallBack(lpelf:pENUMLOGFONT; next:pNEWTEXTMETRIC; FontType:integer; lParam PARAM):integer;stdcall; var pstr:pchar; l:integer; typestr:string; begin if pos(lpelf.elfFullName,gfuntmpstr)>1 then exit; if fonttype=TRUETYPE_FONTTYPE then typestr:='T ' else if fonttype=RASTER_FONTTYPE then typestr:='R ' else if fonttype=DEVICE_FONTTYPE then typestr:='D ' else typestr:=''; gfuntmpstr:=gfuntmpstr+typestr+lpelf.elfFullName+#$9; end; function getfontfaces() PCTSTR;stdcall; var pfss:pchar; begin gfuntmpstr:=''; windows.EnumFontFamilies(GetDC(0),nil,@EnumFontFamiliesCallBack,0); result:=pchar(gfuntmpstr); end; exports getfontfaces; begin end. |