diff options
| author | Richard M. Stallman | 1994-04-09 06:33:49 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-09 06:33:49 +0000 |
| commit | 729425b1068937c40abca197f150faca03e91100 (patch) | |
| tree | 0fdfc1c13ad50c67334f0fd259f3039f6d93e7e6 /src | |
| parent | a27f9f86efd203e0dede68dcb33c3681d5f503aa (diff) | |
| download | emacs-729425b1068937c40abca197f150faca03e91100.tar.gz emacs-729425b1068937c40abca197f150faca03e91100.zip | |
(frame_update_line_height): New function.
(Fset_face_attribute_internal): Call that.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfaces.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index 707991824b8..b96ace2abf2 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -659,6 +659,31 @@ same_size_fonts (font1, font2) | |||
| 659 | && bounds1->descent == bounds2->descent); */ | 659 | && bounds1->descent == bounds2->descent); */ |
| 660 | } | 660 | } |
| 661 | 661 | ||
| 662 | /* Update the line_height of frame F according to the biggest font in | ||
| 663 | any face, and resize the frame if line_height changes. */ | ||
| 664 | |||
| 665 | void | ||
| 666 | frame_update_line_height (f) | ||
| 667 | FRAME_PTR f; | ||
| 668 | { | ||
| 669 | int i; | ||
| 670 | int biggest = FONT_HEIGHT (f->display.x->font); | ||
| 671 | |||
| 672 | for (i = 0; i < f->display.x->n_param_faces; i++) | ||
| 673 | if (f->display.x->param_faces[i]->font != (XFontStruct *) FACE_DEFAULT) | ||
| 674 | { | ||
| 675 | int height = FONT_HEIGHT (f->display.x->param_faces[i]->font); | ||
| 676 | if (height > biggest) | ||
| 677 | biggest = height; | ||
| 678 | } | ||
| 679 | |||
| 680 | if (biggest == f->display.x->line_height) | ||
| 681 | return; | ||
| 682 | |||
| 683 | f->display.x->line_height = biggest; | ||
| 684 | x_set_window_size (f, 0, f->width, f->height); | ||
| 685 | } | ||
| 686 | |||
| 662 | /* Modify face TO by copying from FROM all properties which have | 687 | /* Modify face TO by copying from FROM all properties which have |
| 663 | nondefault settings. */ | 688 | nondefault settings. */ |
| 664 | static void | 689 | static void |
| @@ -967,6 +992,7 @@ DEFUN ("set-face-attribute-internal", Fset_face_attribute_internal, | |||
| 967 | if (face->font != f->display.x->font) | 992 | if (face->font != f->display.x->font) |
| 968 | unload_font (f, face->font); | 993 | unload_font (f, face->font); |
| 969 | face->font = font; | 994 | face->font = font; |
| 995 | frame_update_line_height (f); | ||
| 970 | } | 996 | } |
| 971 | else if (EQ (attr_name, intern ("foreground"))) | 997 | else if (EQ (attr_name, intern ("foreground"))) |
| 972 | { | 998 | { |