disable text antialiasing

This commit is contained in:
Chris Forbes
2010-02-16 18:31:45 +13:00
parent 82693a53c8
commit 95ae493dc4

View File

@@ -4,6 +4,7 @@ using OpenRa.GlRenderer;
using OpenRa.FileFormats; using OpenRa.FileFormats;
using OpenRa.Support; using OpenRa.Support;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Drawing.Text;
namespace OpenRa.Graphics namespace OpenRa.Graphics
{ {
@@ -50,10 +51,12 @@ namespace OpenRa.Graphics
Bitmap RenderTextToBitmap(string s, Font f, Color c) Bitmap RenderTextToBitmap(string s, Font f, Color c)
{ {
Bitmap b = new Bitmap(256, 256); Bitmap b = new Bitmap(256, 256);
System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(b); using (var g = System.Drawing.Graphics.FromImage(b))
g.DrawString(s, f, new SolidBrush(c), 0, 0); {
g.Flush(); g.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;
g.Dispose(); g.DrawString(s, f, new SolidBrush(c), 0, 0);
g.Flush();
}
return b; return b;
} }