changeset 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 fac66d9828d7
children 3afba65e22fa
files src/xterm.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Mon May 24 15:03:32 1993 +0000
+++ b/src/xterm.c	Mon May 24 15:04:07 1993 +0000
@@ -3877,6 +3877,7 @@
   font_names = (char **) XListFontsWithInfo (x_current_display, fontname,
 					     1024, &n_matching_fonts,
 					     &font_info);
+
   /* If the server couldn't find any fonts whose named matched fontname,
      return an error code.  */
   if (n_matching_fonts == 0)
@@ -3904,8 +3905,19 @@
   /* Otherwise, load the font and add it to the table.  */
   else
     {
+      int i;
       XFontStruct *font;
 
+      /* Try to find a character-cell font in the list.  */
+      for (i = 0; i < n_matching_fonts; i++)
+	if (! font_info[i].per_char)
+	  break;
+
+      if (i >= n_matching_fonts)
+	return 2;
+      else
+	fontname = font_names[i];
+
       font = (XFontStruct *) XLoadQueryFont (x_current_display, fontname);
       if (! font)
 	return 1;