DelphiFAQ Home Search:

Installing a font from Delphi

 

comments2 comments. Current rating: 5 stars (1 votes). Leave comments and/ or rate it.

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);

Comments:

2006-05-30, 18:26:31
anonymous from Norway  
rating
Greate tip!
2006-11-18, 20:11:20
HUNTER from China  
UP!

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: