aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2008-06-29 14:31:18 +0000
committerKenichi Handa2008-06-29 14:31:18 +0000
commitfe44f0091c1f55dd774d9a85b92a3aa9cb629773 (patch)
tree95157dd1773ec2e0f110b06a4606099bea8f73a0
parent8e86803cbfdeecfe8684f67b056c4d91f0ad89da (diff)
downloademacs-fe44f0091c1f55dd774d9a85b92a3aa9cb629773.tar.gz
emacs-fe44f0091c1f55dd774d9a85b92a3aa9cb629773.zip
(Finternal_char_font): Return font-object instead of font-name.
-rw-r--r--src/ChangeLog8
-rw-r--r--src/fontset.c16
2 files changed, 16 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5e26e44b61d..4b3b75211bc 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12008-06-29 Kenichi Handa <handa@m17n.org>
2
3 * fontset.c (Finternal_char_font): Return font-object instead of
4 font-name.
5
6 * composite.c (get_composition_id): Fix the width calculation for
7 TAB.
8
12008-06-29 Stefan Monnier <monnier@iro.umontreal.ca> 92008-06-29 Stefan Monnier <monnier@iro.umontreal.ca>
2 10
3 * indent.c (Fvertical_motion): Properly handle float column arg. 11 * indent.c (Fvertical_motion): Properly handle float column arg.
diff --git a/src/fontset.c b/src/fontset.c
index 29a0bd4f1d1..2809fdfb5eb 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1645,11 +1645,11 @@ fontset_from_font (font_object)
1645 return XINT (FONTSET_ID (fontset)); 1645 return XINT (FONTSET_ID (fontset));
1646} 1646}
1647 1647
1648/* Return a cons (FONT-NAME . GLYPH-CODE). 1648/* Return a cons (FONT-OBJECT . GLYPH-CODE).
1649 FONT-NAME is the font name for the character at POSITION in the current 1649 FONT-OBJECT is the font for the character at POSITION in the current
1650 buffer. This is computed from all the text properties and overlays 1650 buffer. This is computed from all the text properties and overlays
1651 that apply to POSITION. POSTION may be nil, in which case, 1651 that apply to POSITION. POSTION may be nil, in which case,
1652 FONT-NAME is the font name for display the character CH with the 1652 FONT-SPEC is the font for displaying the character CH with the
1653 default face. 1653 default face.
1654 1654
1655 GLYPH-CODE is the glyph code in the font to use for the character. 1655 GLYPH-CODE is the glyph code in the font to use for the character.
@@ -1728,18 +1728,18 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
1728 face = FACE_FROM_ID (f, face_id); 1728 face = FACE_FROM_ID (f, face_id);
1729 if (face->font) 1729 if (face->font)
1730 { 1730 {
1731 struct font *font = face->font; 1731 unsigned code = face->font->driver->encode_char (face->font, c);
1732 unsigned code = font->driver->encode_char (font, c); 1732 Lisp_Object font_object;
1733 Lisp_Object fontname = font->props[FONT_NAME_INDEX];
1734 /* Assignment to EMACS_INT stops GCC whining about limited range 1733 /* Assignment to EMACS_INT stops GCC whining about limited range
1735 of data type. */ 1734 of data type. */
1736 EMACS_INT cod = code; 1735 EMACS_INT cod = code;
1737 1736
1738 if (code == FONT_INVALID_CODE) 1737 if (code == FONT_INVALID_CODE)
1739 return Qnil; 1738 return Qnil;
1739 XSETFONT (font_object, face->font);
1740 if (cod <= MOST_POSITIVE_FIXNUM) 1740 if (cod <= MOST_POSITIVE_FIXNUM)
1741 return Fcons (fontname, make_number (code)); 1741 return Fcons (font_object, make_number (code));
1742 return Fcons (fontname, Fcons (make_number (code >> 16), 1742 return Fcons (font_object, Fcons (make_number (code >> 16),
1743 make_number (code & 0xFFFF))); 1743 make_number (code & 0xFFFF)));
1744 } 1744 }
1745 return Qnil; 1745 return Qnil;