}
FcPattern *
-FcFreeTypeQuery(const FcChar8 *file,
- int id,
- FcBlanks *blanks,
- int *count)
+FcFreeTypeQuery (const FcChar8 *file,
+ int id,
+ FcBlanks *blanks,
+ int *count)
+{
+ return FcFreeTypeQuery2 (FcConfigGetCurrent (), file, id, blanks, count);
+}
+
+FcPattern *
+FcFreeTypeQuery2 (FcConfig *config,
+ const FcChar8 *file,
+ int id,
+ FcBlanks *blanks,
+ int *count)
{
FT_Face face;
FT_Library ftLibrary;
FcPattern *pat = NULL;
+ const FcChar8 *ftFile = file;
+ FcChar8 *fullFile;
if (FT_Init_FreeType (&ftLibrary))
return NULL;
- if (FT_New_Face (ftLibrary, (char *) file, id, &face))
+ fullFile = FcConfigGetRootPlus (config, file);
+ if (fullFile)
+ ftFile = fullFile;
+
+ if (FT_New_Face (ftLibrary, (char *) ftFile, id, &face))
goto bail;
*count = face->num_faces;
FT_Done_Face (face);
bail:
+ if (fullFile)
+ FcStrFree (fullFile);
FT_Done_FreeType (ftLibrary);
return pat;
}