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

Fix for linux font path parsing assertion.

This commit is contained in:
jules 2012-10-25 22:50:11 +01:00
parent fdb31aff5c
commit f84d57243b

View file

@ -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)