321 |
|
|
322 |
#define FACE_CACHE_BUCKETS_SIZE 1001 |
#define FACE_CACHE_BUCKETS_SIZE 1001 |
323 |
|
|
|
/* A definition of XColor for non-X frames. */ |
|
|
|
|
|
#ifndef HAVE_X_WINDOWS |
|
|
|
|
|
typedef struct |
|
|
{ |
|
|
unsigned long pixel; |
|
|
unsigned short red, green, blue; |
|
|
char flags; |
|
|
char pad; |
|
|
} |
|
|
XColor; |
|
|
|
|
|
#endif /* not HAVE_X_WINDOWS */ |
|
|
|
|
324 |
/* Keyword symbols used for face attribute names. */ |
/* Keyword symbols used for face attribute names. */ |
325 |
|
|
326 |
Lisp_Object QCfamily, QCheight, QCweight, QCslant, QCunderline; |
Lisp_Object QCfamily, QCheight, QCweight, QCslant, QCunderline; |
517 |
Lisp_Object, struct font_name **)); |
Lisp_Object, struct font_name **)); |
518 |
static int font_list P_ ((struct frame *, Lisp_Object, Lisp_Object, |
static int font_list P_ ((struct frame *, Lisp_Object, Lisp_Object, |
519 |
Lisp_Object, struct font_name **)); |
Lisp_Object, struct font_name **)); |
520 |
static int try_font_list P_ ((struct frame *, Lisp_Object *, |
static int try_font_list P_ ((struct frame *, Lisp_Object *, |
521 |
Lisp_Object, Lisp_Object, struct font_name **)); |
Lisp_Object, Lisp_Object, struct font_name **)); |
522 |
static int try_alternative_families P_ ((struct frame *f, Lisp_Object, |
static int try_alternative_families P_ ((struct frame *f, Lisp_Object, |
523 |
Lisp_Object, struct font_name **)); |
Lisp_Object, struct font_name **)); |
965 |
|| ++clear_font_table_count == CLEAR_FONT_TABLE_COUNT) |
|| ++clear_font_table_count == CLEAR_FONT_TABLE_COUNT) |
966 |
{ |
{ |
967 |
struct x_display_info *dpyinfo; |
struct x_display_info *dpyinfo; |
968 |
|
|
969 |
/* Fonts are common for frames on one display, i.e. on |
/* Fonts are common for frames on one display, i.e. on |
970 |
one X screen. */ |
one X screen. */ |
971 |
for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next) |
for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next) |
972 |
if (dpyinfo->n_fonts > CLEAR_FONT_TABLE_NFONTS) |
if (dpyinfo->n_fonts > CLEAR_FONT_TABLE_NFONTS) |
973 |
clear_font_table (dpyinfo); |
clear_font_table (dpyinfo); |
974 |
|
|
975 |
/* From time to time see if we can unload some fonts. This also |
/* From time to time see if we can unload some fonts. This also |
976 |
frees all realized faces on all frames. Fonts needed by |
frees all realized faces on all frames. Fonts needed by |
977 |
faces will be loaded again when faces are realized again. */ |
faces will be loaded again when faces are realized again. */ |
2159 |
} |
} |
2160 |
else |
else |
2161 |
pixel = atoi (pixel_field); |
pixel = atoi (pixel_field); |
2162 |
|
|
2163 |
if (pixel == 0) |
if (pixel == 0) |
2164 |
real_pt = 0; |
real_pt = 0; |
2165 |
else |
else |
2227 |
{ |
{ |
2228 |
char *start, *end; |
char *start, *end; |
2229 |
int j; |
int j; |
2230 |
|
|
2231 |
for (++p; *p && *p != ']'; ++p) |
for (++p; *p && *p != ']'; ++p) |
2232 |
if (*p == '~') |
if (*p == '~') |
2233 |
*p = '-'; |
*p = '-'; |
2610 |
|
|
2611 |
If REGISTRY is non-nil, return fonts with that registry and the |
If REGISTRY is non-nil, return fonts with that registry and the |
2612 |
alternative registries from Vface_alternative_font_registry_alist. |
alternative registries from Vface_alternative_font_registry_alist. |
2613 |
|
|
2614 |
If REGISTRY is nil return fonts of any registry. |
If REGISTRY is nil return fonts of any registry. |
2615 |
|
|
2616 |
Set *FONTS to a vector of font_name structures allocated from the |
Set *FONTS to a vector of font_name structures allocated from the |
2624 |
struct font_name **fonts; |
struct font_name **fonts; |
2625 |
{ |
{ |
2626 |
int nfonts = font_list_1 (f, pattern, family, registry, fonts); |
int nfonts = font_list_1 (f, pattern, family, registry, fonts); |
2627 |
|
|
2628 |
if (!NILP (registry) |
if (!NILP (registry) |
2629 |
&& CONSP (Vface_alternative_font_registry_alist)) |
&& CONSP (Vface_alternative_font_registry_alist)) |
2630 |
{ |
{ |
3088 |
for (i = 1; i < LFACE_VECTOR_SIZE; ++i) |
for (i = 1; i < LFACE_VECTOR_SIZE; ++i) |
3089 |
if (i != LFACE_FONT_INDEX && i != LFACE_INHERIT_INDEX |
if (i != LFACE_FONT_INDEX && i != LFACE_INHERIT_INDEX |
3090 |
&& i != LFACE_AVGWIDTH_INDEX) |
&& i != LFACE_AVGWIDTH_INDEX) |
3091 |
if (UNSPECIFIEDP (attrs[i])) |
if (UNSPECIFIEDP (attrs[i])) |
3092 |
break; |
break; |
3093 |
|
|
3094 |
return i == LFACE_VECTOR_SIZE; |
return i == LFACE_VECTOR_SIZE; |
4216 |
{ |
{ |
4217 |
Lisp_Object font_name; |
Lisp_Object font_name; |
4218 |
char *font; |
char *font; |
4219 |
|
|
4220 |
if (STRINGP (LFACE_FONT (lface))) |
if (STRINGP (LFACE_FONT (lface))) |
4221 |
font_name = LFACE_FONT (lface); |
font_name = LFACE_FONT (lface); |
4222 |
else |
else |
4230 |
font_name = build_string (font); |
font_name = build_string (font); |
4231 |
xfree (font); |
xfree (font); |
4232 |
} |
} |
4233 |
|
|
4234 |
Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, font_name), Qnil)); |
Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, font_name), Qnil)); |
4235 |
} |
} |
4236 |
} |
} |
4424 |
#else |
#else |
4425 |
const char *popup_path = "menu.popup"; |
const char *popup_path = "menu.popup"; |
4426 |
#endif |
#endif |
4427 |
|
|
4428 |
if (STRINGP (LFACE_FOREGROUND (lface))) |
if (STRINGP (LFACE_FOREGROUND (lface))) |
4429 |
{ |
{ |
4430 |
sprintf (line, "%s.%s*foreground: %s", |
sprintf (line, "%s.%s*foreground: %s", |
4448 |
XrmPutLineResource (&rdb, line); |
XrmPutLineResource (&rdb, line); |
4449 |
changed_p = 1; |
changed_p = 1; |
4450 |
} |
} |
4451 |
|
|
4452 |
if (face->font_name |
if (face->font_name |
4453 |
&& (!UNSPECIFIEDP (LFACE_FAMILY (lface)) |
&& (!UNSPECIFIEDP (LFACE_FAMILY (lface)) |
4454 |
|| !UNSPECIFIEDP (LFACE_SWIDTH (lface)) |
|| !UNSPECIFIEDP (LFACE_SWIDTH (lface)) |
5872 |
REGISTRY, if a string, specifies a font registry and encoding to |
REGISTRY, if a string, specifies a font registry and encoding to |
5873 |
match. A value of nil means include fonts of any registry and |
match. A value of nil means include fonts of any registry and |
5874 |
encoding. |
encoding. |
5875 |
|
|
5876 |
Return in *FONTS a pointer to a vector of font_name structures for |
Return in *FONTS a pointer to a vector of font_name structures for |
5877 |
the fonts matched. Value is the number of fonts found. */ |
the fonts matched. Value is the number of fonts found. */ |
5878 |
|
|
5900 |
nfonts = font_list (f, Qnil, XCAR (alter), registry, fonts); |
nfonts = font_list (f, Qnil, XCAR (alter), registry, fonts); |
5901 |
} |
} |
5902 |
} |
} |
5903 |
|
|
5904 |
/* Try scalable fonts before giving up. */ |
/* Try scalable fonts before giving up. */ |
5905 |
if (nfonts == 0 && NILP (Vscalable_fonts_allowed)) |
if (nfonts == 0 && NILP (Vscalable_fonts_allowed)) |
5906 |
{ |
{ |
5923 |
REGISTRY, if a string, specifies a font registry and encoding to |
REGISTRY, if a string, specifies a font registry and encoding to |
5924 |
match. A value of nil means include fonts of any registry and |
match. A value of nil means include fonts of any registry and |
5925 |
encoding. |
encoding. |
5926 |
|
|
5927 |
Return in *FONTS a pointer to a vector of font_name structures for |
Return in *FONTS a pointer to a vector of font_name structures for |
5928 |
the fonts matched. Value is the number of fonts found. */ |
the fonts matched. Value is the number of fonts found. */ |
5929 |
|
|
5953 |
family = build_string ("fixed"); |
family = build_string ("fixed"); |
5954 |
nfonts = font_list (f, Qnil, family, registry, fonts); |
nfonts = font_list (f, Qnil, family, registry, fonts); |
5955 |
} |
} |
5956 |
|
|
5957 |
/* Try any family with the given registry. */ |
/* Try any family with the given registry. */ |
5958 |
if (nfonts == 0) |
if (nfonts == 0) |
5959 |
nfonts = font_list (f, Qnil, Qnil, registry, fonts); |
nfonts = font_list (f, Qnil, Qnil, registry, fonts); |
6007 |
xassert (!SINGLE_BYTE_CHAR_P (c)); |
xassert (!SINGLE_BYTE_CHAR_P (c)); |
6008 |
return NULL; |
return NULL; |
6009 |
} |
} |
6010 |
|
|
6011 |
/* If what we got is a name pattern, return it. */ |
/* If what we got is a name pattern, return it. */ |
6012 |
if (STRINGP (pattern)) |
if (STRINGP (pattern)) |
6013 |
return xstrdup (XSTRING (pattern)->data); |
return xstrdup (XSTRING (pattern)->data); |
6066 |
x_update_menu_appearance (f); |
x_update_menu_appearance (f); |
6067 |
#endif |
#endif |
6068 |
} |
} |
6069 |
|
|
6070 |
success_p = 1; |
success_p = 1; |
6071 |
} |
} |
6072 |
|
|
6520 |
pixel = default_pixel = FACE_TTY_DEFAULT_BG_COLOR; |
pixel = default_pixel = FACE_TTY_DEFAULT_BG_COLOR; |
6521 |
default_other_pixel = FACE_TTY_DEFAULT_FG_COLOR; |
default_other_pixel = FACE_TTY_DEFAULT_FG_COLOR; |
6522 |
} |
} |
6523 |
|
|
6524 |
XSETFRAME (frame, f); |
XSETFRAME (frame, f); |
6525 |
color = face->lface[idx]; |
color = face->lface[idx]; |
6526 |
|
|
6527 |
if (STRINGP (color) |
if (STRINGP (color) |
6528 |
&& XSTRING (color)->size |
&& XSTRING (color)->size |
6529 |
&& CONSP (Vtty_defined_color_alist) |
&& CONSP (Vtty_defined_color_alist) |
6618 |
/* Map color names to color indices. */ |
/* Map color names to color indices. */ |
6619 |
map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted); |
map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted); |
6620 |
map_tty_color (f, face, LFACE_BACKGROUND_INDEX, &face_colors_defaulted); |
map_tty_color (f, face, LFACE_BACKGROUND_INDEX, &face_colors_defaulted); |
6621 |
|
|
6622 |
/* Swap colors if face is inverse-video. If the colors are taken |
/* Swap colors if face is inverse-video. If the colors are taken |
6623 |
from the frame colors, they are already inverted, since the |
from the frame colors, they are already inverted, since the |
6624 |
frame-creation function calls x-handle-reverse-video. */ |
frame-creation function calls x-handle-reverse-video. */ |