Font 'Arial' doesn't support style 'Regular'.

N

Nabani Silva

Hi, hope someone can help me

I'm getting this exception:

[ArgumentException: Font 'Arial' doesn't support style 'Regular'.]
System.Drawing.Font.Initialize(FontFamily family, Single emSize,
FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean
gdiVerticalFont) +584
System.Drawing.Font.Initialize(String familyName, Single emSize,
FontStyle style, GraphicsUnit unit) +58
System.Drawing.Font..ctor(String familyName, Single emSize) +35
ASP.pruebaFuente_aspx.OnLoad(EventArgs e) in
C:\Inetpub\wwwroot\webiberopuebla\pruebaFuente.aspx:8
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750


The aspx file contains nothing more than:

protected override void OnLoad(EventArgs e)
Line 7: {
Line 8: Response.Write(new System.Drawing.Font("Arial",10).ToString());
Line 9: base.OnLoad(e);
Line 10: }


I've tried the same "new System.Drawing.Font("Arial",10).ToString()" on a
console application and it works well... if I delete Arial font from windows
font folder the error raises also in the console application, but if I
reinstall it, it works again

This happens with bold style, and some other fonts, like Times, but other
ones like verdana works...
I've tried deleting and installing Arial font, installing service pack to
framework 1.1, setting file permissions, but still doesn't work...

Anyone's help?

Nabani
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top