PDA

Click to See Complete Forum and Search --> : Fonts & VB


Mimo
Aug 14th, 2001, 05:59 AM
If i have a font X and all i know about this X is the real filename.
for example "c:\temp\something.ttf"

The question is : how can i use this font X in my program without moving
the font filename to WINDIR\Fonts\ ????
(I want to use X in labels, textboxes, forms ..........)

Maybe we can make a temp shortcut to this X into the WINDIR\Fonts\ !?!?!?



Thanks anyway !!!

pjvdg
Aug 15th, 2001, 05:04 AM
doesn't it work if you put it in the rootdir of your application?

Mimo
Aug 15th, 2001, 05:26 AM
No it doesn't work !!!



Thanks anyway!!

Arcom
Aug 16th, 2001, 05:00 PM
This is very simple. Use the AddFontResource API to add a custom font to a system font table. When your app closes or when you don't need the font anymore use the RemoveFontResource to remove the font from the table.

BTW: When you restart your computer, all fonts added this way will be removed from the font table.