(Vface_ignored_fonts): New variable.

(x_face_list_fonts): Ignore fonts matching Vface_ignored_fonts.
(syms_of_xfaces): Declare Vface_ignored_fonts as a Lisp variable.
This commit is contained in:
Kenichi Handa 2000-12-16 01:15:05 +00:00
parent 5f3828e1e2
commit c824bfbc8d

View file

@ -156,10 +156,17 @@ Boston, MA 02111-1307, USA. */
width---tries to find a best match for the specified font height,
etc.
2. Setting face-alternative-font-family-alist allows the user to
2. Setting face-font-family-alternatives allows the user to
specify alternative font families to try if a family specified by a
face doesn't exist.
3. Setting face-font-registry-alternatives allows the user to
specify all alternative font registries to try for a face
specifying a registry.
4. Setting face-ignored-fonts allows the user to ignore specific
fonts.
Character compositition.
@ -389,6 +396,10 @@ Lisp_Object Vface_alternative_font_registry_alist;
Lisp_Object Vscalable_fonts_allowed;
/* List of regular expressions that matches names of fonts to ignore. */
Lisp_Object Vface_ignored_fonts;
/* Maximum number of fonts to consider in font_list. If not an
integer > 0, DEFAULT_FONT_LIST_LIMIT is used instead. */
@ -2334,6 +2345,18 @@ x_face_list_fonts (f, pattern, fonts, nfonts, try_alternatives_p,
split them into fields. */
for (i = j = 0; i < n; ++i)
{
Lisp_Object elt, tail;
for (tail = Vface_ignored_fonts; CONSP (tail); tail = XCDR (tail))
{
elt = XCAR (tail);
if (STRINGP (elt)
&& fast_c_string_match_ignore_case (elt, names[i]) >= 0)
break;
}
if (!NILP (tail))
continue;
/* Make a copy of the font name. */
fonts[j].name = xstrdup (names[i]);
@ -7255,6 +7278,11 @@ scaled if its name matches a regular expression in the list.");
Vscalable_fonts_allowed = Qnil;
#endif
DEFVAR_LISP ("face-ignored-fonts", &Vface_ignored_fonts,
"List of ignored fonts.\n\
Each element is a regular expression that matches names of fonts to ignore.");
Vface_ignored_fonts = Qnil;
#ifdef HAVE_WINDOW_SYSTEM
defsubr (&Sbitmap_spec_p);
defsubr (&Sx_list_fonts);