Browse Source

Fix for linux font path parsing assertion.

tags/2021-05-28
jules 12 years ago
parent
commit
f84d57243b
1 changed files with 8 additions and 12 deletions
  1. +8
    -12
      modules/juce_graphics/native/juce_linux_Fonts.cpp

+ 8
- 12
modules/juce_graphics/native/juce_linux_Fonts.cpp 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)


Loading…
Cancel
Save