} while (0)
-static MPlist *ft_list_family (MSymbol, int);
+static MPlist *ft_list_family (MSymbol, int, int);
static void
free_ft_rfont (void *object)
file = msymbol (filename);
if (family != last_family)
{
- pl = MPLIST_PLIST (ft_list_family (family, 0));
+ pl = MPLIST_PLIST (ft_list_family (family, 0, 1));
last_family = family;
}
ft_info = mplist_get (pl, file);
MPlist *plist = NULL, *pl, *p;
if (! ft_font_list)
- ft_list_family (Mnil, 0);
+ ft_list_family (Mnil, 0, 1);
if (mt)
{
scan all fonts and return ft_font_list. */
static MPlist *
-ft_list_family (MSymbol family, int check_generic)
+ft_list_family (MSymbol family, int check_generic, int check_alias)
{
MPlist *plist;
#ifdef HAVE_FONTCONFIG
MPLIST_DO (plist, ft_font_list)
{
if (! MPLIST_VAL (plist))
- ft_list_family (MPLIST_KEY (plist), 0);
+ ft_list_family (MPLIST_KEY (plist), 0, 1);
}
all_fonts_scaned = 1;
}
FcChar8 *fam8;
if (family != generic)
- plist = ft_list_family (generic, 1);
+ plist = ft_list_family (generic, 1, 1);
else
{
fam = MSYMBOL_NAME (family);
family = msymbol (buf);
if (msymbol_get (family, Mgeneric_family))
break;
- pl = ft_list_family (family, 0);
+ pl = ft_list_family (family, 0, 1);
if (! pl)
continue;
MPLIST_DO (pl, MPLIST_PLIST (pl))
plist = ft_font_list;
}
}
- else
+ else if (check_alias)
{
/* Check if there exist an alias. */
pl = mplist ();
FcPatternGetString (pattern, FC_FAMILY, i, (FcChar8 **) &fam);
STRDUP_LOWER (buf, bufsize, fam);
sym = msymbol (buf);
- p = MPLIST_PLIST (ft_list_family (sym, 0));
+ p = MPLIST_PLIST (ft_list_family (sym, 0, 0));
if (! MPLIST_TAIL_P (p))
MPLIST_DO (p, p)
mplist_push (pl, Mt, MPLIST_VAL (p));
}
}
}
+ else
+ {
+ pl = mplist ();
+ plist = mplist_add (ft_font_list, family, pl);
+ }
#else /* not HAVE_FONTCONFIG */
family = msymbol (buf);
if (msymbol_get (family, Mgeneric_family))
continue;
- plist = MPLIST_PLIST (ft_list_family (family, 0));
+ plist = MPLIST_PLIST (ft_list_family (family, 0, 1));
MPLIST_DO (plist, plist)
mplist_add (ft_default_list, family, MPLIST_VAL (plist));
}
{
MPlist *plist, *pl;
- MPLIST_DO (plist, ft_list_family (Mnil, 0))
+ MPLIST_DO (plist, ft_list_family (Mnil, 0, 1))
{
pl = MPLIST_PLIST (plist);
if (! MPLIST_TAIL_P (pl))
STRDUP_LOWER (buf, bufsize, fam);
family = msymbol (buf);
- pl = ft_list_family (family, 0);
+ pl = ft_list_family (family, 0, 1);
MPLIST_DO (pl, MPLIST_PLIST (pl))
{
MFontFT *ft_info = MPLIST_VAL (pl);
{
MPlist *pl, *p;
- MPLIST_DO (pl, ft_list_family (Mnil, 0))
+ MPLIST_DO (pl, ft_list_family (Mnil, 0, 1))
{
MPLIST_DO (p, MPLIST_PLIST (pl))
{
MSymbol family = FONT_PROPERTY (font, MFONT_FAMILY);
if (family)
- plist = MPLIST_PLIST (ft_list_family (family, 1));
+ plist = MPLIST_PLIST (ft_list_family (family, 1, 1));
else
plist = ft_list_default ();
if (MPLIST_TAIL_P (plist))
goto done;
family = FONT_PROPERTY (font, MFONT_FAMILY);
if (family != Mnil
- && (family_list = MPLIST_PLIST (ft_list_family (family, 1)))
+ && (family_list = MPLIST_PLIST (ft_list_family (family, 1, 1)))
&& MPLIST_TAIL_P (family_list))
goto done;
if (font->capability != Mnil)
{
/* No restriction. Get all fonts. */
pl = mplist ();
- MPLIST_DO (family_list, ft_list_family (Mnil, 0))
+ MPLIST_DO (family_list, ft_list_family (Mnil, 0, 1))
{
MPLIST_DO (p, MPLIST_PLIST (family_list))
mplist_push (pl, MPLIST_KEY (p), MPLIST_VAL (p));