From fe44f0091c1f55dd774d9a85b92a3aa9cb629773 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Sun, 29 Jun 2008 14:31:18 +0000 Subject: [PATCH] (Finternal_char_font): Return font-object instead of font-name. --- src/ChangeLog | 8 ++++++++ src/fontset.c | 16 ++++++++-------- 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 @@ +2008-06-29 Kenichi Handa + + * fontset.c (Finternal_char_font): Return font-object instead of + font-name. + + * composite.c (get_composition_id): Fix the width calculation for + TAB. + 2008-06-29 Stefan Monnier * 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) return XINT (FONTSET_ID (fontset)); } -/* Return a cons (FONT-NAME . GLYPH-CODE). - FONT-NAME is the font name for the character at POSITION in the current +/* Return a cons (FONT-OBJECT . GLYPH-CODE). + FONT-OBJECT is the font for the character at POSITION in the current buffer. This is computed from all the text properties and overlays that apply to POSITION. POSTION may be nil, in which case, - FONT-NAME is the font name for display the character CH with the + FONT-SPEC is the font for displaying the character CH with the default face. 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, face = FACE_FROM_ID (f, face_id); if (face->font) { - struct font *font = face->font; - unsigned code = font->driver->encode_char (font, c); - Lisp_Object fontname = font->props[FONT_NAME_INDEX]; + unsigned code = face->font->driver->encode_char (face->font, c); + Lisp_Object font_object; /* Assignment to EMACS_INT stops GCC whining about limited range of data type. */ EMACS_INT cod = code; if (code == FONT_INVALID_CODE) return Qnil; + XSETFONT (font_object, face->font); if (cod <= MOST_POSITIVE_FIXNUM) - return Fcons (fontname, make_number (code)); - return Fcons (fontname, Fcons (make_number (code >> 16), + return Fcons (font_object, make_number (code)); + return Fcons (font_object, Fcons (make_number (code >> 16), make_number (code & 0xFFFF))); } return Qnil; -- 2.39.2