Fixed Width Font?

joe_pool_is

Contributor
Joined
Jan 18, 2004
Messages
507
Location
Longview, TX [USA]
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?
 
Last edited:
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:
Code:
try {
  Font courier = new Font(FontFamily.GenericMonospace, 10.0F);
  txtOutput.Font = courier;
} catch {
  // if it fails, the standard font will display
}
 
Back
Top