[Mono-devel-list] System.Drawing.RectangleF problem

Peter Dennis Bartok peter at novonyx.com
Sat Oct 2 20:10:07 EDT 2004

Sigh. This is most likely a mismatch between the cairo version and the 
libgdiplus code. An internal cairo structure was duplicated into libgdiplus 
and it afterwards changed in cairo. Everytime I've seen this crash it was 
because of that mismatch. I will take out some time and see if we can't get 
rid of that structure to avoid such problems in the future.

Try this patch for libgdiplus:
Index: gdip.h
RCS file: /cvs/public/libgdiplus/src/gdip.h,v
retrieving revision 1.92
diff -u -r1.92 gdip.h
--- gdip.h      26 Jul 2004 07:32:59 -0000      1.92
+++ gdip.h      13 Sep 2004 17:20:35 -0000
@@ -74,7 +74,7 @@
struct cairo_font {
     int refcount;
     cairo_matrix_t matrix;
-    //void *glyph_cache;
+    void *glyph_cache;
     const struct cairo_font_backend *backend;


-----Original Message-----
From: "Aaron Forrest" <aaron at ultramoderne.net>
To: <mono-devel-list at lists.ximian.com>
Date: 02 October, 2004 08:56
Subject: [Mono-devel-list] System.Drawing.RectangleF problem

>The attached file compiles but then gives the following error when i run 
>aaron at newark:~/programming/mono$ ./DrawString.exe
>Unhandled Exception: System.NullReferenceException: Object reference not
>set to an instance of an object
>in (unmanaged) (wrapper managed-to-native)
>in <0x00004> (wrapper managed-to-native)
>in <0x00090> System.Drawing.Graphics:DrawString
>in <0x00108> (wrapper remoting-invoke-with-check)
>in <0x00160> DrawText:.ctor (string)
>in <0x000ad> DrawText:Main ()
>Is this a bug in the System.Graphics.DrawString () method which uses a
>formatting rectangle or is it an error in my code?  So long as I don't
>use a RectangleF for formatting it works just fine.

More information about the Mono-devel-list mailing list