aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa1999-12-15 00:24:07 +0000
committerKenichi Handa1999-12-15 00:24:07 +0000
commit78d2079c49189b3dc77cef2efeed635e6eaab711 (patch)
tree9d575914dfd13b6205441b37c5f481c5ac3aace6
parent260a86a07c364e6dfac1cf1e1476575744461124 (diff)
downloademacs-78d2079c49189b3dc77cef2efeed635e6eaab711.tar.gz
emacs-78d2079c49189b3dc77cef2efeed635e6eaab711.zip
(choose_face_fontset_font): Delete codes for a
composite character. (realize_x_face): Likewise. Change a place to set local variable `f' to avoid a bug of GCC 2.8.1 on Solaris.
-rw-r--r--src/xfaces.c46
1 files changed, 18 insertions, 28 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index 4e8e2514c1d..5fdb881bfc0 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -96,12 +96,11 @@ Boston, MA 02111-1307, USA. */
96 different charsets, different realized faces are needed to display 96 different charsets, different realized faces are needed to display
97 them. 97 them.
98 98
99 Except for composite characters (CHARSET_COMPOSITION), faces are 99 Faces are always realized for a specific character set and contain
100 always realized for a specific character set and contain a specific 100 a specific font, even if the face being realized specifies a
101 font, even if the face being realized specifies a fontset (see 101 fontset (see `font selection' below). The reason is that the
102 `font selection' below). The reason is that the result of the new 102 result of the new font selection stage is better than what can be
103 font selection stage is better than what can be done with 103 done with statically defined font name patterns in fontsets.
104 statically defined font name patterns in fontsets.
105 104
106 105
107 Unibyte text. 106 Unibyte text.
@@ -5487,10 +5486,10 @@ choose_face_font (f, attrs, charset, unibyte_registry)
5487 5486
5488/* Choose a font to use on frame F to display CHARSET using FONTSET 5487/* Choose a font to use on frame F to display CHARSET using FONTSET
5489 with Lisp face attributes specified by ATTRS. CHARSET may be any 5488 with Lisp face attributes specified by ATTRS. CHARSET may be any
5490 valid charset except CHARSET_COMPOSITION. CHARSET < 0 means 5489 valid charset. CHARSET < 0 means unibyte text. If the fontset
5491 unibyte text. If the fontset doesn't contain a font pattern for 5490 doesn't contain a font pattern for charset, use the pattern for
5492 charset, use the pattern for CHARSET_ASCII. Value is the font name 5491 CHARSET_ASCII. Value is the font name which is allocated from the
5493 which is allocated from the heap and must be freed by the caller. */ 5492 heap and must be freed by the caller. */
5494 5493
5495static char * 5494static char *
5496choose_face_fontset_font (f, attrs, fontset, charset) 5495choose_face_fontset_font (f, attrs, fontset, charset)
@@ -5504,7 +5503,6 @@ choose_face_fontset_font (f, attrs, fontset, charset)
5504 struct font_name *fonts; 5503 struct font_name *fonts;
5505 int nfonts; 5504 int nfonts;
5506 5505
5507 xassert (charset != CHARSET_COMPOSITION);
5508 xassert (fontset >= 0 && fontset < FRAME_FONTSET_DATA (f)->n_fontsets); 5506 xassert (fontset >= 0 && fontset < FRAME_FONTSET_DATA (f)->n_fontsets);
5509 5507
5510 /* For unibyte text, use the ASCII font of the fontset. Using the 5508 /* For unibyte text, use the ASCII font of the fontset. Using the
@@ -5819,7 +5817,7 @@ realize_x_face (c, attrs, charset)
5819{ 5817{
5820#ifdef HAVE_X_WINDOWS 5818#ifdef HAVE_X_WINDOWS
5821 struct face *face, *default_face; 5819 struct face *face, *default_face;
5822 struct frame *f = c->f; 5820 struct frame *f;
5823 Lisp_Object stipple, overline, strike_through, box; 5821 Lisp_Object stipple, overline, strike_through, box;
5824 Lisp_Object unibyte_registry; 5822 Lisp_Object unibyte_registry;
5825 struct gcpro gcpro1; 5823 struct gcpro gcpro1;
@@ -5839,6 +5837,7 @@ realize_x_face (c, attrs, charset)
5839 /* Allocate a new realized face. */ 5837 /* Allocate a new realized face. */
5840 face = make_realized_face (attrs, charset, unibyte_registry); 5838 face = make_realized_face (attrs, charset, unibyte_registry);
5841 5839
5840 f = c->f;
5842 /* Determine the font to use. Most of the time, the font will be 5841 /* Determine the font to use. Most of the time, the font will be
5843 the same as the font of the default face, so try that first. */ 5842 the same as the font of the default face, so try that first. */
5844 default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); 5843 default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
@@ -5854,25 +5853,16 @@ realize_x_face (c, attrs, charset)
5854 } 5853 }
5855 else if (charset >= 0) 5854 else if (charset >= 0)
5856 { 5855 {
5857 /* For all charsets except CHARSET_COMPOSITION, we use our own 5856 /* For all charsets, we use our own font selection functions to
5858 font selection functions to choose a best matching font for 5857 choose a best matching font for the specified face
5859 the specified face attributes. If the face specifies a 5858 attributes. If the face specifies a fontset alias name, the
5860 fontset alias name, the fontset determines the font name 5859 fontset determines the font name pattern, otherwise we
5861 pattern, otherwise we construct a font pattern from face 5860 construct a font pattern from face attributes and charset. */
5862 attributes and charset.
5863
5864 If charset is CHARSET_COMPOSITION, we always construct a face
5865 with a fontset, even if the face doesn't specify a fontset alias
5866 (we use fontset-standard in that case). When the composite
5867 character is displayed in xterm.c, a suitable concrete font is
5868 loaded in x_get_char_font_and_encoding. */
5869 5861
5870 char *font_name = NULL; 5862 char *font_name = NULL;
5871 int fontset = face_fontset (f, attrs); 5863 int fontset = face_fontset (f, attrs);
5872 5864
5873 if (charset == CHARSET_COMPOSITION) 5865 if (fontset < 0)
5874 fontset = max (0, fontset);
5875 else if (fontset < 0)
5876 font_name = choose_face_font (f, attrs, charset, Qnil); 5866 font_name = choose_face_font (f, attrs, charset, Qnil);
5877 else 5867 else
5878 { 5868 {
@@ -6035,7 +6025,7 @@ realize_x_face (c, attrs, charset)
6035 face->stipple = load_pixmap (f, stipple, &face->pixmap_w, &face->pixmap_h); 6025 face->stipple = load_pixmap (f, stipple, &face->pixmap_w, &face->pixmap_h);
6036 6026
6037 UNGCPRO; 6027 UNGCPRO;
6038 xassert (face->fontset < 0 || face->charset == CHARSET_COMPOSITION); 6028 xassert (face->fontset < 0);
6039 xassert (FACE_SUITABLE_FOR_CHARSET_P (face, charset)); 6029 xassert (FACE_SUITABLE_FOR_CHARSET_P (face, charset));
6040 return face; 6030 return face;
6041#endif /* HAVE_X_WINDOWS */ 6031#endif /* HAVE_X_WINDOWS */