diff --git a/modules/juce_graphics/native/juce_linux_Fonts.cpp b/modules/juce_graphics/native/juce_linux_Fonts.cpp index 5a7ceda903..47c0860997 100644 --- a/modules/juce_graphics/native/juce_linux_Fonts.cpp +++ b/modules/juce_graphics/native/juce_linux_Fonts.cpp @@ -112,7 +112,8 @@ public: if (index >= fontDirs.size()) return false; - iter = new DirectoryIterator (fontDirs [index++], true); + iter = new DirectoryIterator (File::getCurrentWorkingDirectory() + .getChildFile (fontDirs [index++]), true); return next(); } @@ -167,11 +168,11 @@ public: //============================================================================== struct KnownTypeface { - KnownTypeface (const File& file_, const int faceIndex_, const FTFaceWrapper& face) - : file (file_), + KnownTypeface (const File& f, const int index, const FTFaceWrapper& face) + : file (f), family (face.face->family_name), style (face.face->style_name), - faceIndex (faceIndex_), + faceIndex (index), isMonospaced ((face.face->face_flags & FT_FACE_FLAG_FIXED_WIDTH) != 0), isSansSerif (isFaceSansSerif (family)) { @@ -190,17 +191,12 @@ public: { const KnownTypeface* ftFace = matchTypeface (fontName, fontStyle); - if (ftFace == nullptr) - ftFace = matchTypeface (fontName, "Regular"); - - if (ftFace == nullptr) - ftFace = matchTypeface (fontName, String::empty); + if (ftFace == nullptr) ftFace = matchTypeface (fontName, "Regular"); + if (ftFace == nullptr) ftFace = matchTypeface (fontName, String::empty); if (ftFace != nullptr) { - FTFaceWrapper::Ptr face (new FTFaceWrapper (library, ftFace->file, ftFace->faceIndex)); - - if (face->face != 0) + if (FTFaceWrapper::Ptr face = new FTFaceWrapper (library, ftFace->file, ftFace->faceIndex)) { // If there isn't a unicode charmap then select the first one. if (FT_Select_Charmap (face->face, ft_encoding_unicode) != 0)