#include <stdio.h>
#include <stdlib.h>
#include <fontconfig/fontconfig.h>

int
main(int argc, char **argv)
{
	FcPattern *pat = FcPatternCreate (), *match;
	FcValue v;
	FcResult result;
	static const char *emoji = "emoji";
	char *s;

	v.type = FcTypeString;
	v.u.s = argv[1];
	FcPatternAddWeak (pat, FC_FAMILY, v, FcTrue);
	FcPatternAddString (pat, FC_FAMILY, emoji);
	FcConfigSubstitute (NULL, pat, FcMatchPattern);
	FcDefaultSubstitute (pat);
	FcPatternDel (pat, FC_COLOR);
	match = FcFontMatch (NULL, pat, &result);
	s = FcPatternFormat (match, "%{file}: \"%{family}\"");
	printf ("%s\n", s);
	FcStrFree (s);

	return 0;
}

