1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Linux font list parsing fix.

This commit is contained in:
jules 2012-10-28 11:13:18 +00:00
parent f84d57243b
commit c80bc652e9

View file

@ -89,7 +89,22 @@ public:
{
forEachXmlChildElementWithTagName (*fontsInfo, e, "dir")
{
fontDirs.add (e->getAllSubText().trim());
String fontPath (e->getAllSubText().trim());
if (fontPath.isNotEmpty())
{
if (e->getStringAttribute ("prefix") == "xdg")
{
String xdgDataHome (SystemStats::getEnvironmentVariable ("XDG_DATA_HOME", String::empty));
if (xdgDataHome.trimStart().isEmpty())
xdgDataHome = "~/.local/share";
fontPath = File (xdgDataHome).getChildFile (fontPath).getFullPathName();
}
fontDirs.add (fontPath);
}
}
}
}
@ -97,7 +112,7 @@ public:
if (fontDirs.size() == 0)
fontDirs.add ("/usr/X11R6/lib/X11/fonts");
fontDirs.removeEmptyStrings (true);
fontDirs.removeDuplicates (false);
}
bool next()