Permalink
Browse files

Upgraded code in juce_linux_Fonts

  • Loading branch information...
1 parent 281f549 commit b090e164232ce1ce19ccafb82a5d3491f275ca41 jsiegle committed Dec 13, 2012
@@ -145,10 +145,17 @@ class JUCE_API SystemStats
*/
static int getPageSize();
+ /** Returns an environment variable.
+ If the named value isn't set, this will return the defaultValue string instead.
+ */
+ static String getEnvironmentVariable (const String& name, const String& defaultValue);
+
//==============================================================================
// not-for-public-use platform-specific method gets called at startup to initialise things.
static void initialiseStats();
+
+
private:
struct CPUFlags
{
@@ -103,7 +103,7 @@ class LinuxFontFileIterator
{
const ScopedPointer<XmlElement> fontsInfo (XmlDocument::parse (File ("/etc/fonts/fonts.conf")));
- if (fontsInfo != nullptr)
+ if (fontsInfo != 0)
{
forEachXmlChildElementWithTagName (*fontsInfo, e, "dir")
{
@@ -113,10 +113,10 @@ class LinuxFontFileIterator
{
if (e->getStringAttribute ("prefix") == "xdg")
{
- String xdgDataHome (SystemStats::getEnvironmentVariable ("XDG_DATA_HOME", String::empty));
+ String xdgDataHome = "~/.local/share";//(SystemStats::getEnvironmentVariable ("XDG_DATA_HOME", String::empty));
- if (xdgDataHome.trimStart().isEmpty())
- xdgDataHome = "~/.local/share";
+ // if (xdgDataHome.trimStart().isEmpty())
+ // xdgDataHome = "~/.local/share";
fontPath = File (xdgDataHome).getChildFile (fontPath).getFullPathName();
}

0 comments on commit b090e16

Please sign in to comment.