tags:

views:

161

answers:

2

I get different result using Graphics.DrawString when rendering a chart for ASP.NET website. Text looks fine on development environment but bold and ugly on production. Chart sample on production is here. I can not post the link on chart sample from development environment, but I uploaded it on AmiProject website with name GanttChartOnDevelopment.png I have checked that required font in installed on production server. Code I am using:

FontFamily fontFamily = new FontFamily("Arial");
m_Font = new Font(fontFamily, 8, FontStyle.Regular);
m_Bitmap = new Bitmap(bitmapWidth, RowHeight * taskCount, PixelFormat.Format24bppRgb);
m_Bitmap.MakeTransparent(m_Bitmap.GetPixel(1, 1));
m_Graphics = Graphics.FromImage(m_Bitmap);
m_Graphics.SmoothingMode = SmoothingMode.AntiAlias;
m_Graphics.DrawString(Text, m_Font, new SolidBrush(Color.Black), new PointF(r.Right + 7, r.Top - 7));

I am using .net 3.5. Production server is Windows 2008, Development - Windows XP SP3. Please help to understand the reason of that difference and fix that.

A: 

Not too sure if this will make a difference drawing to a bitmap but have you checked that ClearType is enabled on the server?

rein