1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Fixed failure when failing to load a font

This commit is contained in:
Brian Fiete 2020-01-15 08:32:38 -08:00
parent ba2c63af9a
commit 957f24e159
2 changed files with 22 additions and 10 deletions

View file

@ -143,19 +143,19 @@ bool FTFont::Load(const StringImpl& fileName, float pointSize)
*facePtr = face;
face->mFileName = fileName;
FT_Face ftFace;
auto error = FT_New_Face(gFTLibrary, fileName.c_str(), 0, &ftFace);
if (error != FT_Err_Ok)
return false;
FT_Face ftFace = NULL;
auto error = FT_New_Face(gFTLibrary, fileName.c_str(), 0, &ftFace);
face->mFTFace = ftFace;
}
else
{
face = *facePtr;
}
mFace = face;
if (face->mFTFace == NULL)
return false;
mFace = face;
FTFontManager::FaceSize** faceSizePtr = NULL;
if (face->mFaceSizes.TryAdd(pointSize, NULL, &faceSizePtr))
{