PDA

View Full Version : ChooseFont


lennard
11-26-2007, 10:54 AM
Huge pointed out that I should use ChooseFont instead of my current approach in Font Fiend. I actually used to do this but with that approach I couldn't get the path name to the font (which freetype requires) so I rolled my own by tracking down the font directory and filling a listbox.

Does anybody know how to translate the return CHOOSEFONT structure into an actual file name?

Huge
11-26-2007, 07:22 PM
Funny you should ask this today, because I just went through this last night, for a completely unrelated project!

You can use this:

http://www.codeproject.com/gdi/fontfile.asp

but that will mostly give you "xxx.ttf" - although sometimes a fullpath.
If it is not a full path, simply prefix with "GetWindowsDirectory()" + "/Fonts/".

Huge.

Huge
11-26-2007, 07:25 PM
Actually, that may not answer your question. I think you use the lpLogFont/facename members.