locked
Write over with fontstyle & size RRS feed

  • Question

  • User-5529347 posted
    Hi! I have a script that will write some text lines into a Drawstring. It's really big and one part I have problem is the Drawstring. I can write all text lines as I want but when one line is getting a mutch bigger font size, it will write over the next line. I do have a measurestring that will measure every text line. It's seems that it every big line have a lot of space over and under and that this measurestring does'nt measure that, only the text. { Bitmap oBitmap = new Bitmap(1,1); int StringHeight; Graphics g; System.Drawing.SizeF oStringSize; g = Graphics.FromImage(oBitmap); g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; oStringSize = g.MeasureString(sText, oFont); StringHeight = Convert.ToInt32(oStringSize.Height) + iOld; return StringHeight; }
    Friday, December 3, 2004 5:49 AM

All replies

  • User-1372641848 posted
    Try StringHeight = oFont.Height ;
    Friday, December 3, 2004 2:28 PM