I,m using a font dialog to select a font and create a font from the selected font using
font = new Font(fontDialog1.Font.Name, fontDialog1.Font.Size, FontStyle.Regular, GraphicsUnit.Pixel);
When i Select a Non True type font I’m getting an ‘This is not a TrueType font’ Exception,I know GDI+ has support only for TTF.I’ve worked around this by using a try catch block.But how can i configure the font dialog to show only TTF’s.
I don’t think there is a solution to this issue (as stated by numerous others articles on the web), but you can rewrite the FontDialog somehow to fit your need.
To get you started, here is the implementation of a FontListBox that displays an owner draw listbox with fonts rendered in it:
Sample dialog that hosts it:
The list box: