diff options
| author | Jason Rumney | 2008-02-05 21:51:14 +0000 |
|---|---|---|
| committer | Jason Rumney | 2008-02-05 21:51:14 +0000 |
| commit | 04b65d2b577b25e8b0a5d31692a8b66a0b298d1f (patch) | |
| tree | 86a5afd20f80bae921fde6ffa8f25d3108c970fd /src | |
| parent | f18ce50c69084c89bd5be8873c1588dec1609ba8 (diff) | |
| download | emacs-04b65d2b577b25e8b0a5d31692a8b66a0b298d1f.tar.gz emacs-04b65d2b577b25e8b0a5d31692a8b66a0b298d1f.zip | |
(w32font_open_internal): Fill min_width with tmAveCharWidth.
Set smallest_font_height and smallest_char_width in display info.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/w32font.c | 32 |
2 files changed, 36 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5f9547f6a75..a322a3ad735 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-02-05 Jason Rumney <jasonr@gnu.org> | ||
| 2 | |||
| 3 | * w32font.c (w32font_open_internal): Fill min_width with tmAveCharWidth. | ||
| 4 | Set smallest_font_height and smallest_char_width in display info. | ||
| 5 | |||
| 1 | 2008-02-05 Kenichi Handa <handa@ni.aist.go.jp> | 6 | 2008-02-05 Kenichi Handa <handa@ni.aist.go.jp> |
| 2 | 7 | ||
| 3 | * coding.c (decode_eol): Pay attention to coding->dst_multibyte. | 8 | * coding.c (decode_eol): Pay attention to coding->dst_multibyte. |
diff --git a/src/w32font.c b/src/w32font.c index b0e6b250a90..ddb2f43eb57 100644 --- a/src/w32font.c +++ b/src/w32font.c | |||
| @@ -724,11 +724,41 @@ w32font_open_internal (f, font_entity, pixel_size, w32_font) | |||
| 724 | font->file_name = NULL; | 724 | font->file_name = NULL; |
| 725 | font->encoding_charset = -1; | 725 | font->encoding_charset = -1; |
| 726 | font->repertory_charset = -1; | 726 | font->repertory_charset = -1; |
| 727 | font->min_width = 0; | 727 | /* TODO: do we really want the minimum width here, which could be negative? */ |
| 728 | font->min_width = font->font.space_width; | ||
| 728 | font->ascent = w32_font->metrics.tmAscent; | 729 | font->ascent = w32_font->metrics.tmAscent; |
| 729 | font->descent = w32_font->metrics.tmDescent; | 730 | font->descent = w32_font->metrics.tmDescent; |
| 730 | font->scalable = w32_font->metrics.tmPitchAndFamily & TMPF_VECTOR; | 731 | font->scalable = w32_font->metrics.tmPitchAndFamily & TMPF_VECTOR; |
| 731 | 732 | ||
| 733 | /* Set global flag fonts_changed_p to non-zero if the font loaded | ||
| 734 | has a character with a smaller width than any other character | ||
| 735 | before, or if the font loaded has a smaller height than any other | ||
| 736 | font loaded before. If this happens, it will make a glyph matrix | ||
| 737 | reallocation necessary. */ | ||
| 738 | { | ||
| 739 | struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); | ||
| 740 | dpyinfo->n_fonts++; | ||
| 741 | |||
| 742 | if (dpyinfo->n_fonts == 1) | ||
| 743 | { | ||
| 744 | dpyinfo->smallest_font_height = font->font.height; | ||
| 745 | dpyinfo->smallest_char_width = font->min_width; | ||
| 746 | } | ||
| 747 | else | ||
| 748 | { | ||
| 749 | if (dpyinfo->smallest_font_height > font->font.height) | ||
| 750 | { | ||
| 751 | dpyinfo->smallest_font_height = font->font.height; | ||
| 752 | fonts_changed_p |= 1; | ||
| 753 | } | ||
| 754 | if (dpyinfo->smallest_char_width > font->min_width) | ||
| 755 | { | ||
| 756 | dpyinfo->smallest_char_width = font->min_width; | ||
| 757 | fonts_changed_p |= 1; | ||
| 758 | } | ||
| 759 | } | ||
| 760 | } | ||
| 761 | |||
| 732 | return 1; | 762 | return 1; |
| 733 | } | 763 | } |
| 734 | 764 | ||