After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 124513 - A black box is displayed instead of text.
A black box is displayed instead of text.
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: [obsolete] font properties
2.4.x
Other opensolaris
: High major
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-10-13 20:23 UTC by paul.wilkins
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description paul.wilkins 2003-10-13 20:23:07 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",
Comment 1 Kjartan Maraas 2003-10-13 21:33:14 UTC
Adding keyword and pri.
Comment 2 Jody Goldberg 2003-10-28 20:46:18 UTC
applied.