comparison src/xterm.c @ 3016:ce9ea90b5848

* xterm.c (x_new_font): Reject fonts with varying spacing. We don't support them yet. * xfns.c (x_set_font): Report the error message properly.
author Jim Blandy <jimb@redhat.com>
date Mon, 24 May 1993 15:04:07 +0000
parents 44ed08628516
children 2c5ea1c98256
comparison
equal deleted inserted replaced
3015:fac66d9828d7 3016:ce9ea90b5848
3875 have a list of matching fonts, we compare them against the fonts 3875 have a list of matching fonts, we compare them against the fonts
3876 we already have by comparing font ids. */ 3876 we already have by comparing font ids. */
3877 font_names = (char **) XListFontsWithInfo (x_current_display, fontname, 3877 font_names = (char **) XListFontsWithInfo (x_current_display, fontname,
3878 1024, &n_matching_fonts, 3878 1024, &n_matching_fonts,
3879 &font_info); 3879 &font_info);
3880
3880 /* If the server couldn't find any fonts whose named matched fontname, 3881 /* If the server couldn't find any fonts whose named matched fontname,
3881 return an error code. */ 3882 return an error code. */
3882 if (n_matching_fonts == 0) 3883 if (n_matching_fonts == 0)
3883 return 1; 3884 return 1;
3884 3885
3902 f->display.x->font = x_font_table[already_loaded]; 3903 f->display.x->font = x_font_table[already_loaded];
3903 3904
3904 /* Otherwise, load the font and add it to the table. */ 3905 /* Otherwise, load the font and add it to the table. */
3905 else 3906 else
3906 { 3907 {
3908 int i;
3907 XFontStruct *font; 3909 XFontStruct *font;
3910
3911 /* Try to find a character-cell font in the list. */
3912 for (i = 0; i < n_matching_fonts; i++)
3913 if (! font_info[i].per_char)
3914 break;
3915
3916 if (i >= n_matching_fonts)
3917 return 2;
3918 else
3919 fontname = font_names[i];
3908 3920
3909 font = (XFontStruct *) XLoadQueryFont (x_current_display, fontname); 3921 font = (XFontStruct *) XLoadQueryFont (x_current_display, fontname);
3910 if (! font) 3922 if (! font)
3911 return 1; 3923 return 1;
3912 3924