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

Read-from-memory fixes, render target improvements

This commit is contained in:
Brian Fiete 2025-02-06 08:45:21 -08:00
parent 818ca48759
commit 60988fda8f
13 changed files with 87 additions and 17 deletions

View file

@ -136,13 +136,18 @@ bool FTFont::Load(const StringImpl& fileName, float pointSize)
FTFontManager::Face* face = NULL;
String key = fileName;
void* memPtr = NULL;
int memLen = 0;
bool isMemory = ParseMemorySpan(fileName, memPtr, memLen, &key);
FTFontManager::Face** facePtr = NULL;
if (gFTFontManager.mFaces.TryAdd(fileName, NULL, &facePtr))
if (gFTFontManager.mFaces.TryAdd(key, NULL, &facePtr))
{
face = new FTFontManager::Face();
*facePtr = face;
face->mFileName = fileName;
face->mFileName = key;
FT_Face ftFace = NULL;
String useFileName = fileName;
@ -153,10 +158,8 @@ bool FTFont::Load(const StringImpl& fileName, float pointSize)
faceIdx = atoi(useFileName.c_str() + atPos + 1);
useFileName.RemoveToEnd(atPos);
}
void* memPtr = NULL;
int memLen = 0;
if (ParseMemorySpan(fileName, memPtr, memLen))
if (isMemory)
{
FT_New_Memory_Face(gFTLibrary, (FT_Byte*)memPtr, memLen, faceIdx, &ftFace);
}