Do not assume fontconfig will find a font.
If you have no fonts in fontconfig, it returns NULL... believe me, it does happen. SVN revision: 36029
This commit is contained in:
parent
b85bedb940
commit
6c918f3d8a
|
@ -322,6 +322,11 @@ evas_font_load(Evas *evas, const char *name, const char *source, int size)
|
|||
|
||||
/* do matching */
|
||||
set = FcFontSort(NULL, p_nm, FcTrue, NULL, &res);
|
||||
if (!set)
|
||||
{
|
||||
fprintf(stderr, "ERROR: no fontconfig font matches '%s'. It was the last resource, no font found!\n", name);
|
||||
goto fc_end;
|
||||
}
|
||||
|
||||
/* Do loading for all in family */
|
||||
for (i = 0; i < set->nfont; i++)
|
||||
|
@ -337,6 +342,7 @@ evas_font_load(Evas *evas, const char *name, const char *source, int size)
|
|||
}
|
||||
|
||||
FcFontSetDestroy(set);
|
||||
fc_end:
|
||||
FcPatternDestroy(p_nm);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue