diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 63 |
1 files changed, 37 insertions, 26 deletions
diff --git a/src/xfns.c b/src/xfns.c index b8cdf14dfde..014b82fc1ca 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1988,8 +1988,8 @@ x_set_font (f, arg, oldval) | |||
| 1988 | 1988 | ||
| 1989 | BLOCK_INPUT; | 1989 | BLOCK_INPUT; |
| 1990 | result = (STRINGP (fontset_name) | 1990 | result = (STRINGP (fontset_name) |
| 1991 | ? x_new_fontset (f, XSTRING (fontset_name)->data) | 1991 | ? x_new_fontset (f, fontset_name) |
| 1992 | : x_new_fontset (f, XSTRING (arg)->data)); | 1992 | : x_new_fontset (f, arg)); |
| 1993 | UNBLOCK_INPUT; | 1993 | UNBLOCK_INPUT; |
| 1994 | 1994 | ||
| 1995 | if (EQ (result, Qnil)) | 1995 | if (EQ (result, Qnil)) |
| @@ -4424,31 +4424,42 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 4424 | { | 4424 | { |
| 4425 | Lisp_Object font; | 4425 | Lisp_Object font; |
| 4426 | 4426 | ||
| 4427 | font = x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING); | 4427 | font = x_get_arg (dpyinfo, parms, Qfont, |
| 4428 | "font", "Font", RES_TYPE_STRING); | ||
| 4428 | 4429 | ||
| 4429 | BLOCK_INPUT; | 4430 | /* If the caller has specified no font, try out fonts which we |
| 4430 | /* First, try whatever font the caller has specified. */ | 4431 | hope have bold and italic variations. */ |
| 4431 | if (STRINGP (font)) | ||
| 4432 | font = x_new_fontset (f, XSTRING (font)->data); | ||
| 4433 | |||
| 4434 | /* Try out a font which we hope has bold and italic variations. */ | ||
| 4435 | if (!STRINGP (font)) | 4432 | if (!STRINGP (font)) |
| 4436 | font = x_new_fontset (f, "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1"); | 4433 | { |
| 4437 | if (!STRINGP (font)) | 4434 | char *names[] |
| 4438 | font = x_new_fontset (f, "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1"); | 4435 | = { "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1", |
| 4439 | if (! STRINGP (font)) | 4436 | "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1", |
| 4440 | font = x_new_fontset (f, "-*-*-medium-r-normal-*-*-140-*-*-c-*-iso8859-1"); | 4437 | "-*-*-medium-r-normal-*-*-140-*-*-c-*-iso8859-1", |
| 4441 | if (! STRINGP (font)) | 4438 | /* This was formerly the first thing tried, but it finds |
| 4442 | /* This was formerly the first thing tried, but it finds too many fonts | 4439 | too many fonts and takes too long. */ |
| 4443 | and takes too long. */ | 4440 | "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-1", |
| 4444 | font = x_new_fontset (f, "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-1"); | 4441 | /* If those didn't work, look for something which will |
| 4445 | /* If those didn't work, look for something which will at least work. */ | 4442 | at least work. */ |
| 4446 | if (! STRINGP (font)) | 4443 | "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1", |
| 4447 | font = x_new_fontset (f, "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1"); | 4444 | NULL }; |
| 4448 | UNBLOCK_INPUT; | 4445 | int i; |
| 4449 | if (! STRINGP (font)) | 4446 | |
| 4450 | font = build_string ("fixed"); | 4447 | BLOCK_INPUT; |
| 4448 | for (i = 0; names[i]; i++) | ||
| 4449 | { | ||
| 4450 | Lisp_Object list; | ||
| 4451 | 4451 | ||
| 4452 | list = x_list_fonts (f, build_string (names[i]), 0, 1); | ||
| 4453 | if (CONSP (list)) | ||
| 4454 | { | ||
| 4455 | font = XCAR (list); | ||
| 4456 | break; | ||
| 4457 | } | ||
| 4458 | } | ||
| 4459 | UNBLOCK_INPUT; | ||
| 4460 | if (! STRINGP (font)) | ||
| 4461 | font = build_string ("fixed"); | ||
| 4462 | } | ||
| 4452 | x_default_parameter (f, parms, Qfont, font, | 4463 | x_default_parameter (f, parms, Qfont, font, |
| 4453 | "font", "Font", RES_TYPE_STRING); | 4464 | "font", "Font", RES_TYPE_STRING); |
| 4454 | } | 4465 | } |
| @@ -11019,9 +11030,9 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 11019 | { | 11030 | { |
| 11020 | tem = Fquery_fontset (font, Qnil); | 11031 | tem = Fquery_fontset (font, Qnil); |
| 11021 | if (STRINGP (tem)) | 11032 | if (STRINGP (tem)) |
| 11022 | font = x_new_fontset (f, XSTRING (tem)->data); | 11033 | font = x_new_fontset (f, tem); |
| 11023 | else | 11034 | else |
| 11024 | font = x_new_font (f, XSTRING (font)->data); | 11035 | font = x_new_fontset (f, font); |
| 11025 | } | 11036 | } |
| 11026 | 11037 | ||
| 11027 | /* Try out a font which we hope has bold and italic variations. */ | 11038 | /* Try out a font which we hope has bold and italic variations. */ |