| @@ -112,7 +112,8 @@ public: | |||||
| if (index >= fontDirs.size()) | if (index >= fontDirs.size()) | ||||
| return false; | return false; | ||||
| iter = new DirectoryIterator (fontDirs [index++], true); | |||||
| iter = new DirectoryIterator (File::getCurrentWorkingDirectory() | |||||
| .getChildFile (fontDirs [index++]), true); | |||||
| return next(); | return next(); | ||||
| } | } | ||||
| @@ -167,11 +168,11 @@ public: | |||||
| //============================================================================== | //============================================================================== | ||||
| struct KnownTypeface | 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), | family (face.face->family_name), | ||||
| style (face.face->style_name), | style (face.face->style_name), | ||||
| faceIndex (faceIndex_), | |||||
| faceIndex (index), | |||||
| isMonospaced ((face.face->face_flags & FT_FACE_FLAG_FIXED_WIDTH) != 0), | isMonospaced ((face.face->face_flags & FT_FACE_FLAG_FIXED_WIDTH) != 0), | ||||
| isSansSerif (isFaceSansSerif (family)) | isSansSerif (isFaceSansSerif (family)) | ||||
| { | { | ||||
| @@ -190,17 +191,12 @@ public: | |||||
| { | { | ||||
| const KnownTypeface* ftFace = matchTypeface (fontName, fontStyle); | 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) | 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 there isn't a unicode charmap then select the first one. | ||||
| if (FT_Select_Charmap (face->face, ft_encoding_unicode) != 0) | if (FT_Select_Charmap (face->face, ft_encoding_unicode) != 0) | ||||