comparison src/faces.c @ 3707:f6f6fc9eb269

[xemacs-hg @ 2006-11-28 21:20:22 by aidan] Better language behaviour on startup.
author aidan
date Tue, 28 Nov 2006 21:20:37 +0000
parents 3ef0aaf3dc34
children c13b89ba4796
comparison
equal deleted inserted replaced
3706:4ca1ef2bdb6a 3707:f6f6fc9eb269
717 void 717 void
718 default_face_font_info (Lisp_Object domain, int *ascent, int *descent, 718 default_face_font_info (Lisp_Object domain, int *ascent, int *descent,
719 int *height, int *width, int *proportional_p) 719 int *height, int *width, int *proportional_p)
720 { 720 {
721 Lisp_Object font_instance; 721 Lisp_Object font_instance;
722 struct face_cachel *cachel;
723 struct window *w = NULL;
722 724
723 if (noninteractive) 725 if (noninteractive)
724 { 726 {
725 if (ascent) 727 if (ascent)
726 *ascent = 1; 728 *ascent = 1;
733 if (proportional_p) 735 if (proportional_p)
734 *proportional_p = 0; 736 *proportional_p = 0;
735 return; 737 return;
736 } 738 }
737 739
738 /* We use ASCII here. This is probably reasonable because the 740 /* We use ASCII here. This is reasonable because the people calling this
739 people calling this function are using the resulting values to 741 function are using the resulting values to come up with overall sizes
740 come up with overall sizes for windows and frames. */ 742 for windows and frames.
741 if (WINDOWP (domain)) 743
742 { 744 It's possible for this function to get called when the face cachels
743 struct face_cachel *cachel; 745 have not been initialized--put a call to debug-print in
744 struct window *w = XWINDOW (domain); 746 init-locale-at-early-startup to see it happen. */
745 747
746 /* #### It's possible for this function to get called when the 748 if (WINDOWP (domain) && (w = XWINDOW (domain)) && w->face_cachels)
747 face cachels have not been initialized. I don't know why. */ 749 {
748 if (!Dynarr_length (w->face_cachels)) 750 if (!Dynarr_length (w->face_cachels))
749 reset_face_cachels (w); 751 reset_face_cachels (w);
750 cachel = WINDOW_FACE_CACHEL (w, DEFAULT_INDEX); 752 cachel = WINDOW_FACE_CACHEL (w, DEFAULT_INDEX);
751 font_instance = FACE_CACHEL_FONT (cachel, Vcharset_ascii); 753 font_instance = FACE_CACHEL_FONT (cachel, Vcharset_ascii);
752 } 754 }
753 else 755 else
754 { 756 {
755 font_instance = FACE_FONT (Vdefault_face, domain, Vcharset_ascii); 757 font_instance = FACE_FONT (Vdefault_face, domain, Vcharset_ascii);
758 }
759
760 if (UNBOUNDP (font_instance))
761 {
762 return;
756 } 763 }
757 764
758 if (height) 765 if (height)
759 *height = XFONT_INSTANCE (font_instance)->height; 766 *height = XFONT_INSTANCE (font_instance)->height;
760 if (width) 767 if (width)