Click here to Skip to main content
15,901,666 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I made a generic FontDialog and it auto lists fonts. The problem is if someone picks a non-truetype font, it displays it in the preview and everything, but when they hit ok/apply it comes back with an exception "Only TrueType fonts are supported. This is not a TrueType font."
How do I get the dialog so that non-true type fonts aren't listed in the Font Dialog?
Posted
Comments
wb12162003 2-Mar-11 1:52am    
good!

Set the AllowScriptChange property to false.
 
Share this answer
 
Comments
aei_totten 27-Aug-10 13:11pm    
No Change :(
Instead of 1-voting the only (almost year-old) answer that was submitted, you could try using google yourself. I did (to come up with the first answer), and I did again to come up with this one:

Include the CF_TTONLY flag when you call ChooseFont(). This may involve using PInvoke to use the windows api, but I assume you're a programmer, so this shouldn't be a big deal.
 
Share this answer
 
v2
Comments
aei_totten 10-Jun-11 12:53pm    
I didn't rate that answer a one star, and if I did, it was an accident. This was a question I posted a long time ago and figured out the answer on my own and forgot to post an update.
As far as your google comment, that article that you are listing was posted 2 months after the question, Thanks.
#realJSOP 8-Nov-11 7:15am    
Then post the solution you found so everyone can benefit.
Emre Can Serteli 10-Feb-12 11:10am    
Can either of you help me please? I really need this. Can you explain what "Include the CF_TTONLY flag when you call ChooseFont()" means? Should I extend the FontDialog class in some way? Or is there another way?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900