#include <fontconfig/fontconfig.h> int FcCacheNumFont (const FcCache *cache);
This returns the number of fonts which would be included in the return from FcCacheCopySet.