// source: https://gist.github.com/take-cheeze/727091/57f27649d73aa0296407947b63c0018eac2a247b #include #include #include #include #include #include int main() { Display* d = XOpenDisplay(NULL); assert(d); int s = DefaultScreen(d); int fontListSize; char** fontList = XGetFontPath(d, &fontListSize); assert(fontList); std::copy( fontList, fontList + fontListSize, std::ostream_iterator(std::cout, "\n") ); XFreeFontPath(fontList); XCloseDisplay(d); return EXIT_SUCCESS; }