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