diff options
Diffstat (limited to 'core/fxge/ge/cfx_fontmgr.cpp')
-rw-r--r-- | core/fxge/ge/cfx_fontmgr.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/core/fxge/ge/cfx_fontmgr.cpp b/core/fxge/ge/cfx_fontmgr.cpp index 95a2b662ed..981a9be288 100644 --- a/core/fxge/ge/cfx_fontmgr.cpp +++ b/core/fxge/ge/cfx_fontmgr.cpp @@ -132,7 +132,7 @@ FXFT_Face CFX_FontMgr::GetCachedFace(const CFX_ByteString& face_name, CTTFontDesc* pFontDesc = it->second; pFontData = pFontDesc->m_pFontData; pFontDesc->m_RefCount++; - return pFontDesc->m_SingleFace.m_pFace; + return pFontDesc->m_SingleFace; } FXFT_Face CFX_FontMgr::AddCachedFace(const CFX_ByteString& face_name, @@ -143,27 +143,25 @@ FXFT_Face CFX_FontMgr::AddCachedFace(const CFX_ByteString& face_name, int face_index) { CTTFontDesc* pFontDesc = new CTTFontDesc; pFontDesc->m_Type = 1; - pFontDesc->m_SingleFace.m_pFace = nullptr; - pFontDesc->m_SingleFace.m_bBold = weight; - pFontDesc->m_SingleFace.m_bItalic = bItalic; + pFontDesc->m_SingleFace = nullptr; pFontDesc->m_pFontData = pData; pFontDesc->m_RefCount = 1; InitFTLibrary(); FXFT_Library library = m_FTLibrary; int ret = FXFT_New_Memory_Face(library, pData, size, face_index, - &pFontDesc->m_SingleFace.m_pFace); + &pFontDesc->m_SingleFace); if (ret) { delete pFontDesc; return nullptr; } - ret = FXFT_Set_Pixel_Sizes(pFontDesc->m_SingleFace.m_pFace, 64, 64); + ret = FXFT_Set_Pixel_Sizes(pFontDesc->m_SingleFace, 64, 64); if (ret) { delete pFontDesc; return nullptr; } m_FaceMap[KeyNameFromFace(face_name, weight, bItalic)] = pFontDesc; - return pFontDesc->m_SingleFace.m_pFace; + return pFontDesc->m_SingleFace; } FXFT_Face CFX_FontMgr::GetCachedTTCFace(int ttc_size, @@ -178,11 +176,11 @@ FXFT_Face CFX_FontMgr::GetCachedTTCFace(int ttc_size, pFontData = pFontDesc->m_pFontData; pFontDesc->m_RefCount++; int face_index = GetTTCIndex(pFontDesc->m_pFontData, ttc_size, font_offset); - if (!pFontDesc->m_TTCFace.m_pFaces[face_index]) { - pFontDesc->m_TTCFace.m_pFaces[face_index] = + if (!pFontDesc->m_TTCFaces[face_index]) { + pFontDesc->m_TTCFaces[face_index] = GetFixedFace(pFontDesc->m_pFontData, ttc_size, face_index); } - return pFontDesc->m_TTCFace.m_pFaces[face_index]; + return pFontDesc->m_TTCFaces[face_index]; } FXFT_Face CFX_FontMgr::AddCachedTTCFace(int ttc_size, @@ -194,13 +192,13 @@ FXFT_Face CFX_FontMgr::AddCachedTTCFace(int ttc_size, pFontDesc->m_Type = 2; pFontDesc->m_pFontData = pData; for (int i = 0; i < 16; i++) - pFontDesc->m_TTCFace.m_pFaces[i] = nullptr; + pFontDesc->m_TTCFaces[i] = nullptr; pFontDesc->m_RefCount++; m_FaceMap[KeyNameFromSize(ttc_size, checksum)] = pFontDesc; int face_index = GetTTCIndex(pFontDesc->m_pFontData, ttc_size, font_offset); - pFontDesc->m_TTCFace.m_pFaces[face_index] = + pFontDesc->m_TTCFaces[face_index] = GetFixedFace(pFontDesc->m_pFontData, ttc_size, face_index); - return pFontDesc->m_TTCFace.m_pFaces[face_index]; + return pFontDesc->m_TTCFaces[face_index]; } FXFT_Face CFX_FontMgr::GetFixedFace(const uint8_t* pData, |