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:
parent
818ca48759
commit
60988fda8f
13 changed files with 87 additions and 17 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue