Re: [Fwd: Bug in font rendering in XFree86 4.0 - 4.0.1?] -- Debugging/UI Inspection tool?



Miles Lane <miles@speakeasy.org> writes:

> Hi,
> 
> I am attempting to track down an XFree86 4.0.x bug that
> causes the text in the GMC desktop icons to be misjustified.
> I'd like a method of determining which fonts are being displayed.
> Is there any client application for Gnome that will basically
> inspect a client window and tell me it's properties (something
> like Sun's xscope would be ideal, but I've failed to compile it
> with XFree86 4.0.1 installed under Linux for X86 (lots of 
> definition errors to do with PEX and so on).

Here's the patch to XLib to fix the problem. As you might
guess, the fact that the patch contains much more comments
than actual changes indicates that the om* code is in 
_bad_ repair. Basically, it looks like the code has been
modfied multiple times by people who didn't quite fully
understand it.

If I wasn't trying hard to replace Ouput Method / FontSet 
abstraction with Pango, I'd be concerned.

Regards,
                                        Owen

--- xc/lib/X11/omGeneric.c.ots	Wed Jul 12 12:02:04 2000
+++ xc/lib/X11/omGeneric.c	Wed Jul 12 12:09:15 2000
@@ -1031,6 +1031,15 @@
 
 	    found_num++;
 	    is_found = True;
+	    /* We almost certainly should have 'break' here and should ignore
+	     * the rest of the patterns. The problem is that we'll overwrite
+	     * font_data->font and font_data->xlfd_name with later matches.
+	     * But the general expectation would be that font_data->xlfd_name
+	     * would correspond to to the returned value. (It's not clear
+	     * why this routine modifies font_data and has a font_data_return...)
+	     *
+	     * Owen Taylor <otaylor@redhat.com>     12 Jul 2000
+	     */
 	}
 
 	switch(class) {
--- xc/lib/X11/omTextEsc.c.ots	Wed Jul 12 11:57:58 2000
+++ xc/lib/X11/omTextEsc.c	Wed Jul 12 12:07:41 2000
@@ -151,10 +151,27 @@
 					       is_xchar2b, FONTSCOPE);
 	if(ptr_len <= 0)
 	    break;
+
+	/* First, see if the "Best Match" font for the FontSet was set.
+	* If it was, use that font.  If it was not set, then use the
+	* font defined by font_set->font_data[0] (which is what
+	* _XomGetFontDataFromFontSet() always seems to return for
+	* non-VW text).  Note that given the new algorithm in 
+	* parse_fontname() and parse_fontdata(), fs->font will
+	* *always* contain good data.   We should probably remove
+	* the check for "fd->font", but we won't :-) -- jjw/pma (HP)
+	*
+	* Above comment and way this is done propagated from omText.c
+	* Note that fd->font is junk so using the result of the
+	* above call /needs/ to be ignored.
+	*
+	* Owen Taylor <otaylor@redhat.com>     12 Jul 2000
+	*
+	*/
 	if(fd == (FontData) NULL ||
-	   (font = fd->font) == (XFontStruct *) NULL) {
+	   (font = font_set->font) == (XFontStruct *) NULL) {
 
-	    if((font = font_set->font) == (XFontStruct *) NULL)
+	    if((font = fd->font) == (XFontStruct *) NULL)
 		break;
 	}
 
 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]