joe_pool_is Posted June 2, 2009 Posted June 2, 2009 (edited) My application has been using Courier New for a long time, but lately it seems like this font keeps throwing errors whenever someone tries to load the font. I get something like, "System.Font.Courier New does not support style Regular". After digging, I find that this is on a form that is set up to show tabular data using a fixed width font. Courier New has worked on these systems in the past, but I don't know. Maybe a Microsoft Update modified them or something. Anyway, Courier New often causes my applications to crash. Is there another generic, fixed width font that I can use besides this? The only thing I want is for my font to be fixed width and set to size 10, 12, or 14. Thanks in advance, Joe --- Append: I'm googling this text: "Font 'Courier New' does not support style 'Regular'" There are a *lot* of reports about this as of late. Has Microsoft released a patch that corrupted this file? Edited June 2, 2009 by joe_pool_is Quote Avoid Sears Home Improvement
JumpyNET Posted June 3, 2009 Posted June 3, 2009 How about the font used in Windows Notepad "Lucida Console"? You could also google for "monospaced fonts". Here's a link to one of many monospaced fonts lists (some fonts are free): http://hivelogic.com/articles/view/top-10-programming-fonts Quote
joe_pool_is Posted June 3, 2009 Author Posted June 3, 2009 Thanks Jumpy. The only reason I didn't take your suggestion is because MS could mess up the Lucida font the next time. Anyway, here's the approach I took: I set the font in my designer to be the default Microsoft San Seriff, then used this code in the Form's Load Event Handler: try { Font courier = new Font(FontFamily.GenericMonospace, 10.0F); txtOutput.Font = courier; } catch { // if it fails, the standard font will display } Quote Avoid Sears Home Improvement
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.