#include void FontConfigInit() { // Fonts location https://stackoverflow.com/a/2557291/213871 const char* fontconf = R"( /System/Library/Fonts )"; auto config = FcConfigCreate(); if (config == nullptr) throw runtime_error("Could not allocate font config"); if (!FcConfigParseAndLoadFromMemory(config, (FcChar8 *)fontconf, true)) { FcConfigDestroy(config); throw runtime_error("Could not parse font config"); } if (!FcConfigSetCurrent(config)) { FcConfigDestroy(config); throw runtime_error("Could not set current font config"); } }