emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r100274: font.c (font_range): Return


From: Kenichi Handa
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100274: font.c (font_range): Return the range for the font found at first.
Date: Fri, 14 May 2010 12:53:22 +0900
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100274 [merge]
committer: Kenichi Handa <address@hidden>
branch nick: trunk
timestamp: Fri 2010-05-14 12:53:22 +0900
message:
  font.c (font_range): Return the range for the font found at first.
modified:
  src/ChangeLog
  src/font.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-05-14 03:36:40 +0000
+++ b/src/ChangeLog     2010-05-14 03:52:21 +0000
@@ -1,3 +1,8 @@
+2010-05-14  Kenichi Handa  <address@hidden>
+
+       * font.c (font_range): Return the range for the font found at
+       first.
+
 2010-05-14  Glenn Morris  <address@hidden>
 
        * Makefile.in (mktime, X11, register): Move undefs to configure.

=== modified file 'src/font.c'
--- a/src/font.c        2010-04-20 17:17:29 +0000
+++ b/src/font.c        2010-05-14 03:47:38 +0000
@@ -3961,7 +3961,7 @@
      struct face *face;
      Lisp_Object string;
 {
-  EMACS_INT pos_byte, ignore, start, start_byte;
+  EMACS_INT pos_byte, ignore;
   int c;
   Lisp_Object font_object = Qnil;
 
@@ -3983,7 +3983,6 @@
       pos_byte = string_char_to_byte (string, pos);
     }
 
-  start = pos, start_byte = pos_byte;
   while (pos < *limit)
     {
       Lisp_Object category;
@@ -3992,6 +3991,10 @@
        FETCH_CHAR_ADVANCE_NO_CHECK (c, pos, pos_byte);
       else
        FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, string, pos, pos_byte);
+      category = CHAR_TABLE_REF (Vunicode_category_table, c);
+      if (EQ (category, QCf)
+         || CHAR_VARIATION_SELECTOR_P (c))
+       continue;
       if (NILP (font_object))
        {
          font_object = font_for_char (face, c, pos - 1, string);
@@ -3999,40 +4002,8 @@
            return Qnil;
          continue;
        }
-
-      category = CHAR_TABLE_REF (Vunicode_category_table, c);
-      if (! EQ (category, QCf)
-         && ! CHAR_VARIATION_SELECTOR_P (c)
-         && font_encode_char (font_object, c) == FONT_INVALID_CODE)
-       {
-         Lisp_Object f = font_for_char (face, c, pos - 1, string);
-         EMACS_INT i, i_byte;
-
-
-         if (NILP (f))
-           {
-             *limit = pos - 1;
-             return font_object;
-           }
-         i = start, i_byte = start_byte;
-         while (i < pos - 1)
-           {
-
-             if (NILP (string))
-               FETCH_CHAR_ADVANCE_NO_CHECK (c, i, i_byte);
-             else
-               FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, string, i, i_byte);
-             category = CHAR_TABLE_REF (Vunicode_category_table, c);
-             if (! EQ (category, QCf)
-                 && ! CHAR_VARIATION_SELECTOR_P (c)
-                 && font_encode_char (f, c) == FONT_INVALID_CODE)
-               {
-                 *limit = pos - 1;
-                 return font_object;
-               }
-           }
-         font_object = f;
-       }
+      if (font_encode_char (font_object, c) == FONT_INVALID_CODE)
+       *limit = pos - 1;
     }
   return font_object;
 }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]