GNOME Bugzilla – Bug 124513
A black box is displayed instead of text.
Last modified: 2004-12-22 21:47:04 UTC
The gnome_font_properties program has a bug: The boxes that should display a text sample rendered a certain way display only black boxes. The problem is in the setup_font_sample function. It calculates the XftColor black, and XftColor white variables incorrectly. It sets these variables to constants which are incorrect on my sun workstation with a 24bit truecolor display. Instead of setting these variables to constants, they should be set from the result of the XftColorAllocValue function. Included is a patch to fix the problem. -Paul --- main.c.orig Sat Aug 2 12:02:47 2003 +++ main.c Mon Oct 13 15:52:41 2003 @@ -202,8 +202,9 @@ const char *string1 = "abcfgop AO "; const char *string2 = "abcfgop"; - XftColor black = { 0, { 0, 0, 0, 0xffff } }; - XftColor white = { 0, { 0xffff, 0xffff, 0xffff, 0xffff } }; + XftColor black; + XftColor white; + XRenderColor rendcolor; Display *xdisplay = gdk_x11_get_default_xdisplay (); @@ -223,6 +224,18 @@ int width, height; int ascent, descent; + + rendcolor.red = 0; + rendcolor.green = 0; + rendcolor.blue = 0; + rendcolor.alpha = 0xffff; + XftColorAllocValue(xdisplay, xvisual, xcolormap, &rendcolor, &black); + + rendcolor.red = 0xffff; + rendcolor.green = 0xffff; + rendcolor.blue = 0xffff; + rendcolor.alpha = 0xffff; + XftColorAllocValue(xdisplay, xvisual, xcolormap, &rendcolor, &white); pattern = FcPatternBuild (NULL, FC_FAMILY, FcTypeString, "Serif",
Adding keyword and pri.
applied.