Author: Tomas Rutkauskas How to install a new font through code Answer: 1 uses 2 Registry; 3 4 procedure TForm1.Button1Click(Sender: TObject); 5 var 6 reg: TRegistry; 7 b: bool; 8 begin 9 CopyFile('C:\DOWNLOAD\FP000100.TTF', 'C:\WINDOWS\FONTS\FP000100.TTF', b); 10 reg := TRegistry.Create; 11 reg.RootKey := HKEY_LOCAL_MACHINE; 12 reg.LazyWrite := false; 13 reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Fonts', false); 14 reg.WriteString('TESTMICR (TrueType)', 'FP000100.TTF'); 15 reg.CloseKey; 16 reg.free; 17 {Add the font resource} 18 AddFontResource('c:\windows\fonts\FP000100.TTF'); 19 SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0); 20 {Remove the resource lock} 21 RemoveFontResource('c:\windows\fonts\FP000100.TTF'); 22 SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0); 23 end;