Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (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 by joe_pool_is
Posted

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
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...