title: Custom Drawing Text C#
body: <p>I have a TextBox in my Form and I am drawing a string into it as below.</p>
  
  <pre><code>Font myFont = new Font("Arial",18F,FontStyle.Regular,GraphicsUnit.Point,128);
  Graphics g = myTextBox.CreateGraphics();
  Brush b = new SolidBrush(Color.Red);
  g.DrawString("Item Drawn with DrawString",myFont ,b,new PointF(1,1));
  </code></pre>
  
  <p>The string displayed in the TextBox. Then I tried below code</p>
  
  <pre><code> Font myFont = new Font("Arial",18F,FontStyle.Regular,GraphicsUnit.Point,128);
   Graphics g = myTextBox.CreateGraphics();
   TextRenderer.DrawText(g,"Item Drawn with DrawText",myFont,new Point(1,1),Color.Red);
  </code></pre>
  
  <p>Here the problem comes. Even though two methods <code>g.DrawString()</code> and <code>TextRenderer.DrawText()</code> uses same font, there is a difference in font style. That is some characters are rendered differently. If I use "1" instead of "128" in the font both methods will render characters as unique.</p>
  
  <p>If I change <code>GdiCharSet(128)</code> value in font, while using <code>g.DrawString()</code> method there will be no effect. My question is why  <code>g.DrawString()</code> method excludes <code>GdiCharSet</code> value?</p>