Mark Purtill <purtill(a)alum.mit.edu> writes:
Dear Bug Team!
Running xemacs 21.4.15 on a gentoo system, (list-fonts "*") only
returns 5000 fonts, although on my system XListFonts returns 12836
fonts. The result is that when I am using a font that doesn't happen
to be in the first 5000 according to whatever bizarre order X uses, if
I go to the Options menu and click on Font, I get a greyed out "Cannot
parse current font" (which is wrong: the font was parsed fine, it just
wasn't found in the cache).
This is because in src/objects-x.c, we find:
/* Unbounded, for sufficiently small values of infinity... */
#define MAX_FONT_COUNT 5000
x_list_fonts (Lisp_Object pattern, Lisp_Object device)
int count = 0;
Lisp_Object result = Qnil;
const Extbyte *patternext;
LISP_STRING_TO_EXTERNAL (pattern, patternext, Qx_font_name_encoding);
names = XListFonts (DEVICE_X_DISPLAY (XDEVICE (device)),
patternext, MAX_FONT_COUNT, &count);
result = Fcons (build_ext_string (names[count], Qx_font_name_encoding),
Could 5000 be replaced with a number that is unbounded for a somewhat
larger value of infinity? (I replaced it with 32768 and recompiled,
and the problem went away). Also, it would be nice if when this limit
is exceeded a more useful error message was given (since it took me a
couple of hours to track this down).
Do any of our font experts have an opinion on this? What would be the
downside of my bumping this 5000 up to 32,768?