PDA

Click to See Complete Forum and Search --> : Only TrueType Fonts


ambient
Aug 28th, 2002, 07:32 AM
hi @ all!

I use a FontDialog to select fonts...but when I select a font (that is not true-type) then my program brakes with this error message:

An unhandled exception of type 'System.ArgumentException' occurred in system.drawing.dll

Additional information: Only TrueType fonts are supported, and this is not a TrueType font.

please help me!

Edneeis
Aug 28th, 2002, 10:31 AM
I think you are going to either find a True Type version of the font or use a different font.

ambient
Aug 28th, 2002, 10:39 AM
yes, but I need it for program configurations.

the user who uses my program can select a font, but what if he select a font who isn't TrueType!?

and my question is: how can I display only the "TrueType"-fonts in the FontDialog

...or is there any other way to fix this error?

Edneeis
Aug 28th, 2002, 11:59 AM
Sorry I think I misunderstood the question. I guess you must be selecting an OpenType Font which are also allowed in .NEt (but I guess not for your drawing operation). The easiest is to just catch the error and have them pick another font or cancel. Just use a Try..Catch where you use the font.