title: How to convert Text into Image with Custom font in c#
body: <p>I am trying to save the text as Image with font Cookie but When i convert that text with font i does not effect there as need. Please have a look into code and suggest the possible solution. 
  Thanks in Advance</p>
  
  <pre><code>string text = "Signature sting to convert";
  Bitmap bitmap = new Bitmap(1, 1);
  FontFamily myFontFamily = new FontFamily("cookie");
  Font font = new Font(myFontFamily, 25, FontStyle.Regular, GraphicsUnit.Pixel);
  Graphics graphics = Graphics.FromImage(bitmap);
  int width = (int)graphics.MeasureString(text, font).Width;
  int height = (int)graphics.MeasureString(text, font).Height;
  bitmap = new Bitmap(bitmap, new Size(width, height));
  graphics = Graphics.FromImage(bitmap);
  graphics.Clear(Color.White);
  graphics.SmoothingMode = SmoothingMode.AntiAlias;
  graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
  graphics.DrawString(text, font, new SolidBrush(Color.FromArgb(255, 0, 0)), 0, 0);
  graphics.Flush();
  graphics.Dispose();
  string fileName = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()) + ".jpg";
  bitmap.Save(Server.MapPath("~/images/") + fileName, ImageFormat.Jpeg);
  imgText.ImageUrl = "~/images/" + fileName;
  imgText.Visible = true;
  </code></pre>
  
  <p>The exception I am getting from below line</p>
  
  <pre><code>FontFamily myFontFamily = new FontFamily("cookie");
  </code></pre>
  
  <blockquote>
    <p>Font 'cookie' cannot be found.</p>
  </blockquote>
  
  <p>Please suggest how to use that font in this case.</p>