diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/xterm.c b/src/xterm.c index 52f38b7f29e..638ce463065 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -9443,11 +9443,11 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 9443 | Display *dpy = dpyinfo->display; | 9443 | Display *dpy = dpyinfo->display; |
| 9444 | int try_XLoadQueryFont = 0; | 9444 | int try_XLoadQueryFont = 0; |
| 9445 | int count; | 9445 | int count; |
| 9446 | int allow_scalable_fonts_p = 0; | 9446 | int allow_auto_scaled_font = 0; |
| 9447 | 9447 | ||
| 9448 | if (size < 0) | 9448 | if (size < 0) |
| 9449 | { | 9449 | { |
| 9450 | allow_scalable_fonts_p = 1; | 9450 | allow_auto_scaled_font = 1; |
| 9451 | size = 0; | 9451 | size = 0; |
| 9452 | } | 9452 | } |
| 9453 | 9453 | ||
| @@ -9470,7 +9470,7 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 9470 | ((((PATTERN . MAXNAMES) . SCALABLE) (FONTNAME . WIDTH) ...) ...) */ | 9470 | ((((PATTERN . MAXNAMES) . SCALABLE) (FONTNAME . WIDTH) ...) ...) */ |
| 9471 | tem = XCDR (dpyinfo->name_list_element); | 9471 | tem = XCDR (dpyinfo->name_list_element); |
| 9472 | key = Fcons (Fcons (pattern, make_number (maxnames)), | 9472 | key = Fcons (Fcons (pattern, make_number (maxnames)), |
| 9473 | allow_scalable_fonts_p ? Qt : Qnil); | 9473 | allow_auto_scaled_font ? Qt : Qnil); |
| 9474 | list = Fassoc (key, tem); | 9474 | list = Fassoc (key, tem); |
| 9475 | if (!NILP (list)) | 9475 | if (!NILP (list)) |
| 9476 | { | 9476 | { |
| @@ -9576,25 +9576,28 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 9576 | { | 9576 | { |
| 9577 | int width = 0; | 9577 | int width = 0; |
| 9578 | char *p = names[i]; | 9578 | char *p = names[i]; |
| 9579 | int average_width = -1, dashes = 0; | 9579 | int average_width = -1, resx = 0, dashes = 0; |
| 9580 | 9580 | ||
| 9581 | /* Count the number of dashes in NAMES[I]. If there are | 9581 | /* Count the number of dashes in NAMES[I]. If there are |
| 9582 | 14 dashes, and the field value following 12th dash | 9582 | 14 dashes, the field value following 9th dash |
| 9583 | (AVERAGE_WIDTH) is 0, this is a auto-scaled font which | 9583 | (RESOLUTION_X) is nonzero, and the field value |
| 9584 | is usually too ugly to be used for editing. Let's | 9584 | following 12th dash (AVERAGE_WIDTH) is 0, this is a |
| 9585 | ignore it. */ | 9585 | auto-scaled font which is usually too ugly to be used |
| 9586 | for editing. Let's ignore it. */ | ||
| 9586 | while (*p) | 9587 | while (*p) |
| 9587 | if (*p++ == '-') | 9588 | if (*p++ == '-') |
| 9588 | { | 9589 | { |
| 9589 | dashes++; | 9590 | dashes++; |
| 9590 | if (dashes == 7) /* PIXEL_SIZE field */ | 9591 | if (dashes == 7) /* PIXEL_SIZE field */ |
| 9591 | width = atoi (p); | 9592 | width = atoi (p); |
| 9593 | else if (dashes == 9) | ||
| 9594 | resx = atoi (p); | ||
| 9592 | else if (dashes == 12) /* AVERAGE_WIDTH field */ | 9595 | else if (dashes == 12) /* AVERAGE_WIDTH field */ |
| 9593 | average_width = atoi (p); | 9596 | average_width = atoi (p); |
| 9594 | } | 9597 | } |
| 9595 | 9598 | ||
| 9596 | if (allow_scalable_fonts_p | 9599 | if (allow_auto_scaled_font |
| 9597 | || dashes < 14 || average_width != 0) | 9600 | || dashes < 14 || average_width != 0 || resx == 0) |
| 9598 | { | 9601 | { |
| 9599 | tem = build_string (names[i]); | 9602 | tem = build_string (names[i]); |
| 9600 | if (NILP (Fassoc (tem, list))) | 9603 | if (NILP (Fassoc (tem, list))) |