int j;
font_patterns = FcFontSort (0, pat, all ? FcFalse : FcTrue, 0, &result);
+ if (!font_patterns || font_patterns->nfont == 0)
+ {
+ fputs("No fonts installed on the system\n", stderr);
+ return 1;
+ }
for (j = 0; j < font_patterns->nfont; j++)
{
FcPattern *font_pattern;
*/
#include "fcint.h"
+#include <assert.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
FcValue v;
FcResult result;
+ assert (pat != NULL);
+ assert (font != NULL);
+
new = FcPatternCreate ();
if (!new)
return 0;
{
FcPattern *best;
+ assert (sets != NULL);
+ assert (p != NULL);
+ assert (result != NULL);
+
if (!config)
{
config = FcConfigGetCurrent ();
int nsets;
FcPattern *best;
+ assert (p != NULL);
+ assert (result != NULL);
+
if (!config)
{
config = FcConfigGetCurrent ();
FcBool *patternLangSat;
FcValue patternLang;
+ assert (sets != NULL);
+ assert (p != NULL);
+ assert (result != NULL);
+
+ /* There are some implementation that relying on the result of
+ * "result" to check if the return value of FcFontSetSort
+ * is valid or not.
+ * So we should initialize it to the conservative way since
+ * this function doesn't return NULL anymore.
+ */
+ if (result)
+ *result = FcResultNoMatch;
+
if (FcDebug () & FC_DBG_MATCH)
{
printf ("Sort ");
nnodes += s->nfont;
}
if (!nnodes)
- goto bail0;
+ return FcFontSetCreate ();
for (nPatternLang = 0;
FcPatternGet (p, FC_LANG, nPatternLang, &patternLang) == FcResultMatch;
FcFontSet *sets[2];
int nsets;
+ assert (p != NULL);
+ assert (result != NULL);
+
if (!config)
{
config = FcConfigGetCurrent ();