aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1993-05-24 15:04:07 +0000
committerJim Blandy1993-05-24 15:04:07 +0000
commit9696f58be781597a4ac17ff6051fdba4da0200f6 (patch)
tree3a641e81362a45383fcc827be79c3930182b74f0 /src
parentc7e1d890aed499f70f07a421309da05fc8338858 (diff)
downloademacs-9696f58be781597a4ac17ff6051fdba4da0200f6.tar.gz
emacs-9696f58be781597a4ac17ff6051fdba4da0200f6.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 8ea6bdd3fbe..9d85e1c9d28 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3877,6 +3877,7 @@ x_new_font (f, fontname)
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)
@@ -3904,8 +3905,19 @@ x_new_font (f, fontname)
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;
3908 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];
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;