-
-
Save khajavi/5425676 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// g++ font_path_list.cxx $(pkg-config x11 --libs --cflags) | |
#include <X11/Xlib.h> | |
#include <cassert> | |
#include <cstdlib> | |
#include <algorithm> | |
#include <iostream> | |
#include <iterator> | |
int main() | |
{ | |
Display* const d = XOpenDisplay(NULL); assert(d); | |
int const s = DefaultScreen(d); | |
int fontListSize; | |
char** const fontList = XGetFontPath(d, &fontListSize); assert(fontList); | |
std::copy( fontList, fontList + fontListSize, | |
std::ostream_iterator<char const*>(std::cout, "\n") ); | |
XFreeFontPath(fontList); | |
XCloseDisplay(d); | |
return EXIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment