Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
0e5d7800
Commit
0e5d7800
authored
May 14, 2010
by
Kenichi Handa
Browse files
font.c (font_range): Return the range for the font found at first.
parent
e05aebe9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
36 deletions
+12
-36
src/ChangeLog
src/ChangeLog
+5
-0
src/font.c
src/font.c
+7
-36
No files found.
src/ChangeLog
View file @
0e5d7800
2010-05-14 Kenichi Handa <handa@m17n.org>
* font.c (font_range): Return the range for the font found at
first.
2010-05-12 Glenn Morris <rgm@gnu.org>
2010-05-12 Glenn Morris <rgm@gnu.org>
* Makefile.in (YMF_PASS_LDFLAGS, LD, LINKER): Simplify the logic.
* Makefile.in (YMF_PASS_LDFLAGS, LD, LINKER): Simplify the logic.
...
...
src/font.c
View file @
0e5d7800
...
@@ -3961,7 +3961,7 @@ font_range (pos, limit, w, face, string)
...
@@ -3961,7 +3961,7 @@ font_range (pos, limit, w, face, string)
struct face *face;
struct face *face;
Lisp_Object string;
Lisp_Object string;
{
{
EMACS_INT pos_byte, ignore
, start, start_byte
;
EMACS_INT pos_byte, ignore;
int c;
int c;
Lisp_Object font_object = Qnil;
Lisp_Object font_object = Qnil;
...
@@ -3983,7 +3983,6 @@ font_range (pos, limit, w, face, string)
...
@@ -3983,7 +3983,6 @@ font_range (pos, limit, w, face, string)
pos_byte = string_char_to_byte (string, pos);
pos_byte = string_char_to_byte (string, pos);
}
}
start = pos, start_byte = pos_byte;
while (pos < *limit)
while (pos < *limit)
{
{
Lisp_Object category;
Lisp_Object category;
...
@@ -3992,6 +3991,10 @@ font_range (pos, limit, w, face, string)
...
@@ -3992,6 +3991,10 @@ font_range (pos, limit, w, face, string)
FETCH_CHAR_ADVANCE_NO_CHECK (c, pos, pos_byte);
FETCH_CHAR_ADVANCE_NO_CHECK (c, pos, pos_byte);
else
else
FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, string, pos, pos_byte);
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))
if (NILP (font_object))
{
{
font_object = font_for_char (face, c, pos - 1, string);
font_object = font_for_char (face, c, pos - 1, string);
...
@@ -3999,40 +4002,8 @@ font_range (pos, limit, w, face, string)
...
@@ -3999,40 +4002,8 @@ font_range (pos, limit, w, face, string)
return Qnil;
return Qnil;
continue;
continue;
}
}
if (font_encode_char (font_object, c) == FONT_INVALID_CODE)
category = CHAR_TABLE_REF (Vunicode_category_table, c);
*limit = pos - 1;
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;
}
}
}
return font_object;
return font_object;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment