aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2006-10-31 05:07:21 +0000
committerKenichi Handa2006-10-31 05:07:21 +0000
commit1f6ac2c8c810a6e3876e5274c1e6ee2b82265e01 (patch)
treed569855877dcddca061a698b264798274237a5c6 /src
parent503be82149af57edcba384554e0f268b9a9551e1 (diff)
downloademacs-1f6ac2c8c810a6e3876e5274c1e6ee2b82265e01.tar.gz
emacs-1f6ac2c8c810a6e3876e5274c1e6ee2b82265e01.zip
(get_next_display_element): Set it->face_id for the
first component of a composition. (x_produce_glyphs): Check if the font is changed or not for composition.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c48
1 files changed, 21 insertions, 27 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 688c9aabd3c..b9fd48adc96 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5899,20 +5899,21 @@ get_next_display_element (it)
5899 goto get_next; 5899 goto get_next;
5900 } 5900 }
5901 } 5901 }
5902 }
5902 5903
5903 /* Adjust face id for a multibyte character. There are no 5904 /* Adjust face id for a multibyte character. There are no multibyte
5904 multibyte character in unibyte text. */ 5905 character in unibyte text. */
5905 if (it->multibyte_p 5906 if ((it->what == IT_CHARACTER || it->what == IT_COMPOSITION)
5906 && success_p 5907 && it->multibyte_p
5907 && FRAME_WINDOW_P (it->f)) 5908 && success_p
5908 { 5909 && FRAME_WINDOW_P (it->f))
5909 struct face *face = FACE_FROM_ID (it->f, it->face_id); 5910 {
5910 int pos = (it->s ? -1 5911 struct face *face = FACE_FROM_ID (it->f, it->face_id);
5911 : STRINGP (it->string) ? IT_STRING_CHARPOS (*it) 5912 int pos = (it->s ? -1
5912 : IT_CHARPOS (*it)); 5913 : STRINGP (it->string) ? IT_STRING_CHARPOS (*it)
5914 : IT_CHARPOS (*it));
5913 5915
5914 it->face_id = FACE_FOR_CHAR (it->f, face, it->c, pos, it->string); 5916 it->face_id = FACE_FOR_CHAR (it->f, face, it->c, pos, it->string);
5915 }
5916 } 5917 }
5917 5918
5918 /* Is this character the last one of a run of characters with 5919 /* Is this character the last one of a run of characters with
@@ -20883,13 +20884,15 @@ x_produce_glyphs (it)
20883 struct face *face = FACE_FROM_ID (it->f, it->face_id); 20884 struct face *face = FACE_FROM_ID (it->f, it->face_id);
20884 int boff; /* baseline offset */ 20885 int boff; /* baseline offset */
20885 struct composition *cmp = composition_table[it->cmp_id]; 20886 struct composition *cmp = composition_table[it->cmp_id];
20887 int glyph_len = cmp->glyph_len;
20888 XFontStruct *font = face->font;
20886 20889
20887 it->nglyphs = 1; 20890 it->nglyphs = 1;
20888 20891
20889#ifdef USE_FONT_BACKEND 20892#ifdef USE_FONT_BACKEND
20890 if (cmp->method == COMPOSITION_WITH_GLYPH_STRING) 20893 if (cmp->method == COMPOSITION_WITH_GLYPH_STRING)
20891 { 20894 {
20892 if (! cmp->font) 20895 if (! cmp->font || cmp->font != font)
20893 font_prepare_composition (cmp); 20896 font_prepare_composition (cmp);
20894 } 20897 }
20895 else 20898 else
@@ -20901,7 +20904,7 @@ x_produce_glyphs (it)
20901 here we check only the font of the first glyph. This leads 20904 here we check only the font of the first glyph. This leads
20902 to incorrect display, but it's very rare, and C-l (recenter) 20905 to incorrect display, but it's very rare, and C-l (recenter)
20903 can correct the display anyway. */ 20906 can correct the display anyway. */
20904 if (! cmp->font) 20907 if (! cmp->font || cmp->font != font)
20905 { 20908 {
20906 /* Ascent and descent of the font of the first character 20909 /* Ascent and descent of the font of the first character
20907 of this composition (adjusted by baseline offset). 20910 of this composition (adjusted by baseline offset).
@@ -20913,11 +20916,9 @@ x_produce_glyphs (it)
20913 int lbearing, rbearing; 20916 int lbearing, rbearing;
20914 int i, width, ascent, descent; 20917 int i, width, ascent, descent;
20915 int left_padded = 0, right_padded = 0; 20918 int left_padded = 0, right_padded = 0;
20916 int glyph_len = cmp->glyph_len;
20917 int face_id; 20919 int face_id;
20918 int c; 20920 int c;
20919 XChar2b char2b; 20921 XChar2b char2b;
20920 XFontStruct *font;
20921 XCharStruct *pcm; 20922 XCharStruct *pcm;
20922 int font_not_found_p; 20923 int font_not_found_p;
20923 struct font_info *font_info; 20924 struct font_info *font_info;
@@ -20937,23 +20938,16 @@ x_produce_glyphs (it)
20937 if (i > 0) 20938 if (i > 0)
20938 left_padded = 1; 20939 left_padded = 1;
20939 20940
20940 /* Get the font of the first non-TAB component. */
20941 pos = (STRINGP (it->string) ? IT_STRING_CHARPOS (*it) 20941 pos = (STRINGP (it->string) ? IT_STRING_CHARPOS (*it)
20942 : IT_CHARPOS (*it)); 20942 : IT_CHARPOS (*it));
20943 face_id = FACE_FOR_CHAR (it->f, face, c, pos, it->string);
20944 font = FACE_FROM_ID (it->f, face_id)->font;
20945 /* When no suitable font found, use the default font. */ 20943 /* When no suitable font found, use the default font. */
20946 font_not_found_p = font == NULL; 20944 font_not_found_p = font == NULL;
20947 if (font_not_found_p) 20945 if (font_not_found_p)
20948 { 20946 {
20949 font = FACE_FROM_ID (it->f, it->face_id)->font; 20947 face = face->ascii_face;
20950 font_info 20948 font = face->font;
20951 = FONT_INFO_FROM_FACE (it->f,
20952 FACE_FROM_ID (it->f, it->face_id));
20953 } 20949 }
20954 else 20950 font_info = FONT_INFO_FROM_FACE (it->f, face);
20955 font_info
20956 = FONT_INFO_FROM_FACE (it->f, FACE_FROM_ID (it->f, face_id));
20957 boff = font_info->baseline_offset; 20951 boff = font_info->baseline_offset;
20958 if (font_info->vertical_centering) 20952 if (font_info->vertical_centering)
20959 boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff; 20953 boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff;
@@ -20966,7 +20960,7 @@ x_produce_glyphs (it)
20966 pcm = NULL; 20960 pcm = NULL;
20967 if (! font_not_found_p) 20961 if (! font_not_found_p)
20968 { 20962 {
20969 get_char_face_and_encoding (it->f, c, face_id, 20963 get_char_face_and_encoding (it->f, c, it->face_id,
20970 &char2b, it->multibyte_p, 0); 20964 &char2b, it->multibyte_p, 0);
20971 pcm = get_per_char_metric (font, font_info, &char2b, 20965 pcm = get_per_char_metric (font, font_info, &char2b,
20972 FONT_TYPE_FOR_MULTIBYTE (font, c)); 20966 FONT_TYPE_FOR_MULTIBYTE (font, c));