In spite of its problems, I've used MeasureString pretty successfully,
provided I stick to the more common fonts. IF the result is "way off", make
sure you are using the same options with MeasureString that you ultimately
use to display the text.
 
Charlie


  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Maser, Dan
Sent: Thursday, September 20, 2007 2:03 PM
To: Jansen Bart; [email protected]
Subject: Re: [Mono-list] MeasureString


 
  It might be a real issue, but my app has the need to measure strings too
and I've found that MeasureString is often quite wrong.  The MSDN docs
indicate that it often is too, and recommends using
Graphics.MeasureCharacterRanges instead.   You might consider trying that
approach as a work-around.   I know that I've removed all references to
MeasureString in my app in favor of MeasureCharacterRanges which is far more
reliable for me.

  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jansen Bart
Sent: Thursday, September 20, 2007 3:28 PM
To: [email protected]
Subject: [Mono-list] MeasureString



Hi all,

 

I'm trying to ensure that a string fits in a rectangle shown on screen, so
whenever the string is too long, some characters are stripped.  I'm using
MeasureString to accomplish this.  With mono under windows this is working
fine, under linux the resulting string is always way too long.  Is this a
known issue? Is there a workaround?

 

Thanks a lot for your help,

 

B.

_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to