Click to See Complete Forum and Search --> : How to set any font directories to CFontDialog


Harroch denis
June 3rd, 1999, 06:32 AM
I want to create a specific Font dialog box which can select the font from any directory ( not windows\font ).

thank's

Jason Teagle
June 3rd, 1999, 06:54 AM
Why would the fonts be anywhere other than WINDOWS/FONTS?

Harroch denis
June 3rd, 1999, 07:01 AM
Because my application Have to select few fonts which are installed in a specific directory

Jason Teagle
June 4th, 1999, 01:58 AM
I did a little experimenting with CFontDialog, and I'm afraid the answer is grim. Because CFontDialog uses the underlying API to show the font dialog, everything is buried deep in the API. There is no handy way to redirect it. It most likely uses the EnumFontFamilies() API call which does all the hard work. You might be able to install your own hook, but it doesn't seem worth it as you are still going to have to get details of the fonts in your own directory by hand - if that is even possible. You might just as well create your own dialogue box for the purpose. Sorry that wasn't what you wanted to hear.

You might be able to cheat by copying the fonts from the user directory into the WINDOWS/FONTS directory so that they APPEAR to be part fo the font list - you can always make a note of which files you copied over and remove them again later.

Harroch denis
June 4th, 1999, 02:55 AM
Thank you for your response.
D.Harroch