Link to home
Start Free TrialLog in
Avatar of pergull
pergull

asked on

Path to font file selected via FontDiolog in C#

Hello,

I am using the excellent font library called freetype to render fonts with OpenGL.  The freetype library requires access to the actual  font files (e.g. C:\WINDOWS\Fonts\ARIALBI.TTF - Arial Bold Italic).

I would like to use the standard FontDialog via .NET and C# to select the font I want freetype to render.  After I select my font with the standard FontDialog I can get the fontDialog.Font, but this gives me no information as to where the actual font file lives on the hard drive.  I need the full path to the font file representing my selection via the FontDialog so that I can pass the file name to the freetype library so that it can extract the font information to then be rendered with OpenGL.

Any idea how I can get the path to the actual font file that represents the selection made with the standard FontDialog?

Thanks you,

Per
Avatar of silemone
silemone
Flag of United States of America image

Well it may be easier to just include the font file in your project, maybe in your bin file so that incase the user doesn't have it available, then its there...plus it makes your program work on all machines...
ASKER CERTIFIED SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pergull
pergull

ASKER

Thank you very much.  I see that all the magic is through the registry.  I know exactly how to proceed.  Thanks again!