aboutsummaryrefslogtreecommitdiffstats
path: root/src/font.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/font.c')
-rw-r--r--src/font.c43
1 files changed, 7 insertions, 36 deletions
diff --git a/src/font.c b/src/font.c
index 2d55065e9c8..5ee51a6474c 100644
--- a/src/font.c
+++ b/src/font.c
@@ -3961,7 +3961,7 @@ font_range (pos, limit, w, face, string)
3961 struct face *face; 3961 struct face *face;
3962 Lisp_Object string; 3962 Lisp_Object string;
3963{ 3963{
3964 EMACS_INT pos_byte, ignore, start, start_byte; 3964 EMACS_INT pos_byte, ignore;
3965 int c; 3965 int c;
3966 Lisp_Object font_object = Qnil; 3966 Lisp_Object font_object = Qnil;
3967 3967
@@ -3983,7 +3983,6 @@ font_range (pos, limit, w, face, string)
3983 pos_byte = string_char_to_byte (string, pos); 3983 pos_byte = string_char_to_byte (string, pos);
3984 } 3984 }
3985 3985
3986 start = pos, start_byte = pos_byte;
3987 while (pos < *limit) 3986 while (pos < *limit)
3988 { 3987 {
3989 Lisp_Object category; 3988 Lisp_Object category;
@@ -3992,6 +3991,10 @@ font_range (pos, limit, w, face, string)
3992 FETCH_CHAR_ADVANCE_NO_CHECK (c, pos, pos_byte); 3991 FETCH_CHAR_ADVANCE_NO_CHECK (c, pos, pos_byte);
3993 else 3992 else
3994 FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, string, pos, pos_byte); 3993 FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, string, pos, pos_byte);
3994 category = CHAR_TABLE_REF (Vunicode_category_table, c);
3995 if (EQ (category, QCf)
3996 || CHAR_VARIATION_SELECTOR_P (c))
3997 continue;
3995 if (NILP (font_object)) 3998 if (NILP (font_object))
3996 { 3999 {
3997 font_object = font_for_char (face, c, pos - 1, string); 4000 font_object = font_for_char (face, c, pos - 1, string);
@@ -3999,40 +4002,8 @@ font_range (pos, limit, w, face, string)
3999 return Qnil; 4002 return Qnil;
4000 continue; 4003 continue;
4001 } 4004 }
4002 4005 if (font_encode_char (font_object, c) == FONT_INVALID_CODE)
4003 category = CHAR_TABLE_REF (Vunicode_category_table, c); 4006 *limit = pos - 1;
4004 if (! EQ (category, QCf)
4005 && ! CHAR_VARIATION_SELECTOR_P (c)
4006 && font_encode_char (font_object, c) == FONT_INVALID_CODE)
4007 {
4008 Lisp_Object f = font_for_char (face, c, pos - 1, string);
4009 EMACS_INT i, i_byte;
4010
4011
4012 if (NILP (f))
4013 {
4014 *limit = pos - 1;
4015 return font_object;
4016 }
4017 i = start, i_byte = start_byte;
4018 while (i < pos - 1)
4019 {
4020
4021 if (NILP (string))
4022 FETCH_CHAR_ADVANCE_NO_CHECK (c, i, i_byte);
4023 else
4024 FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, string, i, i_byte);
4025 category = CHAR_TABLE_REF (Vunicode_category_table, c);
4026 if (! EQ (category, QCf)
4027 && ! CHAR_VARIATION_SELECTOR_P (c)
4028 && font_encode_char (f, c) == FONT_INVALID_CODE)
4029 {
4030 *limit = pos - 1;
4031 return font_object;
4032 }
4033 }
4034 font_object = f;
4035 }
4036 } 4007 }
4037 return font_object; 4008 return font_object;
4038} 4009}