Mercurial > emacs
comparison src/xfaces.c @ 6768:0b61d2b74e64
(frame_update_line_height): New function.
(Fset_face_attribute_internal): Call that.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 09 Apr 1994 06:33:49 +0000 |
parents | 96ddf85642d1 |
children | d41c216ccd27 |
comparison
equal
deleted
inserted
replaced
6767:8fbcee1c2059 | 6768:0b61d2b74e64 |
---|---|
657 depend only on the height of the frame's font. | 657 depend only on the height of the frame's font. |
658 && bounds1->ascent == bounds2->ascent | 658 && bounds1->ascent == bounds2->ascent |
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 |
665 merge_faces (from, to) | 690 merge_faces (from, to) |
666 struct face *from, *to; | 691 struct face *from, *to; |
965 { | 990 { |
966 XFontStruct *font = load_font (f, attr_value); | 991 XFontStruct *font = load_font (f, attr_value); |
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 { |
973 unsigned long new_color = load_color (f, attr_value); | 999 unsigned long new_color = load_color (f, attr_value); |
974 unload_color (f, face->foreground); | 1000 unload_color (f, face->foreground); |