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:
parent
f84d57243b
commit
c80bc652e9
1 changed files with 17 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue