https://bugzilla.novell.com/show_bug.cgi?id=327039

           Summary: MeasureString behaves differently on win and linux
           Product: Mono: Class Libraries
           Version: 1.2
          Platform: PC
        OS/Version: Kubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [EMAIL PROTECTED]
          Found By: ---


Description of Problem:

Given a particular string and a font, measureString provides different results
on lin and win.  On linux, the returned width is smaller than it is actually
is.


Steps to reproduce the problem:
1. run the code below

 public class Form1 : Form
    {
        public Form1()
        {
         ;
        }

        // on windows: w1 : 70,08897 w2: 75
        // on linux: w1 :67 w2: 76 
        protected override void OnPaint(PaintEventArgs e)
        {
            string testString = "hello world";
            Font f = new Font("arial", 10);
            float w1 = e.Graphics.MeasureString(testString, f).Width;
            float w2 = TextRenderer.MeasureText(testString, f).Width;
            Console.WriteLine("w1 : " + w1.ToString() + " w2: " +
w2.ToString());
            base.OnPaint(e);
        }
    }


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to