1 |
/* X Communication module for terminals which understand the X protocol. |
/* X Communication module for terminals which understand the X protocol. |
2 |
Copyright (C) 1989, 93, 94, 95, 96, 1997, 1998, 1999, 2000, 2001 |
Copyright (C) 1989, 93, 94, 95, 96, 1997, 1998, 1999, 2000, 2001, 2002 |
3 |
Free Software Foundation, Inc. |
Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of GNU Emacs. |
This file is part of GNU Emacs. |
1135 |
XChar2b *, |
XChar2b *, |
1136 |
int *)); |
int *)); |
1137 |
static struct face *x_get_char_face_and_encoding P_ ((struct frame *, int, |
static struct face *x_get_char_face_and_encoding P_ ((struct frame *, int, |
1138 |
int, XChar2b *, int)); |
int, XChar2b *, int, |
1139 |
|
int)); |
1140 |
static XCharStruct *x_per_char_metric P_ ((XFontStruct *, XChar2b *)); |
static XCharStruct *x_per_char_metric P_ ((XFontStruct *, XChar2b *)); |
1141 |
static void x_encode_char P_ ((int, XChar2b *, struct font_info *)); |
static void x_encode_char P_ ((int, XChar2b *, struct font_info *)); |
1142 |
static void x_append_glyph P_ ((struct it *)); |
static void x_append_glyph P_ ((struct it *)); |
1277 |
|
|
1278 |
/* Get face and two-byte form of character C in face FACE_ID on frame |
/* Get face and two-byte form of character C in face FACE_ID on frame |
1279 |
F. The encoding of C is returned in *CHAR2B. MULTIBYTE_P non-zero |
F. The encoding of C is returned in *CHAR2B. MULTIBYTE_P non-zero |
1280 |
means we want to display multibyte text. Value is a pointer to a |
means we want to display multibyte text. DISPLAY_P non-zero means |
1281 |
realized face that is ready for display. */ |
make sure that X resources for the face returned are allocated. |
1282 |
|
Value is a pointer to a realized face that is ready for display if |
1283 |
|
DISPLAY_P is non-zero. */ |
1284 |
|
|
1285 |
static INLINE struct face * |
static INLINE struct face * |
1286 |
x_get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p) |
x_get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p) |
1287 |
struct frame *f; |
struct frame *f; |
1288 |
int c, face_id; |
int c, face_id; |
1289 |
XChar2b *char2b; |
XChar2b *char2b; |
1290 |
int multibyte_p; |
int multibyte_p, display_p; |
1291 |
{ |
{ |
1292 |
struct face *face = FACE_FROM_ID (f, face_id); |
struct face *face = FACE_FROM_ID (f, face_id); |
1293 |
|
|
1329 |
} |
} |
1330 |
|
|
1331 |
/* Make sure X resources of the face are allocated. */ |
/* Make sure X resources of the face are allocated. */ |
1332 |
xassert (face != NULL); |
if (display_p) |
1333 |
PREPARE_FACE_FOR_DISPLAY (f, face); |
{ |
1334 |
|
xassert (face != NULL); |
1335 |
|
PREPARE_FACE_FOR_DISPLAY (f, face); |
1336 |
|
} |
1337 |
|
|
1338 |
return face; |
return face; |
1339 |
} |
} |
1844 |
/* Get font to use. Encode IT->char_to_display. */ |
/* Get font to use. Encode IT->char_to_display. */ |
1845 |
x_get_char_face_and_encoding (it->f, it->char_to_display, |
x_get_char_face_and_encoding (it->f, it->char_to_display, |
1846 |
it->face_id, &char2b, |
it->face_id, &char2b, |
1847 |
it->multibyte_p); |
it->multibyte_p, 0); |
1848 |
font = face->font; |
font = face->font; |
1849 |
|
|
1850 |
/* When no suitable font found, use the default font. */ |
/* When no suitable font found, use the default font. */ |
2076 |
it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display); |
it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display); |
2077 |
face = FACE_FROM_ID (it->f, it->face_id); |
face = FACE_FROM_ID (it->f, it->face_id); |
2078 |
x_get_char_face_and_encoding (it->f, it->char_to_display, |
x_get_char_face_and_encoding (it->f, it->char_to_display, |
2079 |
it->face_id, &char2b, it->multibyte_p); |
it->face_id, &char2b, it->multibyte_p, 0); |
2080 |
font = face->font; |
font = face->font; |
2081 |
|
|
2082 |
/* When no suitable font found, use the default font. */ |
/* When no suitable font found, use the default font. */ |
2164 |
|
|
2165 |
face = FACE_FROM_ID (it->f, face_id); |
face = FACE_FROM_ID (it->f, face_id); |
2166 |
x_get_char_face_and_encoding (it->f, ch, face->id, &char2b, |
x_get_char_face_and_encoding (it->f, ch, face->id, &char2b, |
2167 |
it->multibyte_p); |
it->multibyte_p, 0); |
2168 |
font = face->font; |
font = face->font; |
2169 |
if (font == NULL) |
if (font == NULL) |
2170 |
{ |
{ |
4964 |
int this_face_id = FACE_FOR_CHAR (XFRAME (w->frame), base_face, c); \ |
int this_face_id = FACE_FOR_CHAR (XFRAME (w->frame), base_face, c); \ |
4965 |
faces[n] = FACE_FROM_ID (XFRAME (w->frame), this_face_id); \ |
faces[n] = FACE_FROM_ID (XFRAME (w->frame), this_face_id); \ |
4966 |
x_get_char_face_and_encoding (XFRAME (w->frame), c, \ |
x_get_char_face_and_encoding (XFRAME (w->frame), c, \ |
4967 |
this_face_id, char2b + n, 1); \ |
this_face_id, char2b + n, 1, 1); \ |
4968 |
} \ |
} \ |
4969 |
\ |
\ |
4970 |
/* Make glyph_strings for each glyph sequence that is drawable by \ |
/* Make glyph_strings for each glyph sequence that is drawable by \ |