Mercurial > emacs
comparison src/xterm.c @ 89845:982dd1857a87
(x_list_fonts): Fix the detection of an auto-scaled font.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Thu, 04 Mar 2004 12:43:44 +0000 |
parents | c734f0c6c3ca |
children | 68c22ea6027c |
comparison
equal
deleted
inserted
replaced
89844:02a959f3ee57 | 89845:982dd1857a87 |
---|---|
9574 int width = 0; | 9574 int width = 0; |
9575 char *p = names[i]; | 9575 char *p = names[i]; |
9576 int average_width = -1, resx = 0, dashes = 0; | 9576 int average_width = -1, resx = 0, dashes = 0; |
9577 | 9577 |
9578 /* Count the number of dashes in NAMES[I]. If there are | 9578 /* Count the number of dashes in NAMES[I]. If there are |
9579 14 dashes, the field value following 9th dash | 9579 14 dashes, the field value following 7th dash |
9580 (RESOLUTION_X) is nonzero, and the field value | 9580 (PIXEL_SIZE) is zero, the field value following 9th |
9581 dash (RESOLUTION_X) is nonzero, and the field value | |
9581 following 12th dash (AVERAGE_WIDTH) is 0, this is a | 9582 following 12th dash (AVERAGE_WIDTH) is 0, this is a |
9582 auto-scaled font which is usually too ugly to be used | 9583 auto-scaled font which is usually too ugly to be used |
9583 for editing. Let's ignore it. */ | 9584 for editing. Let's ignore it. */ |
9584 while (*p) | 9585 while (*p) |
9585 if (*p++ == '-') | 9586 if (*p++ == '-') |
9592 else if (dashes == 12) /* AVERAGE_WIDTH field */ | 9593 else if (dashes == 12) /* AVERAGE_WIDTH field */ |
9593 average_width = atoi (p); | 9594 average_width = atoi (p); |
9594 } | 9595 } |
9595 | 9596 |
9596 if (allow_auto_scaled_font | 9597 if (allow_auto_scaled_font |
9597 || dashes < 14 || average_width != 0 || resx == 0) | 9598 || dashes < 14 |
9599 || ! (width == 0 && resx != 0 && average_width == 0)) | |
9598 { | 9600 { |
9599 tem = build_string (names[i]); | 9601 tem = build_string (names[i]); |
9600 if (NILP (Fassoc (tem, list))) | 9602 if (NILP (Fassoc (tem, list))) |
9601 { | 9603 { |
9602 if (STRINGP (Vx_pixel_size_width_font_regexp) | 9604 if (STRINGP (Vx_pixel_size_width_font_regexp) |