+
+/* Get a list of matching fonts on frame F.
+
+ FAMILY, if a string, specifies a font family derived from the fontset.
+ It is only used if the face does not specify any family in ATTRS or
+ if we cannot find any font of the face's family.
+
+ REGISTRY, if a string, specifies a font registry and encoding to
+ match. A value of nil means include fonts of any registry and
+ encoding.
+
+ Return in *FONTS a pointer to a vector of font_name structures for
+ the fonts matched. Value is the number of fonts found. */
+
+static int
+try_font_list (f, attrs, family, registry, fonts)
+ struct frame *f;
+ Lisp_Object *attrs;
+ Lisp_Object family, registry;
+ struct font_name **fonts;
+{
+ int nfonts = 0;
+ Lisp_Object face_family = attrs[LFACE_FAMILY_INDEX];
+
+ if (STRINGP (face_family))
+ nfonts = try_alternative_families (f, face_family, registry, fonts);
+
+ if (nfonts == 0 && !NILP (family))
+ nfonts = try_alternative_families (f, family, registry, fonts);
+
+ /* Try font family of the default face or "fixed". */
+ if (nfonts == 0)
+ {
+ struct face *default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
+ if (default_face)
+ family = default_face->lface[LFACE_FAMILY_INDEX];
+ else
+ family = build_string ("fixed");
+ nfonts = font_list (f, Qnil, family, registry, fonts);