From: Enlightenment S. <no-...@en...> - 2008-09-16 16:00:01
|
Author: barbieri Date: 2008-09-16 15:59:59 -0700 (Tue, 16 Sep 2008) New Revision: 36029 Log: Do not assume fontconfig will find a font. If you have no fonts in fontconfig, it returns NULL... believe me, it does happen. Modified: trunk/evas/src/lib/canvas/evas_font_dir.c Modified: trunk/evas/src/lib/canvas/evas_font_dir.c =================================================================== --- trunk/evas/src/lib/canvas/evas_font_dir.c 2008-09-16 21:11:38 UTC (rev 36028) +++ trunk/evas/src/lib/canvas/evas_font_dir.c 2008-09-16 22:59:59 UTC (rev 36029) @@ -322,6 +322,11 @@ /* 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 @@ } FcFontSetDestroy(set); + fc_end: FcPatternDestroy(p_nm); } #endif |