494 |
Lisp_Object, struct font_name **)); |
Lisp_Object, struct font_name **)); |
495 |
static int font_list P_ ((struct frame *, Lisp_Object, Lisp_Object, |
static int font_list P_ ((struct frame *, Lisp_Object, Lisp_Object, |
496 |
Lisp_Object, struct font_name **)); |
Lisp_Object, struct font_name **)); |
497 |
static int try_font_list P_ ((struct frame *, Lisp_Object *, |
static int try_font_list P_ ((struct frame *, Lisp_Object *, |
498 |
Lisp_Object, Lisp_Object, struct font_name **, |
Lisp_Object, Lisp_Object, struct font_name **, |
499 |
int)); |
int)); |
500 |
static int try_alternative_families P_ ((struct frame *f, Lisp_Object, |
static int try_alternative_families P_ ((struct frame *f, Lisp_Object, |
974 |
|| ++clear_font_table_count == CLEAR_FONT_TABLE_COUNT) |
|| ++clear_font_table_count == CLEAR_FONT_TABLE_COUNT) |
975 |
{ |
{ |
976 |
struct x_display_info *dpyinfo; |
struct x_display_info *dpyinfo; |
977 |
|
|
978 |
/* Fonts are common for frames on one display, i.e. on |
/* Fonts are common for frames on one display, i.e. on |
979 |
one X screen. */ |
one X screen. */ |
980 |
for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next) |
for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next) |
981 |
if (dpyinfo->n_fonts > CLEAR_FONT_TABLE_NFONTS) |
if (dpyinfo->n_fonts > CLEAR_FONT_TABLE_NFONTS) |
982 |
clear_font_table (dpyinfo); |
clear_font_table (dpyinfo); |
983 |
|
|
984 |
/* 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 |
985 |
frees all realized faces on all frames. Fonts needed by |
frees all realized faces on all frames. Fonts needed by |
986 |
faces will be loaded again when faces are realized again. */ |
faces will be loaded again when faces are realized again. */ |
1401 |
int status = 1; |
int status = 1; |
1402 |
|
|
1403 |
/* Defaults. */ |
/* Defaults. */ |
1404 |
color_def->pixel = FACE_TTY_DEFAULT_COLOR; |
color_def->pixel = FACE_TTY_DEFAULT_COLOR; |
1405 |
color_def->red = 0; |
color_def->red = 0; |
1406 |
color_def->blue = 0; |
color_def->blue = 0; |
1407 |
color_def->green = 0; |
color_def->green = 0; |
2238 |
} |
} |
2239 |
else |
else |
2240 |
pixel = atoi (pixel_field); |
pixel = atoi (pixel_field); |
2241 |
|
|
2242 |
if (pixel == 0) |
if (pixel == 0) |
2243 |
real_pt = 0; |
real_pt = 0; |
2244 |
else |
else |
2306 |
{ |
{ |
2307 |
char *start, *end; |
char *start, *end; |
2308 |
int j; |
int j; |
2309 |
|
|
2310 |
for (++p; *p && *p != ']'; ++p) |
for (++p; *p && *p != ']'; ++p) |
2311 |
if (*p == '~') |
if (*p == '~') |
2312 |
*p = '-'; |
*p = '-'; |
2689 |
|
|
2690 |
If REGISTRY is non-nil, return fonts with that registry and the |
If REGISTRY is non-nil, return fonts with that registry and the |
2691 |
alternative registries from Vface_alternative_font_registry_alist. |
alternative registries from Vface_alternative_font_registry_alist. |
2692 |
|
|
2693 |
If REGISTRY is nil return fonts of any registry. |
If REGISTRY is nil return fonts of any registry. |
2694 |
|
|
2695 |
Set *FONTS to a vector of font_name structures allocated from the |
Set *FONTS to a vector of font_name structures allocated from the |
2703 |
struct font_name **fonts; |
struct font_name **fonts; |
2704 |
{ |
{ |
2705 |
int nfonts = font_list_1 (f, pattern, family, registry, fonts); |
int nfonts = font_list_1 (f, pattern, family, registry, fonts); |
2706 |
|
|
2707 |
if (!NILP (registry) |
if (!NILP (registry) |
2708 |
&& CONSP (Vface_alternative_font_registry_alist)) |
&& CONSP (Vface_alternative_font_registry_alist)) |
2709 |
{ |
{ |
3167 |
for (i = 1; i < LFACE_VECTOR_SIZE; ++i) |
for (i = 1; i < LFACE_VECTOR_SIZE; ++i) |
3168 |
if (i != LFACE_FONT_INDEX && i != LFACE_INHERIT_INDEX |
if (i != LFACE_FONT_INDEX && i != LFACE_INHERIT_INDEX |
3169 |
&& i != LFACE_AVGWIDTH_INDEX) |
&& i != LFACE_AVGWIDTH_INDEX) |
3170 |
if (UNSPECIFIEDP (attrs[i])) |
if (UNSPECIFIEDP (attrs[i])) |
3171 |
break; |
break; |
3172 |
|
|
3173 |
return i == LFACE_VECTOR_SIZE; |
return i == LFACE_VECTOR_SIZE; |
4308 |
{ |
{ |
4309 |
Lisp_Object font_name; |
Lisp_Object font_name; |
4310 |
char *font; |
char *font; |
4311 |
|
|
4312 |
if (STRINGP (LFACE_FONT (lface))) |
if (STRINGP (LFACE_FONT (lface))) |
4313 |
font_name = LFACE_FONT (lface); |
font_name = LFACE_FONT (lface); |
4314 |
else |
else |
4322 |
font_name = build_string (font); |
font_name = build_string (font); |
4323 |
xfree (font); |
xfree (font); |
4324 |
} |
} |
4325 |
|
|
4326 |
Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, font_name), Qnil)); |
Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, font_name), Qnil)); |
4327 |
} |
} |
4328 |
} |
} |
4524 |
#else |
#else |
4525 |
const char *popup_path = "menu.popup"; |
const char *popup_path = "menu.popup"; |
4526 |
#endif |
#endif |
4527 |
|
|
4528 |
if (STRINGP (LFACE_FOREGROUND (lface))) |
if (STRINGP (LFACE_FOREGROUND (lface))) |
4529 |
{ |
{ |
4530 |
sprintf (line, "%s.%s*foreground: %s", |
sprintf (line, "%s.%s*foreground: %s", |
4548 |
XrmPutLineResource (&rdb, line); |
XrmPutLineResource (&rdb, line); |
4549 |
changed_p = 1; |
changed_p = 1; |
4550 |
} |
} |
4551 |
|
|
4552 |
if (face->font_name |
if (face->font_name |
4553 |
&& (!UNSPECIFIEDP (LFACE_FAMILY (lface)) |
&& (!UNSPECIFIEDP (LFACE_FAMILY (lface)) |
4554 |
|| !UNSPECIFIEDP (LFACE_SWIDTH (lface)) |
|| !UNSPECIFIEDP (LFACE_SWIDTH (lface)) |
4579 |
#endif /* HAVE_X_WINDOWS && USE_X_TOOLKIT */ |
#endif /* HAVE_X_WINDOWS && USE_X_TOOLKIT */ |
4580 |
|
|
4581 |
|
|
4582 |
DEFUN ("face-attribute-relative-p", Fface_attribute_relative_p, |
DEFUN ("face-attribute-relative-p", Fface_attribute_relative_p, |
4583 |
Sface_attribute_relative_p, |
Sface_attribute_relative_p, |
4584 |
2, 2, 0, |
2, 2, 0, |
4585 |
doc: /* Return non-nil if face ATTRIBUTE VALUE is relative. */) |
doc: /* Return non-nil if face ATTRIBUTE VALUE is relative. */) |
5252 |
else if (weight < XLFD_WEIGHT_MEDIUM) |
else if (weight < XLFD_WEIGHT_MEDIUM) |
5253 |
test_caps = TTY_CAP_DIM; |
test_caps = TTY_CAP_DIM; |
5254 |
} |
} |
5255 |
|
|
5256 |
/* underlining */ |
/* underlining */ |
5257 |
val = attrs[LFACE_UNDERLINE_INDEX]; |
val = attrs[LFACE_UNDERLINE_INDEX]; |
5258 |
if (!UNSPECIFIEDP (val) && !NILP (val)) |
if (!UNSPECIFIEDP (val) && !NILP (val)) |
6286 |
REGISTRY, if a string, specifies a font registry and encoding to |
REGISTRY, if a string, specifies a font registry and encoding to |
6287 |
match. A value of nil means include fonts of any registry and |
match. A value of nil means include fonts of any registry and |
6288 |
encoding. |
encoding. |
6289 |
|
|
6290 |
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 |
6291 |
the fonts matched. Value is the number of fonts found. */ |
the fonts matched. Value is the number of fonts found. */ |
6292 |
|
|
6314 |
nfonts = font_list (f, Qnil, XCAR (alter), registry, fonts); |
nfonts = font_list (f, Qnil, XCAR (alter), registry, fonts); |
6315 |
} |
} |
6316 |
} |
} |
6317 |
|
|
6318 |
/* Try scalable fonts before giving up. */ |
/* Try scalable fonts before giving up. */ |
6319 |
if (nfonts == 0 && NILP (Vscalable_fonts_allowed)) |
if (nfonts == 0 && NILP (Vscalable_fonts_allowed)) |
6320 |
{ |
{ |
6337 |
REGISTRY, if a string, specifies a font registry and encoding to |
REGISTRY, if a string, specifies a font registry and encoding to |
6338 |
match. A value of nil means include fonts of any registry and |
match. A value of nil means include fonts of any registry and |
6339 |
encoding. |
encoding. |
6340 |
|
|
6341 |
If PREFER_FACE_FAMILY is nonzero, perfer face's family to FAMILY. |
If PREFER_FACE_FAMILY is nonzero, perfer face's family to FAMILY. |
6342 |
Otherwise, prefer FAMILY. |
Otherwise, prefer FAMILY. |
6343 |
|
|
6388 |
family = build_string ("fixed"); |
family = build_string ("fixed"); |
6389 |
nfonts = font_list (f, Qnil, family, registry, fonts); |
nfonts = font_list (f, Qnil, family, registry, fonts); |
6390 |
} |
} |
6391 |
|
|
6392 |
/* Try any family with the given registry. */ |
/* Try any family with the given registry. */ |
6393 |
if (nfonts == 0) |
if (nfonts == 0) |
6394 |
nfonts = font_list (f, Qnil, Qnil, registry, fonts); |
nfonts = font_list (f, Qnil, Qnil, registry, fonts); |
6447 |
xassert (!SINGLE_BYTE_CHAR_P (c)); |
xassert (!SINGLE_BYTE_CHAR_P (c)); |
6448 |
return NULL; |
return NULL; |
6449 |
} |
} |
6450 |
|
|
6451 |
/* If what we got is a name pattern, return it. */ |
/* If what we got is a name pattern, return it. */ |
6452 |
if (STRINGP (pattern)) |
if (STRINGP (pattern)) |
6453 |
return xstrdup (SDATA (pattern)); |
return xstrdup (SDATA (pattern)); |
6510 |
x_update_menu_appearance (f); |
x_update_menu_appearance (f); |
6511 |
#endif |
#endif |
6512 |
} |
} |
6513 |
|
|
6514 |
success_p = 1; |
success_p = 1; |
6515 |
} |
} |
6516 |
|
|
6954 |
pixel = default_pixel = FACE_TTY_DEFAULT_BG_COLOR; |
pixel = default_pixel = FACE_TTY_DEFAULT_BG_COLOR; |
6955 |
default_other_pixel = FACE_TTY_DEFAULT_FG_COLOR; |
default_other_pixel = FACE_TTY_DEFAULT_FG_COLOR; |
6956 |
} |
} |
6957 |
|
|
6958 |
XSETFRAME (frame, f); |
XSETFRAME (frame, f); |
6959 |
color = face->lface[idx]; |
color = face->lface[idx]; |
6960 |
|
|
6961 |
if (STRINGP (color) |
if (STRINGP (color) |
6962 |
&& SCHARS (color) |
&& SCHARS (color) |
6963 |
&& CONSP (Vtty_defined_color_alist) |
&& CONSP (Vtty_defined_color_alist) |
7052 |
/* Map color names to color indices. */ |
/* Map color names to color indices. */ |
7053 |
map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted); |
map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted); |
7054 |
map_tty_color (f, face, LFACE_BACKGROUND_INDEX, &face_colors_defaulted); |
map_tty_color (f, face, LFACE_BACKGROUND_INDEX, &face_colors_defaulted); |
7055 |
|
|
7056 |
/* Swap colors if face is inverse-video. If the colors are taken |
/* Swap colors if face is inverse-video. If the colors are taken |
7057 |
from the frame colors, they are already inverted, since the |
from the frame colors, they are already inverted, since the |
7058 |
frame-creation function calls x-handle-reverse-video. */ |
frame-creation function calls x-handle-reverse-video. */ |