[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/fontset.c
From: |
Kenichi Handa |
Subject: |
[Emacs-diffs] Changes to emacs/src/fontset.c |
Date: |
Sun, 28 Sep 2003 19:17:47 -0400 |
Index: emacs/src/fontset.c
diff -c emacs/src/fontset.c:1.78 emacs/src/fontset.c:1.79
*** emacs/src/fontset.c:1.78 Mon Sep 1 11:45:52 2003
--- emacs/src/fontset.c Sun Sep 28 19:17:47 2003
***************
*** 36,41 ****
--- 36,50 ----
#include "dispextern.h"
#include "fontset.h"
#include "window.h"
+ #ifdef HAVE_X_WINDOWS
+ #include "xterm.h"
+ #endif
+ #ifdef WINDOWSNT
+ #include "w32term.h"
+ #endif
+ #ifdef MAC_OS
+ #include "macterm.h"
+ #endif
#ifdef FONTSET_DEBUG
#undef xassert
***************
*** 1139,1147 ****
}
! /* Return the font name for the character at POSITION in the current
buffer. This is computed from all the text properties and overlays
! that apply to POSITION. It returns nil in the following cases:
(1) The window system doesn't have a font for the character (thus
it is displayed by an empty box).
--- 1148,1163 ----
}
! /* Return a cons (FONT-NAME . GLYPH-CODE).
! FONT-NAME is the font name for the character at POSITION in the current
buffer. This is computed from all the text properties and overlays
! that apply to POSITION.
! GLYPH-CODE is the glyph code in the font to use for the character.
!
! If the 2nd optional arg CH is non-nil, it is a character to check
! the font instead of the character at POSITION.
!
! It returns nil in the following cases:
(1) The window system doesn't have a font for the character (thus
it is displayed by an empty box).
***************
*** 1155,1168 ****
POSITION is currently not visible. */
! DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 1,
0,
doc: /* For internal use only. */)
! (position)
! Lisp_Object position;
{
int pos, pos_byte, dummy;
int face_id;
! int c;
Lisp_Object window;
struct window *w;
struct frame *f;
--- 1171,1184 ----
POSITION is currently not visible. */
! DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2,
0,
doc: /* For internal use only. */)
! (position, ch)
! Lisp_Object position, ch;
{
int pos, pos_byte, dummy;
int face_id;
! int c, code;
Lisp_Object window;
struct window *w;
struct frame *f;
***************
*** 1173,1179 ****
if (pos < BEGV || pos >= ZV)
args_out_of_range_3 (position, make_number (BEGV), make_number (ZV));
pos_byte = CHAR_TO_BYTE (pos);
! c = FETCH_CHAR (pos_byte);
if (! CHAR_VALID_P (c, 0))
return Qnil;
window = Fget_buffer_window (Fcurrent_buffer (), Qnil);
--- 1189,1201 ----
if (pos < BEGV || pos >= ZV)
args_out_of_range_3 (position, make_number (BEGV), make_number (ZV));
pos_byte = CHAR_TO_BYTE (pos);
! if (NILP (ch))
! c = FETCH_CHAR (pos_byte);
! else
! {
! CHECK_NATNUM (ch);
! c = XINT (ch);
! }
if (! CHAR_VALID_P (c, 0))
return Qnil;
window = Fget_buffer_window (Fcurrent_buffer (), Qnil);
***************
*** 1184,1192 ****
face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, pos + 100, 0);
face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c);
face = FACE_FROM_ID (f, face_id);
! return (face->font && face->font_name
! ? build_string (face->font_name)
! : Qnil);
}
--- 1206,1228 ----
face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, pos + 100, 0);
face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c);
face = FACE_FROM_ID (f, face_id);
! if (! face->font || ! face->font_name)
! return Qnil;
!
! {
! struct font_info *fontp = (*get_font_info_func) (f, face->font_info_id);
! XChar2b char2b;
! int c1, c2, charset;
!
! SPLIT_CHAR (c, charset, c1, c2);
! if (c2 > 0)
! STORE_XCHAR2B (&char2b, c1, c2);
! else
! STORE_XCHAR2B (&char2b, 0, c1);
! rif->encode_char (c, &char2b, fontp, NULL);
! code = (XCHAR2B_BYTE1 (&char2b) << 8) | XCHAR2B_BYTE2 (&char2b);
! }
! return Fcons (build_string (face->font_name), make_number (code));
}