DelphiFAQ Home Search:
General :: Programming :: Delphi
General Delphi related information.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.
Recommended links on this topic:
Featured Article

Installing a font from Delphi

Question:

How can I install a font from my Delphi application?

Answer:

Just copy a file into Windows\Fonts directory (see SHGetSpecialFolderLocation for CSIDL_FONTS)

As an alternative see the AddFontResource function:

// Adding the font ..
 
 AddFontResource(PChar('XXXFont.TTF'));
 SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
 
 // .. removing the font
 
 RemoveFontResource(PChar('XXXFont.TTF'));
 SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);

Generated 20:01:26 on Sep 20, 2018