comparison src/objects-x.c @ 3169:5bfedec8927e

[xemacs-hg @ 2005-12-24 17:33:31 by aidan] Move the XListFonts maxnames param to INT_MAX from 5000
author aidan
date Sat, 24 Dec 2005 17:33:34 +0000
parents 8f3f6e3dfad9
children 588878f5a654
comparison
equal deleted inserted replaced
3168:423e5387091f 3169:5bfedec8927e
691 if (encoding) XFree (encoding); 691 if (encoding) XFree (encoding);
692 692
693 return result; 693 return result;
694 } 694 }
695 695
696 /* Unbounded, for sufficiently small values of infinity... */ 696 /* XListFonts doesn't allocate memory unconditionally based on this. (For
697 #define MAX_FONT_COUNT 5000 697 XFree86 in 2005, at least. */
698 #define MAX_FONT_COUNT INT_MAX
698 699
699 static Extbyte * 700 static Extbyte *
700 truename_via_XListFonts (Display *dpy, Extbyte *font_name) 701 truename_via_XListFonts (Display *dpy, Extbyte *font_name)
701 { 702 {
702 Extbyte *result = 0; 703 Extbyte *result = 0;
805 { 806 {
806 /* The font is already open, we just unparse. */ 807 /* The font is already open, we just unparse. */
807 FcChar8 *res = FcNameUnparse (FONT_INSTANCE_X_XFTFONT (f)->pattern); 808 FcChar8 *res = FcNameUnparse (FONT_INSTANCE_X_XFTFONT (f)->pattern);
808 if (res) 809 if (res)
809 { 810 {
810 FONT_INSTANCE_TRUENAME (f) = 811 FONT_INSTANCE_TRUENAME (f) = make_string (res, strlen (res));
811 build_ext_string (res, Qxft_font_name_encoding);
812 free (res); 812 free (res);
813 return FONT_INSTANCE_TRUENAME (f); 813 return FONT_INSTANCE_TRUENAME (f);
814 } 814 }
815 else 815 else
816 { 816 {
1174 int stage) 1174 int stage)
1175 { 1175 {
1176 Extbyte **names; 1176 Extbyte **names;
1177 int count = 0; 1177 int count = 0;
1178 const Extbyte *patternext; 1178 const Extbyte *patternext;
1179 Lisp_Object result = Qnil; 1179 Lisp_Object result = Qunbound;
1180 int i; 1180 int i;
1181 1181
1182 /* #### with Xft need to handle second stage here -- sjt 1182 /* #### with Xft need to handle second stage here -- sjt
1183 Hm. Or maybe not. That would be cool. :-) */ 1183 Hm. Or maybe not. That would be cool. :-) */
1184 if (stage) 1184 if (stage)
1440 ALLOCA, (intname, intlen), 1440 ALLOCA, (intname, intlen),
1441 Qx_font_name_encoding); 1441 Qx_font_name_encoding);
1442 if (x_font_spec_matches_charset (XDEVICE (device), charset, 1442 if (x_font_spec_matches_charset (XDEVICE (device), charset,
1443 intname, Qnil, 0, -1, 0)) 1443 intname, Qnil, 0, -1, 0))
1444 { 1444 {
1445 result = build_ext_string (intname, Qx_font_name_encoding); 1445 result = make_string (intname, intlen);
1446 break; 1446 break;
1447 } 1447 }
1448 } 1448 }
1449 1449
1450 if (names) 1450 if (names)