+
+ }
+#endif
+
+#ifdef WITH_FONTCONFIG
+ if(error)
+ {
+ FcFontSet *fs;
+ FcResult result;
+ if( !FcInit() )
+ {
+ synfig::warning("Layer_Freetype: fontconfig: %s",_("unable to initialize"));
+ error = 1;
+ } else {
+ FcPattern* pat = FcNameParse((FcChar8 *) newfont.c_str());
+ FcConfigSubstitute(0, pat, FcMatchPattern);
+ FcDefaultSubstitute(pat);
+ FcPattern *match;
+ fs = FcFontSetCreate();
+ match = FcFontMatch(0, pat, &result);
+ if (match)
+ FcFontSetAdd(fs, match);
+ if (pat)
+ FcPatternDestroy(pat);
+ if(fs){
+ FcChar8* file;
+ if( FcPatternGetString (fs->fonts[0], FC_FILE, 0, &file) == FcResultMatch )
+ error=FT_New_Face(ft_library,(const char*)file,face_index,&face);
+ FcFontSetDestroy(fs);
+ } else
+ synfig::warning("Layer_Freetype: fontconfig: %s",_("empty font set"));
+ }