Ar an cúigiú lá de mí na Nollaig, scríobh Vin Shelton:
> Running xemacs 21.4.15 on a gentoo system, (list-fonts
> 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
> and then
> x_list_fonts (Lisp_Object pattern, Lisp_Object device)
> Extbyte **names;
> 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);
> while (count--)
> result = Fcons (build_ext_string (names[count], Qx_font_name_encoding),
> if (names)
> XFreeFontNames (names);
> return result;
> 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?
I would suggest that we make certain the relevant X library doesn’t allocate
blindly a buffer with length its second last argument, or if it does, that
we’re okay with that.
I AM IN JAIL AND ALLOWED SEND ONLY ONE CABLE SINCE WAS ARRESTED WHILE
MEASURING FIFTEEN FOOT WALL OUTSIDE PALACE AND HAVE JUST FINISHED COUNTING
THIRTY EIGHT THOUSAND FIVE HUNDERED TWENTY TWO NAMES WHOS WHO IN MIDEAST.