aboutsummaryrefslogtreecommitdiffstats
path: root/src/fontset.c
diff options
context:
space:
mode:
authorKaroly Lorentey2004-04-23 14:44:11 +0000
committerKaroly Lorentey2004-04-23 14:44:11 +0000
commitced7ed5611e2a6e60a5ac7a97e165545843d0fa9 (patch)
tree85194b67c680d1a37af652a4b614a7e1fcd336ba /src/fontset.c
parent6ad9aaa961f1ac376bdaa1a5516d0481e6c7fafa (diff)
parentf24814e0e9806db8d01c16b8d8592d6e9b9ee481 (diff)
downloademacs-ced7ed5611e2a6e60a5ac7a97e165545843d0fa9.tar.gz
emacs-ced7ed5611e2a6e60a5ac7a97e165545843d0fa9.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-230 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-231 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-232 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-233 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-234 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-235 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-236 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-237 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-238 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-239 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-240 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-152
Diffstat (limited to 'src/fontset.c')
-rw-r--r--src/fontset.c59
1 files changed, 37 insertions, 22 deletions
diff --git a/src/fontset.c b/src/fontset.c
index ad9dd3ccd2f..aae6b9296ae 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -195,7 +195,7 @@ static Lisp_Object make_fontset P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
195static int fontset_id_valid_p P_ ((int)); 195static int fontset_id_valid_p P_ ((int));
196static Lisp_Object fontset_pattern_regexp P_ ((Lisp_Object)); 196static Lisp_Object fontset_pattern_regexp P_ ((Lisp_Object));
197static Lisp_Object font_family_registry P_ ((Lisp_Object, int)); 197static Lisp_Object font_family_registry P_ ((Lisp_Object, int));
198static Lisp_Object regulalize_fontname P_ ((Lisp_Object)); 198static Lisp_Object regularize_fontname P_ ((Lisp_Object));
199 199
200 200
201/********** MACROS AND FUNCTIONS TO HANDLE FONTSET **********/ 201/********** MACROS AND FUNCTIONS TO HANDLE FONTSET **********/
@@ -1043,7 +1043,7 @@ check_fontset_name (name)
1043 string, maybe change FONTNAME to (FAMILY . REGISTRY). */ 1043 string, maybe change FONTNAME to (FAMILY . REGISTRY). */
1044 1044
1045static Lisp_Object 1045static Lisp_Object
1046regulalize_fontname (Lisp_Object fontname) 1046regularize_fontname (Lisp_Object fontname)
1047{ 1047{
1048 Lisp_Object family, registry; 1048 Lisp_Object family, registry;
1049 1049
@@ -1133,7 +1133,7 @@ name of a font, REGISTRY is a registry name of a font. */)
1133 if (!NILP (frame)) 1133 if (!NILP (frame))
1134 CHECK_LIVE_FRAME (frame); 1134 CHECK_LIVE_FRAME (frame);
1135 1135
1136 elt = Fcons (make_number (from), regulalize_fontname (fontname)); 1136 elt = Fcons (make_number (from), regularize_fontname (fontname));
1137 for (; from <= to; from++) 1137 for (; from <= to; from++)
1138 FONTSET_SET (fontset, from, elt); 1138 FONTSET_SET (fontset, from, elt);
1139 Foptimize_char_table (fontset); 1139 Foptimize_char_table (fontset);
@@ -1212,7 +1212,10 @@ If the named font is not yet loaded, return nil. */)
1212/* Return a cons (FONT-NAME . GLYPH-CODE). 1212/* Return a cons (FONT-NAME . GLYPH-CODE).
1213 FONT-NAME is the font name for the character at POSITION in the current 1213 FONT-NAME is the font name for the character at POSITION in the current
1214 buffer. This is computed from all the text properties and overlays 1214 buffer. This is computed from all the text properties and overlays
1215 that apply to POSITION. 1215 that apply to POSITION. POSTION may be nil, in which case,
1216 FONT-NAME is the font name for display the character CH with the
1217 default face.
1218
1216 GLYPH-CODE is the glyph code in the font to use for the character. 1219 GLYPH-CODE is the glyph code in the font to use for the character.
1217 1220
1218 If the 2nd optional arg CH is non-nil, it is a character to check 1221 If the 2nd optional arg CH is non-nil, it is a character to check
@@ -1225,7 +1228,8 @@ If the named font is not yet loaded, return nil. */)
1225 1228
1226 (2) The character code is invalid. 1229 (2) The character code is invalid.
1227 1230
1228 (3) The current buffer is not displayed in any window. 1231 (3) If POSITION is not nil, and the current buffer is not displayed
1232 in any window.
1229 1233
1230 In addition, the returned font name may not take into account of 1234 In addition, the returned font name may not take into account of
1231 such redisplay engine hooks as what used in jit-lock-mode if 1235 such redisplay engine hooks as what used in jit-lock-mode if
@@ -1240,31 +1244,42 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
1240 int pos, pos_byte, dummy; 1244 int pos, pos_byte, dummy;
1241 int face_id; 1245 int face_id;
1242 int c, code; 1246 int c, code;
1243 Lisp_Object window;
1244 struct window *w;
1245 struct frame *f; 1247 struct frame *f;
1246 struct face *face; 1248 struct face *face;
1247 1249
1248 CHECK_NUMBER_COERCE_MARKER (position); 1250 if (NILP (position))
1249 pos = XINT (position);
1250 if (pos < BEGV || pos >= ZV)
1251 args_out_of_range_3 (position, make_number (BEGV), make_number (ZV));
1252 pos_byte = CHAR_TO_BYTE (pos);
1253 if (NILP (ch))
1254 c = FETCH_CHAR (pos_byte);
1255 else
1256 { 1251 {
1257 CHECK_NATNUM (ch); 1252 CHECK_NATNUM (ch);
1258 c = XINT (ch); 1253 c = XINT (ch);
1254 f = XFRAME (selected_frame);
1255 face_id = DEFAULT_FACE_ID;
1256 }
1257 else
1258 {
1259 Lisp_Object window;
1260 struct window *w;
1261
1262 CHECK_NUMBER_COERCE_MARKER (position);
1263 pos = XINT (position);
1264 if (pos < BEGV || pos >= ZV)
1265 args_out_of_range_3 (position, make_number (BEGV), make_number (ZV));
1266 pos_byte = CHAR_TO_BYTE (pos);
1267 if (NILP (ch))
1268 c = FETCH_CHAR (pos_byte);
1269 else
1270 {
1271 CHECK_NATNUM (ch);
1272 c = XINT (ch);
1273 }
1274 window = Fget_buffer_window (Fcurrent_buffer (), Qnil);
1275 if (NILP (window))
1276 return Qnil;
1277 w = XWINDOW (window);
1278 f = XFRAME (w->frame);
1279 face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, pos + 100, 0);
1259 } 1280 }
1260 if (! CHAR_VALID_P (c, 0)) 1281 if (! CHAR_VALID_P (c, 0))
1261 return Qnil; 1282 return Qnil;
1262 window = Fget_buffer_window (Fcurrent_buffer (), Qnil);
1263 if (NILP (window))
1264 return Qnil;
1265 w = XWINDOW (window);
1266 f = XFRAME (w->frame);
1267 face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, pos + 100, 0);
1268 face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c); 1283 face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c);
1269 face = FACE_FROM_ID (f, face_id); 1284 face = FACE_FROM_ID (f, face_id);
1270 if (! face->font || ! face->font_name) 1285 if (! face->font || ! face->font_name)
@@ -1540,7 +1555,7 @@ It is intended that this function is called only from
1540 1555
1541 elt = XCAR (tail); 1556 elt = XCAR (tail);
1542 target = Fcar (elt); 1557 target = Fcar (elt);
1543 elt = Fcons (Qnil, regulalize_fontname (Fcdr (elt))); 1558 elt = Fcons (Qnil, regularize_fontname (Fcdr (elt)));
1544 if (! CHAR_TABLE_P (target)) 1559 if (! CHAR_TABLE_P (target))
1545 { 1560 {
1546 int charset, c; 1561 int charset, c;