[Mono-bugs] [Bug 80680][Min] New - Graphics.MeasureString results differ for string containing only blanks

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Jan 30 18:13:35 EST 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by gert.driesen at pandora.be.

http://bugzilla.ximian.com/show_bug.cgi?id=80680

--- shadow/80680	2007-01-30 18:13:35.000000000 -0500
+++ shadow/80680.tmp.21141	2007-01-30 18:13:35.000000000 -0500
@@ -0,0 +1,50 @@
+Bug#: 80680
+Product: Mono: Class Libraries
+Version: 1.2
+OS: GNU/Linux [Other]
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: Sys.Drawing.
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Graphics.MeasureString results differ for string containing only blanks
+
+When Graphics.MeasureString is used to measure the width of a string 
+containing only blanks, the results differ a lot between the Mono and MS 
+implementation.
+
+To reproduce, compile and run the following code snippet:
+
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+
+public class Test {
+  static void Main () {
+    Form form = new Form ();
+    Graphics g = form.CreateGraphics ();
+    Font font = new Font (FontFamily.GenericSansSerif, 10);
+    SizeF size = g.MeasureString ("                              ", font);
+    Console.WriteLine (size.Height);
+    Console.WriteLine (size.Width);
+  }
+}
+
+Expected result:
+
+16,75781
+4,444379
+
+(more or less)
+
+Actual result:
+
+17
+120


More information about the mono-bugs mailing list