Render strings longer than 128 characters as individual chars

Huw D M Davies h.davies1 at physics.ox.ac.uk
Wed Oct 8 05:51:47 CDT 2003


On Tue, Oct 07, 2003 at 01:03:08PM -0400, Warren_Baird at cimmetry.com wrote:
> 
> 
> 
> (See attached file: patch_xrender_long_string.txt)


This is most likely due to a buggy version of libxrender which Keith
fixed with the attached patch to the XFree86 cvs.  I'd suggest
upgrading to a newer version of the library.  If we really have to have
a workaround in Wine then the string should at least be batched rather
than passed character by character.

Huw.
-- 
Huw Davies
huw at codeweavers.com
-------------- next part --------------
Index: lib/Xrender/Glyph.c
===================================================================
RCS file: /cvs/xc/lib/Xrender/Glyph.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- lib/Xrender/Glyph.c	31 Aug 2002 18:15:45 -0000	1.10
+++ lib/Xrender/Glyph.c	18 Oct 2002 01:13:39 -0000	1.11
@@ -1,5 +1,5 @@
 /*
- * $XFree86: xc/lib/Xrender/Glyph.c,v 1.10 2002/08/31 18:15:45 keithp Exp $
+ * $XFree86: xc/lib/Xrender/Glyph.c,v 1.11 2002/10/18 01:13:39 keithp Exp $
  *
  * Copyright ? 2000 SuSE, Inc.
  *
@@ -214,6 +214,7 @@
 	elt->deltay = yDst;
 	memcpy ((char *) (elt + 1), string, nchar);
     }
+#undef MAX_8
     
     UnlockDisplay(dpy);
     SyncHandle();
@@ -257,7 +258,7 @@
 
 #define MAX_16	254
 
-    len = SIZEOF(xGlyphElt) * ((nchar + MAX_8-1) / MAX_8) + nchar * 2;
+    len = SIZEOF(xGlyphElt) * ((nchar + MAX_16-1) / MAX_16) + nchar * 2;
     
     req->length += (len + 3)>>2;  /* convert to number of 32-bit words */
     
@@ -292,6 +293,7 @@
 	elt->deltay = yDst;
 	memcpy ((char *) (elt + 1), (char *) string, nchar * 2);
     }
+#undef MAX_16
     
     UnlockDisplay(dpy);
     SyncHandle();
@@ -336,7 +338,7 @@
 
 #define MAX_32	254
 
-    len = SIZEOF(xGlyphElt) * ((nchar + MAX_8-1) / MAX_8) + nchar * 4;
+    len = SIZEOF(xGlyphElt) * ((nchar + MAX_32-1) / MAX_32) + nchar * 4;
     
     req->length += (len + 3)>>2;  /* convert to number of 32-bit words */
     
@@ -371,6 +373,7 @@
 	elt->deltay = yDst;
 	memcpy ((char *) (elt + 1), (char *) string, nchar * 4);
     }
+#undef MAX_32
     
     UnlockDisplay(dpy);
     SyncHandle();
@@ -421,6 +424,8 @@
      */
     len = 0;
     
+#define MAX_8 252
+
     glyphset = elts[0].glyphset;
     for (i = 0; i < nelt; i++)
     {
@@ -481,6 +486,7 @@
 	    chars += this_chars;
 	}
     }
+#undef MAX_8
     
     UnlockDisplay(dpy);
     SyncHandle();
@@ -531,6 +537,8 @@
      */
     len = 0;
     
+#define MAX_16	254
+
     glyphset = elts[0].glyphset;
     for (i = 0; i < nelt; i++)
     {
@@ -589,6 +597,7 @@
 	    chars += this_chars;
 	}
     }
+#undef MAX_16
     
     UnlockDisplay(dpy);
     SyncHandle();
@@ -639,6 +648,8 @@
      * Compute the space necessary
      */
     len = 0;
+
+#define MAX_32	254
     
     glyphset = elts[0].glyphset;
     for (i = 0; i < nelt; i++)
@@ -692,6 +703,7 @@
 	    chars += this_chars;
 	}
     }
+#undef MAX_32
     
     UnlockDisplay(dpy);
     SyncHandle();


More information about the wine-devel mailing list