Font matching headaches

Andreas Mohr andi at
Sat Jun 25 10:00:25 CDT 2005


another visitor on LinuxTag was having huge issues with a heavy-duty app
doing batches of calculations, and every time after the end of those calculations
there was an X server spike going up to 80% CPU.

Turns out that spike was caused by the
       WARN("Huge font size %d pixels has been reduced to %d\n", h, MAX_FONT_SIZ
message in dlls/x11drv/xfont.c/LFD_ComposeLFD()

By binary-hacking to reduce it to 20 instead, I was able to totally
eliminate the CPU wait period, since it then didn't render 1000 pixel fonts any more.
Needless to say this is not exactly satisfying, since it's only yet another
bandaid for this problem (while it helps in this situation, it would be useful
to get this issues fully fixed in Wine).

X11 version is XFree86 4.3.0-dfsg-1 (i.e., Debian).

Is there anything that can be done to prevent this situation?
(I know that it's an inconvenient situation in a workaround handler for
even more inconvenient behaviour, but still...).

I can ask for further machine specific information if it turns out that it would
be useful...

Another thing that I found there is the following loop:

                LFD_ComposeLFD( pfo, fm.height, lpLFD, uRelaxLevel++ );
                if( (pfo->fs = safe_XLoadQueryFont( gdi_display, lpLFD )) ) brea
            } while( uRelaxLevel );

which *might* perhaps run amok since it continually grows without any effective
check (but the break; should hopefully be sufficient to stop this reliably).


Andreas Mohr

More information about the wine-devel mailing list