Delphi中使用私有字体

procedure TForm1.FormCreate(Sender: TObject);

begin

  AddFontResource(PChar(ExtractFilePath(ParamStr(0)) + 'oemFont.TTF'));

  SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);

end;

procedure TForm1.FormDestroy(Sender: TObject);

begin

  RemoveFontResource(PChar(ExtractFilePath(ParamStr(0)) + 'oemFont.TTF'));

  SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);

end;


你可能感兴趣的:(Delphi中使用私有字体)