return strdup (name);
}
-void
-mfont__free_realized (MRealizedFont *rfont)
-{
- MRealizedFont *next;
-
- for (; rfont; rfont = next)
- {
- next = rfont->next;
- M17N_OBJECT_UNREF (rfont->info);
- free (rfont);
- rfont = next;
- }
-}
-
-
/* Compare FONT with REQUEST and return how much they differs. */
-int
+static int
font_score (MFont *font, MFont *request)
{
int score = 0;
}
}
+void
+mfont__free_realized (MRealizedFont *rfont)
+{
+ MRealizedFont *next;
+
+ for (; rfont; rfont = next)
+ {
+ next = rfont->next;
+ M17N_OBJECT_UNREF (rfont->info);
+ free (rfont);
+ rfont = next;
+ }
+}
+
MFontList *
mfont__list (MFrame *frame, MFont *spec, MFont *request, int max_size)
{
#ifdef HAVE_FONTCONFIG
if (format == Mfontconfig || (! result && format == Mnil))
result = mfont__ft_parse_name (name, font);
-#endif
+#endif /* HAVE_FONTCONFIG */
return result;
}
MPlist *plist, *pl;
MFontList *font_list;
int i;
+ MFont *work = NULL;
if (language != Mnil)
{
char *buf = alloca (MSYMBOL_NAMELEN (language) + 7);
sprintf (buf, ":lang=%s", MSYMBOL_NAME (language));
+ if (! font)
+ font = work = mfont ();
font->capability = msymbol (buf);
}
font_list = mfont__list (frame, font, font, 0);
+ if (work)
+ free (work);
if (! font_list)
return NULL;
if (font_list->nfonts == 0)
/*=*/
/***en
- @brief Check if FONT can be used for SCRIPT and LANGUAGE in FONTSET.
+ @brief Check the usability of a font.
+
+ The function mfont_check () checkes if $FONT can be used for
+ $SCRIPT and RLANGUAGE in $FONTSET on $FRAME.
+
+ @return If the font is usable, return 1. Otherwise return 0.
*/
int