[Mono-bugs] [Bug 81572][Nor] New - MeasureString problems with multline strings

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue May 8 21:06:38 EDT 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 everaldo at simios.org.

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

--- shadow/81572	2007-05-08 21:06:37.000000000 -0400
+++ shadow/81572.tmp.15985	2007-05-08 21:06:38.000000000 -0400
@@ -0,0 +1,53 @@
+Bug#: 81572
+Product: Mono: Class Libraries
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: libgdiplus
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: everaldo at simios.org               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: MeasureString problems with multline strings
+
+On below code, sizef1 and sizef2 must have same (approximated) width, in
+.NET and Mono on Win32 it works fine so I think that it is a libgdiplus
+problem.
+
+using System;
+using System.Drawing;
+
+class MeasureTest
+{
+	static void Main ()
+	{
+		Graphics dc = Graphics.FromImage (new Bitmap(100, 200));
+		Font font = new Font ("Arial", 12);
+
+		StringFormat string_format = new StringFormat();
+		
+		string text1 = "Test\nTest123\nTest 456\nTest 1,2,3,4,5...";
+		string text2 = "Test 1,2,3,4,5...";
+
+		SizeF sizef1 = dc.MeasureString(text1, font, SizeF.Empty, string_format);
+		SizeF sizef2 = dc.MeasureString(text2, font, SizeF.Empty, string_format);
+			
+		Console.WriteLine ("size-1: {0}", sizef1);
+		Console.WriteLine ("size-2: {0}", sizef2);
+	}
+}
+
+
+results under X11:
+size-1: {Width=91, Height=55}
+size-2: {Width=100, Height=16}
+
+results under X11:
+size-1: {Width=119,8281, Height=75,59375}
+size-2: {Width=119,8333, Height=19,875}


More information about the mono-bugs mailing list