Using the clear type font in C # / VB.NET

How to use ClearType font in C # / VB.NET ?

+5
source share
2 answers
protected override void OnPaint(PaintEventArgs e)
{
    e.Graphics.DrawString("Normal style", this.Font, Brushes.Black, 50, 50);

    e.Graphics.TextRenderingHint =
         System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;

    e.Graphics.DrawString("ClearType style", this.Font, Brushes.Black, 50, 100);
}
+5
source

In addition, to set the anti-aliasing method to “standard”, use:

e.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit
0
source

All Articles