No fonts available on Intel Clear Linux


On Intel Clear Linux (freshly installed), juce applications can’t find any default font. The issue seems to be that JUCE can’t locate the fonts.conf file.

Adding /usr/share/defaults/fonts/fonts.conf in the search path fixes the issue:

static std::unique_ptr<XmlElement> findFontsConfFile()
    static const char* pathsToSearch[] = { "/etc/fonts/fonts.conf",

    for (auto* path : pathsToSearch)
        if (auto xml = parseXML (File (path)))
            return xml;

    return {};

(I don’t know if that is a good fix, or an ugly hack, tbh)